• 大小: 121KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2022-10-06
  • 语言: Matlab
  • 标签: ICA  matlab  

资源简介

ICA独立成分分析的matlab代码,内有音频数据,以及使用说明,希望对大家有所帮助。

资源截图

代码片段和文件信息

function [M] = correlation(XNFFTFSwinOVERLAPN)
%
% function [M] = correlation(XFSNFFTOVERLAPN)
% making correlation matrices for each frequency
% X must has 2 column
%
% Shiro Ikeda 14July1998 

SPLEN = 1000;

[LENGTHdim] = size(X);

FL = floor((LENGTH-NFFT)/(NFFT-OVERLAP))+1;
DL = (SPLEN-1)*(NFFT-OVERLAP)+NFFT;
NF = NFFT/2+1;

repeat=floor(FL/SPLEN);

MARGIN=zeros(2*NFN);
te=OVERLAP; M=zeros(2*NF2*N+2); AVE=zeros(2*NF1);
for ITER=1:repeat
  ts = te-OVERLAP+1; te = ts-1+DL;
  B1=specgram(X(ts:te1)NFFTFSwinOVERLAP);
  B2=specgram(X(ts:te2)NFFTFSwinOVERLAP);
  if ITER==1
    STKH1=B1(:1:N); STKH2=B2(:1:N);
  end
  for f=1:NF
    f1=2*f-1; f2=2*f; 
    AVE(f1) = AVE(f1)+B1(f:)*ones(SPLEN1);
    AVE(f2) = AVE(f2)+B2(f:)*ones(SPLEN1);
    TMP=[MARGIN(f1:)B1(f:);MARGIN(f2:)B2(f:)];
    MARGIN(f1:f2:)=[B1(fSPLEN-N+1:SPLEN);B2(fSPLEN-N+1:SPLEN)];
    for tau=0:N
      TMP1=TMP(:N-tau+1:SPLEN+N-tau)*TMP(:N+1:SPLEN+N)‘;
      M(f1:f22*tau+1:2*tau+2)=M(f1:f22*tau+1:2*tau+2)+TMP1;
    end
  end
end

ts = te-OVERLAP+1; te = LENGTH;
B1=specgram(X(ts:te1)NFFTFSwinOVERLAP);
B2=specgram(X(ts:te2)NFFTFSwinOVERLAP);
RL=size(B12);
if repeat==0
  STKH1=B1(:1:N); STKH2=B2(:1:N);
end
STKT1=B1(:RL-N+1:RL); STKT2=B2(:RL-N+1:RL);
for f=1:NF
  f1=2*f-1; f2=2*f; 
  AVE(f1) = AVE(f1)+B1(f:)*ones(RL1);
  AVE(f2) = AVE(f2)+B2(f:)*ones(RL1);
  TMP=[MARGIN(f1:)B1(f:);MARGIN(f2:)B2(f:)];
  for tau=0:N
    TMP1=TMP(:N-tau+1:RL+N-tau)*TMP(:N+1:RL+N)‘;
    M(f1:f22*tau+1:2*tau+2)=M(f1:f22*tau+1:2*tau+2)+TMP1;
  end
end

AVE=AVE/FL;

for f=1:NF
  f1=2*f-1; f2=2*f; 
  TMPA = AVE(f1:f2)*AVE(f1:f2)‘;
  M(f1:f21:2)=M(f1:f21:2)-TMPA*FL;
  M(f1:f21:2)=M(f1:f21:2)+M(f1:f21:2)‘;
  for tau=1:N
    t1=2*tau+1; t2=2*tau+2;
    T1 = AVE(f1:f2)*FL-[STKT1(fN-tau+1:N);STKT2(fN-tau+1:N)]*ones(tau1);
    T2 = AVE(f1:f2)*FL-[STKH1(f1:tau);STKH2(f1:tau)]*ones(tau1);
    TMP1=T1*AVE(f1:f2)‘; TMP2=AVE(f1:f2)*T2‘;
    M(f1:f2t1:t2)=M(f1:f2t1:t2)-TMP1-TMP2+TMPA*(FL-tau);
    M(f1:f2t1:t2)=M(f1:f2t1:t2)+M(f1:f2t1:t2)‘;
  end
end

for tau=0:N
  M(:2*tau+1:2*tau+2)=M(:2*tau+1:2*tau+2)/(2*(FL-tau));
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        333  1998-07-23 16:02  ica_matlab\ica\decorrelation.m

     文件       2179  1998-07-23 16:02  ica_matlab\ica\correlation.m

     文件       1151  1998-07-23 16:05  ica_matlab\ica\sepfilter.m

     文件       1213  1998-07-24 12:08  ica_matlab\ica\ica_f.m

     文件       1364  1998-07-23 16:02  ica_matlab\ica\permutation.m

     文件      66840  2003-06-23 21:42  ica_matlab\ica\X_room.wav

     文件        960  2003-06-23 21:45  ica_matlab\ica\Readme

     文件     123244  2003-06-23 21:42  ica_matlab\ica\X_linear.wav

     目录          0  2011-10-23 12:57  ica_matlab\ica

     目录          0  2011-10-23 12:57  ica_matlab

----------- ---------  ---------- -----  ----

               197284                    10


评论

共有 条评论