Resample Operation: Mismatch between "Nr of Points" and "/RATE"
Fri, 12/14/2018 - 08:15 am
I'm trying to understand the impact in sampling rate in my system and decided to run a quick simulation on Igor using data simulated at 10 kHz and subsampled at different rates. For this purposed i used <igor>Resample</igor> operation
Make/O /N=1000 SampleRates=P+1
For(i=0; i<dimSize(SampleRates,0); i+=1)
//Generate resampled wave
Variable SamplingRate = SampleRates[i]
Duplicate/O DataWave ResampledWave
Resample /rate=(SamplingRate) ResampledWave
String ResampledWaveName = "ResampledWave_"+num2str(SamplingRate)
Duplicate ResampledWave root:ResampledData:$ResampledWaveName
I clipped the original code to focus more on the problem, hope I did not leave out any relevant bit (seems understandable).
In attachment I try to illustrate the behavior of show the result of the resampling the data shown by a dotted line. When data is subsampled to 2Hz over 1 second it produces 2 datapoints as expected, but when is resampled at 3Hz it still continues to produce only 2 datapoints, albeit at different timepoints.
The lower graph in attachment tries to illustrate how this difference between resampling frequency vs number of datapoints found in the generated resampled waves expands higher resampling frequencies.
Can anyone give me a hand with this? It is important that I actually do get a matching number of resampled datapoints to the resample frequency.