|
140 | 140 | figure; subplot(2,1,1); |
141 | 141 | showpowerspectrum(X,o.samplerate,wid); hold on; |
142 | 142 | o.freq_min = 300; % high-pass only |
143 | | -Y = ms_bandpass_filter(X,o); |
| 143 | +tic; Y = ms_bandpass_filter(X,o); toc |
144 | 144 | Yc = run_mscmd(X,o); |
145 | 145 | fprintf('max diff btw matlab and C: %.3g\n',max(max(abs(Y-Yc)))) |
146 | 146 | pad = 2e3; % empirical # timepts |
147 | 147 | fprintf('max diff btw matlab and C ignoring end bits: %.3g\n',max(max(abs(Y(:,pad:end-pad)-Yc(:,pad:end-pad))))) |
148 | 148 | showpowerspectrum(Y,o.samplerate,wid,'r-'); |
149 | 149 | o.freq_max = 6000; % band-pass |
150 | | -Y = ms_bandpass_filter(X,o); |
| 150 | +tic; Y = ms_bandpass_filter(X,o); toc |
151 | 151 | Yc = run_mscmd(X,o); |
152 | 152 | fprintf('max diff btw matlab and C ignoring end bits: %.3g\n',max(max(abs(Y(:,pad:end-pad)-Yc(:,pad:end-pad))))) |
153 | 153 | showpowerspectrum(Y,o.samplerate,wid,'k-'); |
154 | 154 | vline([o.freq_min,o.freq_max]); % check the -3dB pts |
155 | 155 | o.freq_min = []; % low-pass only |
156 | | -Y = ms_bandpass_filter(X,o); |
| 156 | +tic; Y = ms_bandpass_filter(X,o); toc |
157 | 157 | Yc = run_mscmd(X,o); |
158 | 158 | fprintf('max diff btw matlab and C ignoring end bits: %.3g\n',max(max(abs(Y(:,pad:end-pad)-Yc(:,pad:end-pad))))) |
159 | 159 | showpowerspectrum(Y,o.samplerate,wid,'g-'); |
|
0 commit comments