Accuracy of resampling for decreasing vector size
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Vanessa Yau
am 2 Jun. 2020
Kommentiert: Star Strider
am 3 Jun. 2020
I'm wondering if anyone knows exactly how the resampling function works? I'm using it to decrease/reshape the size of my vector from 1473 to 1400, but I want to make sure the values in each column are still the mean of the data I'm compressing into the vector. I tried using this to decrease another vector from ~19000 to 1400, but ended up with almost all NaN's, so I am now questioning what it is really doing.
I would appreciate any insight you might have!
This is how im using resampling for the shorter vector:
Dat(1,:)=resample(A,1400,1473);
0 Kommentare
Akzeptierte Antwort
Star Strider
am 2 Jun. 2020
I have no idea how the other resample call returned ‘almost all NaN"s’, since you did not provide it.
One option is to define the sampling frequency ‘Fs’ as:
t = linspace(min(v_19000), max(v_19000), 1400)
Fs = 1/mean(diff(t));
or use ‘t’ with the techniques descriibed in: Resample a Nonuniformly Sampled Data Set, or similar approaches.
2 Kommentare
Star Strider
am 3 Jun. 2020
The resample function is correct, since it incorporates an anti-aliasing filter. If you are unsure of the sampling intervals, use the approach in the link I already posted with respect to resampling a non-uniformly sampled data set. I also illustrated a way to calculate the time vector and (if necessary) the sampling frequency. That should give you enough to allow you to resample your vector to a shorter length.
Note that the result may not be what you want, unless the original sampling frequency significantly oversamples the waveform you are recording, so that it does not lose appreciable detail when reduced to 0.072 of its original length.
So be aware that what you want to do may not be possible to do, if that condition does not apply to your signal.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multirate Signal Processing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!