Home > NoiseTools > TEST > test_nt_split3.m

test_nt_split3

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 clear
0002 
0003 N=10000;
0004 
0005 % data is concatenation of segments with different spectral structure
0006 a=randn(N,1);
0007 b=diff(a);
0008 c=sin(2*pi*100*(1:N)'/N);
0009 d=sin(2*pi*110*(1:N)'/N);
0010 %x=[a+1;a;2*a;a;b;c];
0011 x=[a;b;c;d];
0012 
0013 % augment data with time-shifted versions
0014 SHIFTS=0:10;
0015 x=nt_multishift(x,SHIFTS);
0016 
0017 % code 3: minimize change in covariance "shape:
0018 figure(3); clf
0019 DEPTH=2;    % --> 3 split points
0020 nt_split(x,3,DEPTH);
0021 
0022 TOL=10^-6;
0023 disp(['rank of whole data: ', num2str(rank(x,TOL))]);        
0024 idx=nt_split(x,3,DEPTH);
0025 disp(['rank of intervals: ', ...
0026     num2str([rank(x(1:idx(1),:),TOL), ...
0027     rank(x(idx(1)+1:idx(2),:),TOL), ...
0028     rank(x(idx(2)+1:idx(3),:),TOL), ...
0029     rank(x(idx(3)+1:end,:),TOL)])]);

Generated on Fri 23-May-2014 19:34:17 by m2html © 2005