www.pudn.com > tfarma10.rar > ker_to_lag.m, change:2004-02-05,size:2074b


function Halpha= ker_to_lag(H, MAX_M_LAG, alpha)
% function Halpha= ker_to_lag(H, MAX_M_LAG, alpha)
%   This file is part of the TFPM toolbox v1.0 (c)
%   michael.jachan@tuwien.ac.at and underlies the GPL.
%
% A 2D cyclic signal H[n, n'], 0 <= n, n' <= N-1 is given. Its
% generalized cyclic form Halpha[n, m], 0 <= n <= N-1, -MAX_M_LAG
% <= m <= MAX_M_LAG is computed. alpha may only be +/-1/2! If
% MAX_M_LAG==-1 then  m<=-N/2<=N/2-1, i.e., a square FFT-ready
% matrix! 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;tfpm;
MAR  =   0;
LAR  =   0;
MMA  =   0;
LMA  =   0;
N    =   8;
re_im= 'r';
mo_no= 'm';
tfpm_file_gen;
%-------------
H= (ones(N, 1)*(1:N)*10)' + ones(N, 1)*(1:N);
MAX_M_LAG= -1;
alpha= 1/2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Dimensions:
N= size(H, 1);

if( (MAX_M_LAG==-1) | (MAX_M_LAG>N/2) )
   square= 1;
   MAX_M_LAG= N/2-1;
else
   square= 0;
end;

Halpha= zeros(N, 2*MAX_M_LAG+1+square);
if(alpha==1/2)
   for n= 0:N-1
      row= fliplr([H(n+1, n+2:N) H(n+1, :) H(n+1, 1:n)]);
      Halpha(n+1, :)= row(N-MAX_M_LAG-square:N+MAX_M_LAG);
   end;
elseif(alpha==-1/2)
   for n= 0:N-1
      row= [H(n+2:N, n+1).' H(:, n+1).' H(1:n, n+1).'];
      Halpha(n+1, :)= row(N-MAX_M_LAG-square:N+MAX_M_LAG);
   end;   
else
   disp('ker_to_lag.m: alpha must be +1/2 or -1/2!');
   Halpha= [];
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Hc= ker_to_lag(H, MAX_M_LAG, alpha);
Hn= ker_to_lag_non(H, MAX_M_LAG, alpha);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%