How can I resample 50Hz signal to 30Hz?

Illustration
sania urooj - 2021-12-10T12:01:20+00:00
Question: How can I resample 50Hz signal to 30Hz?

I have a accelerometer data whose sample rate is 50Hz. Now, I want to resample this data to 30Hz. How can I do it? I have tried functions like resample, interp and decimate but all of them require the factor to be an integer which is not in this case. Is there any function which can work with non integer factor?

Expert Answer

Profile picture of John Michell John Michell answered . 2025-11-20

It’s always best to upsample rather than downsample because it’s easier to design filters for them.
 
If you must, use the  Signal Processing Toolbox resample funciton:
S50 = ...;                                                  % Signal Sampled At 50 Hz
S30 = resample(S50, 3, 5);                                  % Resampled Signal At 30 Hz
Use resample rather than interp. The resample function incorporates a FIR anti-aliasing filter.
 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!