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

📄 cma.m

📁 基于matlab的CMA盲均衡算法仿真程序
💻 M
字号:
% 盲信道均衡CMA算法
clear all;
clc
N=12000;%数据点总数
SNRdB=25;%信噪比
Lf=11;%滤波器阶数=Lf + 1
% Lh=5;% 信道阶数
% Dy=round((Lf+Lh)/2) ;
Dy=round((Lf+1)/2) ;
% h = [0.9344-1.0311i 2.2483-1.6682i -1.0780 -0.2138i -0.6742+0.8835i 0.3755-0.2771i 0.0886+0.0628i];
h=[1 0 0.5];
% 信道冲激响应
M=16; % 产生8PSK信号
x=randint(N,1,M);
s=qammod(x,M)';
s=s/std(s);
sx=s.*(exp(j*pi/20));
sx=awgn(sx,SNRdB,'measured');
% sx=s.*exp(-j*pi/20);
% sx=awgn(sx,SNRdB,'measured');
% 
x=filter(h,1,sx) ; % 信号通过信道
% x=s;
% x=sx;
% x=x/std(x) ; % 信号功率归一化


Lp=5000;%迭代次数

% Lp=N-Lf;%迭代次数
X=zeros(Lf+1,1);
e=zeros(1,Lp);
w=zeros(Lf+1,1);w(Dy)=1; % 初始化
s=s/std(s);
R2=mean(abs(s).^4)/mean(abs(s).^2)
% R2=1;
% R2=1;
mu=0.002; % 学习速率
for i=1:Lp
    X=x(i+Lf:-1:i).';
    yk=w'*X;% 滤波器输出
    e(i)=abs(yk)^2-R2; %产生误差信号
%     w =w-mu*2*e(i)*X*(yk)'; %更新
    w =w-mu*yk'*e(i)*X; %更新
end
for i=1:Lp
    sb(i)=w'*x(i+Lf:-1:i).'; % 均衡接收信号
end ;

% c=subclust([real(sb)' imag(sb)'],0.10)
subplot(1,2,1)
%figure(1)
% scatterplot(s);
plot (sx,'.') ;
grid ,title ('存在相位偏转信号星座图,SNR=25dB') ; xlabel ('Real') ,ylabel ('Image')
% axis([-2 2 -2 2])
subplot(1,2,2)
% figure(2)
plot (x ,'.') ;
grid , title ('接收信号星座图') ; xlabel ('Real') , ylabel ('Image')
figure(3),
% scatterplot(sb);
% plot (real(sb),imag(sb) ,'.',c(:,1),c(:,2),'rs') ;
plot (real(sb),imag(sb) ,'.') ;
grid , title ( '均衡后的接收信号图1c') , xlabel ( 'Re2al') , ylabel ('Image')
% figure(4)
% plot (abs(e) ) ;
% grid , title ('误差曲线图1d') , xlabel ('n') , ylabel ('Er2ror e (n) ')

⌨️ 快捷键说明

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