0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 clear;
0011 disp(mfilename);
0012 help(mfilename)
0013
0014
0015 FNAME='../DATA/example_data.mat';
0016 if ~exist(FNAME);
0017 disp('file ''../DATA/example_data.mat'' not found, get it at http://cognition.ens.fr/Audition/adc/NoiseTools/DATA/');
0018 return
0019 end
0020 load(FNAME)
0021
0022
0023
0024
0025
0026
0027
0028 disp('remove 50 Hz & harmonics...');
0029 [c0,c1]=nt_bias_fft(meg,[50, 100, 150]/sr, 512);
0030 [todss,pwr0,pwr1]=nt_dss0(c0,c1);
0031 p1=pwr1./pwr0;
0032 z=nt_mmat(meg,todss);
0033 NREMOVE=20;
0034 meg=nt_tsr(meg,z(:,1:NREMOVE,:));
0035
0036
0037 DSRATIO=3;
0038 meg=nt_dsample(meg,DSRATIO);
0039 sr=sr/DSRATIO;
0040
0041
0042
0043
0044 disp('DSS to isolate 16 Hz components...');
0045 FPEAK=16;
0046 Q=8;
0047 [b,a]=nt_filter_peak(FPEAK/(sr/2),Q);
0048
0049
0050 [c0,c1]=nt_bias_filter(meg,b,a);
0051
0052
0053 [todss,pwr0,pwr1]=nt_dss0(c0,c1);
0054 p1=pwr1./pwr0;
0055
0056
0057 z=nt_mmat(meg,todss);
0058
0059
0060
0061 figure(1); clf; set(gcf,'color', [1 1 1]);
0062 plot(p1, '.-'); xlabel('component'); ylabel('score'); title('DSS score');
0063
0064
0065
0066 figure(2); clf; set(gcf,'color', [1 1 1]);
0067 nt_spect_plot2(nt_normcol(z(:,1:30,:)),512,[],[],sr);
0068 title('spectra of first 30 DSS components'); ylabel('component')
0069
0070
0071 figure(3); clf; set(gcf,'color', [1 1 1]);
0072 nt_spect_plot(nt_normcol(z(:,1,:)),512,[],[],sr);
0073 hold on;
0074 [~,idx]=max(abs(nt_xcov(z(:,1,:),nt_normcol(meg))));
0075 nt_spect_plot(nt_normcol(meg(:,idx,:)),512,[],[],sr);
0076 nt_colorlines([], [3 1]);
0077 legend('best component', 'best sensor'); legend boxoff; axis tight
0078 title('bias to 16 Hz')
0079
0080