0001
0002
0003
0004
0005
0006
0007 clear;
0008 disp(mfilename);
0009 help(mfilename)
0010
0011
0012 FNAME=[fileparts(which('nt_version')), '/DATA/example_data.mat'];
0013 if ~exist(FNAME);
0014 disp(['file ', FNAME, ' not found, get it at http://cognition.ens.fr/Audition/adc/NoiseTools/DATA/']);
0015 return
0016 end
0017 load(FNAME)
0018
0019
0020
0021
0022
0023
0024
0025 disp('50 Hz & harmonics DSS...');
0026
0027
0028 [c0,c1]=nt_bias_fft(meg,[50, 100, 150]/sr, 512);
0029
0030
0031 [todss,pwr0,pwr1]=nt_dss0(c0,c1);
0032 p1=pwr1./pwr0;
0033
0034
0035 z=nt_mmat(meg,todss);
0036
0037
0038 NREMOVE=20;
0039 clean=nt_tsr(meg,z(:,1:NREMOVE,:));
0040
0041
0042 figure(1); clf; set(gcf,'color', [1 1 1]);
0043 plot(p1, '.-'); xlabel('component'); ylabel('score'); title('DSS score');
0044
0045
0046 figure(2); clf; set(gcf,'color', [1 1 1]);
0047 nt_spect_plot2(nt_normcol(z(:,1:30,:)),512,[],[],sr);
0048 title('spectra of first 30 DSS components'); ylabel('component')
0049
0050
0051 figure(3); clf; set(gcf,'color', [1 1 1]);
0052 subplot 121;
0053 nt_spect_plot(meg,1024,[],[],sr);
0054 set(gca,'ygrid','on');
0055 hold on
0056 nt_spect_plot(clean,1024,[],[],sr);
0057 nt_linecolors([],[3 1]);
0058 title('power spectra, average over channels');
0059 legend('before','after'); legend boxoff
0060 set(gca,'ygrid','on');
0061 subplot 122
0062 nt_spect_plot(meg-clean,1024,[],[],sr);
0063 title('noise power (removed)');
0064 set(gca,'ygrid','on');
0065
0066
0067