⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blind1cma.m

📁 盲均衡1
💻 M
字号:
% Blind channel estimation/equalization
% adpative CMA method
%
% Copyright: Xiaohua(Edward) Li, Assistant Professor
%            Department of Electrical and Computer Engineering
%            State University of New York at Binghamton
%            http://ucesp.ws.binghamton.edu/~xli
% June 2003
%
clear

T=3000;    % total number of data
dB=100;     % SNR in dB value

%%%%%%%%% Simulate the Received noisy Signal  %%%%%%%%%%%
N=20; % smoothing length N+1
Lh=5;  % channel length = Lh+1
P=round((N+Lh)/2);  % equalization delay

h=randn(1,Lh+1)+sqrt(-1)*randn(1,Lh+1);   % channel (complex)
% j=sqrt(-1);
% h=[0.0545+j*0.05 .2832-.1197*j -.7676+.2788*j -.0641-.0576*j ...
%         .0566-.2275*j .4063-.0739*j];
h=h/norm(h);                     % normalize

s=round(rand(1,T))*2-1;  % QPSK or 4 QAM symbol sequence
s=s+sqrt(-1)*(round(rand(1,T))*2-1);

% generate received noisy signal
x=filter(h,1,s);
vn=randn(1,T)+sqrt(-1)*randn(1,T);   % AWGN noise (complex)
vn=vn/norm(vn)*10^(-dB/20)*norm(x);  % adjust noise power with SNR dB value
SNR=20*log10(norm(x)/norm(vn))       % Check SNR of the received samples
x=x+vn;                           % received signal

%%%%%%%%%%%%% adaptive equalizer estimation via CMA
Lp=T-N;   %% remove several first samples to avoid 0 or negative subscript
X=zeros(N+1,Lp);  % sample vectors (each column is a sample vector)
for i=1:Lp
    X(:,i)=x(i+N:-1:i).';
end

e=zeros(1,Lp);  % used to save instant error
f=zeros(N+1,1); f(P)=1;    % initial condition
R2=2;                  % constant modulas of QPSK symbols
mu=0.001;      % parameter to adjust convergence and steady error
for i=1:Lp
   e(i)=abs(f'*X(:,i))^2-R2;                  % instant error
   f=f-mu*2*e(i)*X(:,i)*X(:,i)'*f;     % update equalizer 
   f(P)=1;
%   i_e=[i/10000 abs(e(i))]             % output information 
end   
   
sb=f'*X;   % estimate symbols (perform equalization)

% calculate SER
H=zeros(N+1,N+Lh+1); for i=1:N+1, H(i,i:i+Lh)=h; end  % channel matrix
fh=f'*H;    % composite channel+equalizer response should be delta-like 
temp=find(abs(fh)==max(abs(fh)));   % find the max of the composite response

sb1=sb/(fh(temp));  % scale the output
sb1=sign(real(sb1))+sqrt(-1)*sign(imag(sb1));  % perform symbol detection
start=6;  % carefully find the corresponding begining point
sb2=sb1-s(start+1:start+length(sb1));  % find error symbols
SER=length(find(sb2~=0))/length(sb2)   % calculate SER

if 1
    subplot(221), 
    plot(s,'o');   % show the pattern of transmitted symbols
    grid,title('Transmitted symbols');  xlabel('Real'),ylabel('Image')
    axis([-2 2 -2 2])
    
    subplot(222),
    plot(x,'o');  % show the pattern of received samples
    grid, title('Received samples');  xlabel('Real'), ylabel('Image')
    
    subplot(223),
    plot(sb,'o');   % show the pattern of the equalized symbols
    grid, title('Equalized symbols'), xlabel('Real'), ylabel('Image')

    subplot(224),
    plot(abs(e));   % show the convergence
    grid, title('Convergence'), xlabel('n'), ylabel('Error e(n)')
end

⌨️ 快捷键说明

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