Error with Filtfilt line 124 and 67.

1 回表示 (過去 30 日間)
Ambra
Ambra 2014 年 8 月 27 日
コメント済み: Geoff Hayes 2014 年 8 月 28 日
Hi everybody, I'm analyzing an EEG but I've encountered some problems. I apply this part of a script:
CR1 = readCRTsd('CSC10.ncs');
dataEEG = resample(Data(CR1), 1, 16);
timeEEG = linspace(StartTime(CR1), EndTime(CR1), length(dataEEG))';
EEG6=tsd (timeEEG,dataEEG);
filelist = dir('CSC*.ncs');
filenames = {filelist.name};
xl=xlim;
EEG6S2 = Restrict(EEG6, xl(1)*10000, xl(2)*10000);
plot(Range(EEG6, 'sec')-StartTime(EEG6, 's'),Data (EEG6)* 3.05185e-005); % plot in mV% ;
Fs = 1 / median(diff(Range(EEG6, 'sec')));
d = fdesign.bandpass('N,F3dB1,F3dB2', 10, 100, 300, Fs);
H = design(d, 'butter');
EslRipples = filtfilt(H.sosMatrix, H.ScaleValues, Data(EEG6S2));
  • * But when I arrive to EslRipples I get this error:
*Error using filtfilt>getCoeffsAndInitialConditions (line 124)
Data must have more than 6 samples.
_ * _ *Error in filtfilt (line 67)
[b,a,zi,nfact,L] = getCoeffsAndInitialConditions(b,a,Npts);
Error in loopcorrelogramandCo (line 13)
EslRipples = filtfilt(H.sosMatrix, H.ScaleValues, Data(EEG6S2));* *
(loopcorrelogramandCo is my script)** _ * _
What does it mean concretely and how may I solve it? Thanks in advance!
  3 件のコメント
Ambra
Ambra 2014 年 8 月 28 日
編集済み: Ambra 2014 年 8 月 28 日
size(Data(EEG6S2))
ans =
1 1
I've tried also to check xl(1) and xl(2):
xl(1)
ans =
0
xl(2)
ans =
1
But xl derives frome xlim... Is this a problem of the resampling?
Geoff Hayes
Geoff Hayes 2014 年 8 月 28 日
Ambra - presumably the above code is within a function or script, so you should put a breakpoint at the first line, and step through the code and check the variables. What is the size of CR1, and of the others? Try to figure out whether you have enough samples to begin with, and at what point they are reduced to 1.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeEEG/MEG/ECoG についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by