How can I resample 50Hz signal to 30Hz?
11 views (last 30 days)
Show older comments
Bijay Ratna Shakya
on 27 Aug 2016
Commented: sania urooj
on 16 Feb 2021
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?
0 Comments
Accepted Answer
Star Strider
on 27 Aug 2016
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.
5 Comments
sania urooj
on 16 Feb 2021
Hey! I have tried this code too but the sample remain same , it just divide (10 sec) duration ecg signal to 2.5 seconds keepin the 2500 sample as same as before resampling. Did you get it ? please tell me how to resolve it.
More Answers (1)
Aishwarya Ghosh
on 1 May 2019
Is there any way we can do sampling rate conversion(SRC) by an integer factor I/D without using the function 'resample'. Like theoretically, SRC is just upsampling the signal by a factor I, then using a filter(low pass) and then downsampling it by a factor D. Can anyone suggest me how to do that without using the inbuit function 'resample'? Thanks!
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!