www.pudn.com > tfarma10.rar > gen_eggbox.m, change:2004-10-28,size:2871b


function Rnk= gen_eggbox(N, par)
% function Rnk= gen_eggbox(N, par)
%   This file is part of the TFPM toolbox v1.0 (c)
%   michael.jachan@tuwien.ac.at and underlies the GPL.
% 
% Searches TFARMA(M, L) models for M= 1:Mmax, L= 0:Lmax. Uses the
% linear estimator. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;tfpm;
N    = 256;
%       ampl  Pn  Pk s_n s_k
par  = [
        1     63-32 -32   3   3;
        1     63-32  31   3   3;
        1    127-32 -32   3   3;
        1    127-32  31   3   3;
        1    191-32 -32   3   3;
        1    191-32  31   3   3;
        1    255-32 -32   3   3;
        1    255-32  31   3   3;
       ];



nn= 4;
par= [ones(nn^2, 1)...
      kron(ones(nn, 1), (N/nn-1:N/nn:N-1)')...
      kron(ones(nn, 1), (-N/nn-1:N/nn:N/2-1)')...
      3*ones(nn^2, 1)...
      3*ones(nn^2, 1)...
     ]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I= size(par, 1);

Rnk= zeros(N);
for n= 0:N-1
   for k= -N/2:N/2-1
      for i= 1:I
         Rnk(n+1, k+N/2+1)= Rnk(n+1, k+N/2+1) + par(i, 1)*... 
            exp(-((n-par(i, 2))^2+(k-par(i, 3))^2)/par(i, 4)^2/par(i, 5)^2);
      end;
   end;
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tf_show(Rnk)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;tfpm;
N    = 256;
%       ampl  Pn  Pk s_n s_k
par  = [
        1     63-32 -16   5   1;
        1     63-32  15   3   2;
        1    127-32 -16   5   1;
        1    127-32  15   3   2;
        1    191-32 -16   5   1;
        1    191-32  15   3   2;
        1    255-32 -16   5   1;
        1    255-32  15   3   2;
       ];
Rnk= gen_eggbox(N, par);
figure(1);tf_show(Rnk)
Aml= nm_to_ml(nk_to_nm(Rnk));
figure(2);tf_show(Aml)
for LAR= 0:10
   MAR= 10;
   [AA, BB]= tfar_est_tfywu(Aml(N/2-3*LAR+1:N/2+3*LAR+1, N/2-MAR+1:N/2+MAR+1), N);
   for MAR= 1:10
      [MAR, LAR]
      figure(3);tf_show(tfarma_wvsp(AA(:, 1:MAR+1, MAR), BB(:, 1, MAR), N, 1/2))
      drawnow
   end;
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%