nt_dss0
PURPOSE 
[todss,pwr1,pwr2]=nt_dss0(c0,c1,keep1,keep2) - dss from covariance
SYNOPSIS 
function [todss,pwr0,pwr1]=nt_dss0(c0,c1,keep1,keep2)
DESCRIPTION 
CROSS-REFERENCE INFORMATION 
This function calls:
- nt_greetings nt_greetings - display message the first time the toolbox is used
- nt_pcarot [topcs,eigenvalues]=pcarot(cov,N) - PCA matrix from covariance
This function is called by:
- nt_bias_cluster [c0,c1,A,todss,pwr0,pwr1]=nt_bias_cluster(x,dsr,flags) - cluster covariance
- nt_cluster_jd [A,todss]=nt_cluster_jd(x,dsr,flags) - cluster with joint diagonalization
- nt_dss1 [todss,pwr0,pwr1]=nt_dss1(x,w,keep1,keep2,sns_flag) - evoked-biased DSS denoising
- nt_enforce_stationarity y=nt_enforce_stationarity(x,DSR,thresh) - locally project out non-stationary components
- nt_hi_amp y=nt_hi_amp(x) - decompose into high-amplitude components
- nt_kurtosis [todss,K]=nt_kurtosis(x,nIterations,exponent,w,smooth)- find high-kurtosis components
- nt_narrowband_scan A=nt_narrowband_scan(x,freqs,sr,Q,plotflag) - scan for narrowband components using DSS
- nt_peaky [tocomps,ii]=nt_peaky(c,x,T,nSmooth) - find components that maximize peakiness
- nt_qca0 [tosquares,quads,D]=nt_qca0(x,npcs,nsmooth,nquads) - maximize induced power using quadratic component analysis
- nt_qca02 [tosquare,quad,tosquare2,quad2,D]=nt_qca02(x,npcs,nsmooth) - maximize induced power using quadratic component analysis
- nt_split_jd [idx,score_vector,todss]=nt_split_dss(x,thresh,depth) - segmentation based on joint diagonalization
- test_nt_bias_fft test nt_bias_fft
SOURCE CODE 
0001 function [todss,pwr0,pwr1]=nt_dss0(c0,c1,keep1,keep2)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 nt_greetings;
0022
0023
0024 if nargin<4||isempty(keep2); keep2=10.^-9; end
0025 if nargin<3; keep1=[]; end
0026 if nargin<2; error('needs at least two arguments'); end
0027
0028 if size(c0)~=size(c1); error('C0 and C1 should have same size'); end
0029 if size(c0,1)~=size(c0,2); error('C0 should be square'); end
0030
0031
0032
0033 [topcs1,evs1]=nt_pcarot(c0,keep1);
0034 evs1=abs(evs1);
0035
0036
0037 if ~isempty(keep1); topcs1=topcs1(:,1:keep1); evs1=evs1(1:keep1); end
0038 if ~isempty(keep2); idx=find(evs1/max(evs1)>keep2); topcs1=topcs1(:,idx); evs1=evs1(idx); end
0039
0040
0041
0042
0043 N=diag(sqrt(1./(evs1)));
0044 c2=N'*topcs1'*c1*topcs1*N;
0045
0046
0047 [topcs2,evs2]=nt_pcarot(c2,keep1);
0048
0049
0050 todss=topcs1*N*topcs2;
0051 N2=diag(todss'*c0*todss);
0052 todss=todss*diag(1./sqrt(N2));
0053
0054
0055 pwr0=sqrt(sum((c0'*todss).^2));
0056 pwr1=sqrt(sum((c1'*todss).^2));
0057
Generated on Mon 10-Nov-2014 14:40:42 by m2html © 2005