anal.m

来自「基于Matlab」· M 代码 · 共 62 行

M
62
字号
clear

% Get channel & format it
load charp3;
c=charp3(:,1);
c=c(:)';
c=c/norm(c);
if (rem(length(c),2)==1)
   c=[c 0];
end;

% Divide into even and odd subchannels
ca=c(1:2:length(c));
cb=c(2:2:length(c));
Nc=length(ca);

% Define SNR and noise variance
SNR=45;
sigma2=10^(-SNR/10);

% Compute autocorrelation function
Q=xcorr(ca)+xcorr(cb)+sigma2;

% Perform spectral factorization
% to get feedback filter (matches channel length)
z=roots(Q);
I=find(abs(z)<1);
g=poly(z(I));

% Form truncated all-pass forward FIRs
Nw=256;
Wa=filter(1,g,[ca zeros(1,Nw/2-Nc)]);
Wb=filter(1,g,[cb zeros(1,Nw/2-Nc)]);
Wa=fliplr(Wa);
Wb=fliplr(Wb);

% Compute channel-forward filter combo
v=conv(ca,Wa)+conv(cb,Wb);

% Compute complete channel-equalizer response 
GG=xcorr(g);
gamma=GG(Nc);
h=gamma*filter(1,g,v);


% Plot everything
figure(1)
stem(v);
title('Channel-forward (IIR-MMSE-FSE) filter combo');

figure(2)
stem(h);
title('Channel-forward+backward (IIR-MSE-FSE) filter combo');

figure(3)
subplot(211);
stem(Wa);
title('Forward subchannel (A) filter');
subplot(212);
stem(Wb);
title('Forward subchannel (B) filter');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?