I have two vectors: sensorA of length 927 and sensorB of length 1250. I would like to make them of the same length. The resample() function in MATLAB is very noisy at the edges and I need atleast reasonably good accuracy throughout.
I understand that resampling can be done by interpolation, but how do I implement it in the most efficient way. I need to stretch 927 to 1250 as uniformly as possible.
I was wondering if I could do something like this:
Does this make sense? I still won't be able to get an exact interpolation. Is there any other function that I could use? (besides interp()
because it requires an integral resampling rate?)
From a signal-processing view, you should NOT just insert a sample every 3 values. That would be non-uniform stretching and would ruin your signal. The resample function is what you want. Try changing the parameters for n and/or beta. You may need to pad your signal as described here to reduce the edge effects.