Home > NoiseTools > TEST > test_nt_cluster_jd.m

test_nt_cluster_jd

PURPOSE ^

{

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

{
 Simple situation with states A, B, rank(A)=9, rank(B)=9; rank(AUB)=10.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %{
0002 % Simple situation with states A, B, rank(A)=9, rank(B)=9; rank(AUB)=10.
0003 
0004 10 channels, 2 data segments.
0005 In each each segment 9 noise sources are active, projected into
0006 the data via distinct 9*10 mixing matrices with random coefficients.
0007 %}
0008 clear; close all
0009 
0010 NSAMPLES=100000; % size of segment
0011 NCHANS=5;
0012 DSR=100; % determines granularity (& minimum cluster size)
0013 FLAGS=[]; % 'norm' or 'norm2'
0014 
0015 if 0 
0016     noise=randn(NSAMPLES,NCHANS-1);
0017     noise=nt_normcol(nt_pca(noise)); % ensure perfect decorrelation (not required)
0018     x1=noise*randn(NCHANS-1,NCHANS);
0019     x2=noise*randn(NCHANS-1,NCHANS-1);
0020     x1=nt_normcol(x1); % normalize to remove power step
0021     x2=nt_normcol(x2); 
0022     x=[x1; x2]; %
0023 
0024     nt_cluster_jd(x,DSR);
0025     [IDX,TODSS,SCORE]=nt_cluster_jd(x,DSR,FLAGS);
0026     disp(['score: ',num2str(SCORE')]);
0027 
0028     pause;
0029 end
0030 
0031 %{
0032 % Multiple states of rank 9, rank of concatenated=10.
0033 %}
0034 NSTATES=3;
0035 x=[];
0036 noise=randn(NSAMPLES,NCHANS-1);
0037 noise=nt_normcol(nt_pca(noise)); % ensure perfect decorrelation (not required)
0038 for iState=1:NSTATES
0039     x1=noise*randn(NCHANS-1,NCHANS);
0040     x1=nt_normcol(x1); % normalize to remove power step
0041     x=[x;x1]; %
0042 end
0043 
0044 nt_cluster_jd(x,DSR);
0045 return
0046 [IDX,TODSS,SCORE]=nt_cluster_jd(x,DSR,FLAGS);
0047 disp(['score: ',num2str(SCORE')]);

Generated on Sat 29-Apr-2023 17:15:46 by m2html © 2005