Skip to content

Commit 27cd14d

Browse files
committed
Included code review comments for FBCSP modified version.
1 parent 5384222 commit 27cd14d

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

code/paradigms/ParadigmFBCSPMod.m

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
arg_norep('signal'), ...
7171
arg({'patterns','PatternPairs'},3,uint32([1 1 64 10000]),'CSP patterns per band (times two).','cat','Feature Extraction'), ...
7272
arg({'freqwnds','FreqWindows'},[0.5 3; 4 7; 8 12; 13 30; 31 42],[0 0.5 200 1000],'Frequency bands of interest. Matrix containing one row for the start and end of each frequency band from which CSP patterns shall be computed. Values in Hz.','cat','Feature Extraction'), ...
73-
arg({'timewnds','TimeWindows'},[],[],'Time windows of interest. Matrix containing one row for the start and end of each time window from which CSP patterns shall be computed. Values in seconds. If both this and the freqwnds parameter are non-empty, they should have the same number of rows.','cat','Feature Extraction'), ...
7473
arg({'winfunc','WindowFunction'},'rect',{'barthann','bartlett','blackman','blackmanharris','bohman','cheb','flattop','gauss','hamming','hann','kaiser','nuttall','parzen','rect','taylor','triang','tukey'},'Type of window function. Typical choices are rect (rectangular), hann, gauss, blackman and kaiser.'),...
7574
arg({'winparam','WindowParameter','param'},[],[],'Parameter of the window function. This is mandatory for cheb, kaiser and tukey and optional for some others.','shape','scalar'),...
7675
arg({'nfft','NFFT'}, [], [],'Size of the FFT used in spectrum calculation. Default value is the greater of 256 or the next power of 2 greater than the length of the signal.' ),...
@@ -81,15 +80,10 @@
8180
error('Multi-band CSP does intrinsically not support single-channel data (it is a spatial filter).'); end
8281
if args.signal.nbchan < args.patterns
8382
error('Multi-band CSP prefers to work on at least as many channels as you request output patterns. Please reduce the number of pattern pairs.'); end
84-
if ~isempty(args.freqwnds) && ~isempty(args.timewnds) && size(args.freqwnds,1) ~= size(args.timewnds,1)
85-
error('If both time and frequency windows are specified, both arrays must have the same number of rows (together they define the windows in time and frequency).'); end
86-
if isempty(args.timewnds)
87-
args.timewnds = zeros(size(args.freqwnds,1),0); end
88-
if isempty(args.freqwnds)
89-
args.freqwnds = zeros(size(args.timewnds,1),0); end
9083

91-
[signal, nof, freqwnds, timewnds, winfunc, winparam, nfft, winlen, numoverlap] = deal(args.signal, args.patterns, args.freqwnds,...
92-
args.timewnds, args.winfunc, args.winparam, args.nfft, args.winlen, args.numoverlap);
84+
85+
[signal, nof, freqwnds, winfunc, winparam, nfft, winlen, numoverlap] = deal(args.signal, args.patterns, args.freqwnds,...
86+
args.winfunc, args.winparam, args.nfft, args.winlen, args.numoverlap);
9387

9488
[C,S,dum] = size(signal.data);
9589
Fs = signal.srate;
@@ -108,7 +102,7 @@
108102
if isempty(nfft)
109103
innfft = 2^(nextpow2(signal.pnts));
110104
else
111-
innfft = max(nfft, 2^(nextpow2(signal.pnts)))
105+
innfft = max(nfft, 2^(nextpow2(signal.pnts)));
112106
if innfft > nfft
113107
error(' The chosen length of FFT is too short. '); end
114108
end

0 commit comments

Comments
 (0)