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!