Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/magland/mountainlab
Browse files Browse the repository at this point in the history
  • Loading branch information
magland committed Mar 2, 2017
2 parents 7824df5 + 8864ee5 commit 1ad0d4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions matlab/processing/ms_bandpass_filter.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,20 @@
figure; subplot(2,1,1);
showpowerspectrum(X,o.samplerate,wid); hold on;
o.freq_min = 300; % high-pass only
Y = ms_bandpass_filter(X,o);
tic; Y = ms_bandpass_filter(X,o); toc
Yc = run_mscmd(X,o);
fprintf('max diff btw matlab and C: %.3g\n',max(max(abs(Y-Yc))))
pad = 2e3; % empirical # timepts
fprintf('max diff btw matlab and C ignoring end bits: %.3g\n',max(max(abs(Y(:,pad:end-pad)-Yc(:,pad:end-pad)))))
showpowerspectrum(Y,o.samplerate,wid,'r-');
o.freq_max = 6000; % band-pass
Y = ms_bandpass_filter(X,o);
tic; Y = ms_bandpass_filter(X,o); toc
Yc = run_mscmd(X,o);
fprintf('max diff btw matlab and C ignoring end bits: %.3g\n',max(max(abs(Y(:,pad:end-pad)-Yc(:,pad:end-pad)))))
showpowerspectrum(Y,o.samplerate,wid,'k-');
vline([o.freq_min,o.freq_max]); % check the -3dB pts
o.freq_min = []; % low-pass only
Y = ms_bandpass_filter(X,o);
tic; Y = ms_bandpass_filter(X,o); toc
Yc = run_mscmd(X,o);
fprintf('max diff btw matlab and C ignoring end bits: %.3g\n',max(max(abs(Y(:,pad:end-pad)-Yc(:,pad:end-pad)))))
showpowerspectrum(Y,o.samplerate,wid,'g-');
Expand Down

0 comments on commit 1ad0d4d

Please sign in to comment.