Downsampled data exceeds the input data
이전 댓글 표시
I have an input data sampled at 64 Hz and I want it converted to 60Hz. I tried using 'resample' function and 'downsample' function within matlab,but in both the cases the output data exceeds the input data at some sample points. For example, the input data contains angles in degrees which is under -180 deg to +180 deg, but the downsampled data contains 220 deg,which is wrong. how to avoid these?
In the attached picture, you can find all the input and output are overlayed. Can someone please help me?
댓글 수: 2
Mathieu NOE
2022년 11월 18일
hello
for the resampling task , use interp1 with a new time vector defined at rate = 60 Hz
to avoid data above / below +/- 180 ° use wrap
Chandramouli Jambunathan
2022년 11월 18일
채택된 답변
추가 답변 (1개)
Jan
2022년 11월 18일
0 개 추천
A linear interpolation avoids output points outside the range of input point. Use interp1 or the modern and faster griddedInterpolant .
A fast C-mex function for this job: https://www.mathworks.com/matlabcentral/fileexchange/25463-scaletime
댓글 수: 3
Chandramouli Jambunathan
2022년 11월 18일
Jan
2022년 11월 18일
I do not understand the meaning of "Both 'interp1' and 'griddedInterpolant' function expects specific data points". But Mathieu has show already, how to use these interpolation methods.
Chandramouli Jambunathan
2022년 11월 18일
카테고리
도움말 센터 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
