nt_pca0
PURPOSE 
[topcs,pwr]=nt_pca0(x,shifts,nkeep,threshold,w) - time-shift pca
SYNOPSIS 
function [topcs,pwr]=nt_pca0(x,shifts,nkeep,threshold,w)
DESCRIPTION 
CROSS-REFERENCE INFORMATION 
This function calls:
- nt_cov [c,tw]=nt_cov(x,shifts,w) - time shift covariance
- nt_pcarot [topcs,eigenvalues]=pcarot(cov,N) - PCA matrix from covariance
This function is called by:
- nt_pca_kmeans [topcs,pwr]=nt_pca_kmeans(x,nkeep) - PCA preceded by kmeans for speed
- 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_qpca0 [tosquares,quads,D]=nt_qpca0(x,npcs,nsmooth,nquads) - quadratic PCA
- nt_split_jd [idx,score_vector,todss]=nt_split_dss(x,thresh,depth) - segmentation based on joint diagonalization
SOURCE CODE 
0001 function [topcs,pwr]=nt_pca0(x,shifts,nkeep,threshold,w)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 if nargin<1; error('!'); end
0017 if nargin<2||isempty(shifts); shifts=[0]; end
0018 if nargin<3; nkeep=[]; end
0019 if nargin<4||isempty(threshold); threshold=0; end
0020 if nargin<5; w=[]; end
0021
0022 [m,n,o]=size(x);
0023
0024
0025
0026
0027
0028 if isempty(w);
0029 c=nt_cov(x,shifts);
0030 else
0031 c=nt_cov(x,shifts,w);
0032 end
0033
0034
0035 if ~isempty(nkeep)
0036 topcs=nt_pcarot(c,nkeep);
0037 else
0038 topcs=nt_pcarot(c);
0039 end
0040
0041
0042
0043
0044 pwr=diag(topcs'*c*topcs)/(m*o);
0045 idx=find(pwr/max(pwr)>threshold);
0046 pwr=pwr(idx);
0047 topcs=topcs(:,idx);
0048
0049
0050
Generated on Mon 10-Nov-2014 14:40:42 by m2html © 2005