www.pudn.com > tfarma10.rar > corr_est_non.m, change:2003-12-11,size:2029b

function Qalpha= corr_est_non(x, y, MAX_M_LAG, alpha) % function Qalpha= corr_est_non(x, y, MAX_M_LAG, alpha) % This file is part of the TFPM toolbox v0.9 (c) % michael.jachan@tuwien.ac.at and underlies the GPL. % % Computes the noncyclic outer signal product of x[n] and y[n] for % alpha= +/-1/2. if(MAX_M_LAG==-1) then Qalpha is a full NxN % FFT-ready matrix. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear;%tfpm; MAR = 7; LAR = 5; MMA = 0; LMA = 0; N = 64; re_im= 'r'; mo_no= 'm'; tfpm_file_gen; %------------- x= tvarma_gen(randn(N, 1), Amn, Bmn); %x= (1:N).'; y= x; MAX_M_LAG= -1; alpha = 1/2; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Dimensions: N= length(x); x= x(:);y= y(:); % Check range of MAX_M_LAG MAX_M_LAG= min(MAX_M_LAG, N-1); if(MAX_M_LAG==-1) Msquare= 1; MAX_M_LAG= N/2-1; else Msquare= 0; end; % Outer signal product (== primitive estimator) Qalpha= zeros(N, 2*MAX_M_LAG+1+Msquare); if(alpha==1/2) y1= [flipud(y); zeros(N-1, 1)]; for n= 0:N-1 Qalpha(n+1, :)= x(n+1) * y1(N-MAX_M_LAG-Msquare:N+MAX_M_LAG)'; y1= [0; y1(1:2*N-2) ]; end; elseif(alpha==-1/2) x1= [zeros(N-1, 1); x]; for n= 0:N-1 Qalpha(n+1, :)= y(n+1)' * x1(N-MAX_M_LAG-Msquare:N+MAX_M_LAG).'; x1= [x1(2:2*N-1); 0]; end; end; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% size(Qalpha) Q0= ker_to_lag_non(x*y', -1, alpha); norm(Q0-Qalpha) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%