why filtering gives nan values.

Am applying low pass filter to my signal data using
[b11,a11] = butter(5,4/24);
MM1= filtfilt(b11,a11,MM1);
but the result comes out nan. I don't have any nans in my MM1 data . Any help?

 Réponse acceptée

Youssef  Khmou
Youssef Khmou le 5 Avr 2013

0 votes

hi,
I think the input has a NaN, look at this example :
r=rand(100,1);
[b11,a11] = butter(5,4/24);
MM1= filtfilt(b11,a11,r); % Normal Filtering
r(end/2)=NaN; % FOR example a middle value to be NaN
MM2= filtfilt(b11,a11,r);
MM2 is vector of NaNs, only one NaN value in r produces NaNs in the output .
try :
isnan(MM1)

4 commentaires

Ede gerlderlands
Ede gerlderlands le 5 Avr 2013
Thanks, I checked that there is no nan in the input.
Youssef  Khmou
Youssef Khmou le 5 Avr 2013
hi, well that is not usual, ok can you process only the Half of the MM1 vector ans see ? can you post the vector MM1?
Honglei Chen
Honglei Chen le 5 Avr 2013
@Ede, do you have things like inf in your data?
Ede gerlderlands
Ede gerlderlands le 5 Avr 2013
Thanks for your support

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by