实例介绍
【实例截图】


【核心代码】
% Training based channel equalization 基于训练的信道均衡
% adpative MMSE equalizer via LMS algorithm 基于LMS算法的自适应MMSE均衡器
%
% 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
%
T=3000; % total number of data 数据量为3000
M=2000; % total number of training symbols 总的训练符号的数量
dB=25; % 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) 复杂信道 产生1*Lh 1的矩阵
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)/vn); % Check SNR of the received samples
x=x vn; % received signal
%%%%%%%%%%%%% adaptive MMSE equalizer estimation 自适应MMSE均衡器估计
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,M-10); % used to save instant error 1990
f=zeros(N 1,1); % initial condition
mu=0.001; % parameter to adjust convergence and steady error
for i=1:M-10
e(i)=s(i 10 N-P)-f'*X(:,i 10); % instant error 误差函数 N=20
f=f mu*conj(e(i))*X(:,i 10); % update equalizer estimation conj:求e(i)的复共轭
i_e=[i/10000 abs(e(i))]; % output information 输出信息
end
sb=f'*X; % estimate symbols (perform equalization)
% calculate SER
sb1=sb/norm(f); % scale the output
sb1=sign(real(sb1)) sqrt(-1)*sign(imag(sb1)); % perform symbol detection
start=7; % 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
figure(2)
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
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论