An error in filtfilt

8 visualizzazioni (ultimi 30 giorni)
Neda Deljavan
Neda Deljavan il 1 Ott 2022
Modificato: Bruno Luong il 1 Ott 2022
load P01EC1
sig= P01EC1(:,:)';
sig is 4x30800 double
When I did like this:
subs_cd1_alpha=filtfilt(b,a,sig);
Ive got this error:
Error using filtfilt>getCoeffsAndInitialConditions (line 228)
Data length must be larger than 18 samples.
Error in filtfilt>efiltfilt (line 129)
[b2,a2,zi,nfact,L] = getCoeffsAndInitialConditions(b,a,Npts);
Error in filtfilt (line 89)
y=efiltfilt(b,a,x);
Error in subject_01_EC1Ac (line 287)
subs_cd1_alpha=filtfilt(b,a,sig);
And
In this case:
for i=1:4
subs_cd1_alpha=filtfilt(b,a,sig(:,i));
end
This error happened:
Error using filtfilt>getCoeffsAndInitialConditions (line 228)
Data length must be larger than 18 samples.
Error in filtfilt>efiltfilt (line 129)
[b2,a2,zi,nfact,L] = getCoeffsAndInitialConditions(b,a,Npts);
Error in filtfilt (line 89)
y=efiltfilt(b,a,x);
Error in subject_01_EC1Ac (line 285)
subs_cd1_alpha=filtfilt(b,a,sig(:,i));

Risposta accettata

Bruno Luong
Bruno Luong il 1 Ott 2022
Modificato: Bruno Luong il 1 Ott 2022
Don't tranpose your date if you want to filter along the long dimension
sig= P01EC1(:,:);

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by