|
70 | 70 | arg_norep('signal'), ...
|
71 | 71 | arg({'patterns','PatternPairs'},3,uint32([1 1 64 10000]),'CSP patterns per band (times two).','cat','Feature Extraction'), ...
|
72 | 72 | 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'), ... |
74 | 73 | 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.'),...
|
75 | 74 | arg({'winparam','WindowParameter','param'},[],[],'Parameter of the window function. This is mandatory for cheb, kaiser and tukey and optional for some others.','shape','scalar'),...
|
76 | 75 | 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 | 80 | error('Multi-band CSP does intrinsically not support single-channel data (it is a spatial filter).'); end
|
82 | 81 | if args.signal.nbchan < args.patterns
|
83 | 82 | 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 |
90 | 83 |
|
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); |
93 | 87 |
|
94 | 88 | [C,S,dum] = size(signal.data);
|
95 | 89 | Fs = signal.srate;
|
|
108 | 102 | if isempty(nfft)
|
109 | 103 | innfft = 2^(nextpow2(signal.pnts));
|
110 | 104 | else
|
111 |
| - innfft = max(nfft, 2^(nextpow2(signal.pnts))) |
| 105 | + innfft = max(nfft, 2^(nextpow2(signal.pnts))); |
112 | 106 | if innfft > nfft
|
113 | 107 | error(' The chosen length of FFT is too short. '); end
|
114 | 108 | end
|
|
0 commit comments