How to design a butterworth filter for velocity data?
3 次查看(过去 30 天)
显示 更早的评论
Hi guys,
I have only just started learning about filters and am having some trouble/questions. I am working with the energy spectrum from velocity data and I would like to do a high-pass butterworth filter with a cut-off frequency of 0.5Hz. I have written a code. However, when I apply it, my velocities increase from 0.5 to 20 or more! And when I use pwelch to plot my spectrum, the energy values increase tremendously, which is definetely wrong.
n = 5; % order of the Butterworth filter
fc = 0.5; % Cut-off frequency in Hz
fs = 8; % Sampling frequency in Hz
[a,b] = butter(n,fc/(fs/2),'high');
Veloc = filter(b,a,Veloc);
For me, the way I have designed, I should be basically filtering out signals with a lower frequency than 0.5Hz, but that's obviously not what is going on. Can someone tell me what I am doing wrong?
If I use filtfilt instead of filter, I get only NaN.
Thanks so much for the help! I am really struggling with this.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!