Filtfilt returns NaN matrix
Afficher commentaires plus anciens
I am running the following operation (please download the attached file to your working directory):
load('Channel_Sim.mat');
[b,a] = butter(4, [3 20] ./ (1000/2)); % Sampling frequency is 1000 Hz.
chan_filtered = filtfilt(b, a, chan_data)
However, chan_filtered is a NaN matrix. Why?
I have checked that chan_data does not contain any NaN or Inf. I also tried resetting the butterworth filter range (3-20) over a wide range of values but to no avail. A PSD plot (see attached jpeg file) shows that chan_data encompasses a wide range of frequencies inluding the target frequency (3-20).
2 commentaires
Walter Roberson
le 10 Mai 2023
If you have even 1 nan or inf in your data the filtered results will likely be nan
Aboltabol
le 10 Mai 2023
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Analog Filters dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




