differences between function filtfilt and filter?
조회 수: 42 (최근 30일)
이전 댓글 표시
I want to do low pass filtering for my data, my data is a time series for energey, so all input data are positive. I design a 8 order butterworth filter just like [b,a] = butter(nn,Wn,'low'); then I use data_out=filtfilt(b,a,data_in), the output data has negative values, but if I use data_out=filter(b,a,data_in), the output are all positive. What's wrong with the function filtfilt?
댓글 수: 0
답변 (1개)
Jan
2012년 4월 25일
Nothing is wrong with filtfilt. It simply filters the signal twice to remove the phaseshift. And this can lead to negative values depending on the signal and the filter parameters.
댓글 수: 1
Daniel Shub
2012년 4월 25일
I might be wrong, but I am pretty sure you don't need to filter twice to get the negative values. I think it should be possible that an all positive signal after filtering once can have negative values. If you lowpass filter an all non-negative signal like a click followed by zeros you get negative values.
참고 항목
카테고리
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!