An error in filtfilt

8 次查看(过去 30 天)
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));

采纳的回答

Bruno Luong
Bruno Luong 2022-10-1
编辑:Bruno Luong 2022-10-1
Don't tranpose your date if you want to filter along the long dimension
sig= P01EC1(:,:);

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by