Low pass filter returns NAN

조회 수: 8 (최근 30일)
Kiran Gawas
Kiran Gawas 2012년 6월 25일
hi, I'm trying to use a Low pass filter for my signal data. I have following code for the same
CutF = 25
step = 0.001
fNorm=CutF/(1/(2*step));
[b,a]=butter(10,fNorm,'low');
C1=filtfilt(b,a,Data(:,(i-1)*6+1));
Now this works for some of my data set but for some it returns NAN. I cant figure out why it works in some case and not in others.
thanks in advance
  댓글 수: 2
Honglei Chen
Honglei Chen 2012년 6월 25일
Did you check if your input contains NaN?
the cyclist
the cyclist 2012년 6월 25일
Would it be possible for you to include a very small example of "Data" that will allow us to run your code, and exhibits the problem?

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2012년 6월 26일
The algorithms of filter and filtfilt do not contain magic sources of NaNs. I'd be very surprised, if the NaNs do not exist in the inputs already, or at least Infs. Test this:
all(isfinite(Data(:))
  댓글 수: 1
Cameron
Cameron 2013년 3월 3일
You are not the only one with this problem see link below

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by