Filtfilt returns NaN matrix
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 10 Mag 2023
If you have even 1 nan or inf in your data the filtered results will likely be nan
Aboltabol
il 10 Mag 2023
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Digital Filtering in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




