📄 mmsefinal.m
字号:
%-------------------------------------------------------%%Name: simulate channel with MMSE %Function: analyze the data stream to useful data%Author: Group %Create date: 2008-10-10%-------------------------------------------------------%clear allclose all;train_time = 3;buf_c = zeros(5,1);for(ii = 1:train_time) train_bits = sign(rand(1,10)-0.5); r_train = linch(train_bits); r_corr = xcorr(r_train); r_coeff = r_corr(length(r_train):(length(r_train)+4)); R = toeplitz(r_coeff); r_y = xcorr(train_bits,r_train); P=r_y(((length(r_y)+1)/2-4):((length(r_y)+1)/2)); Cmmse = inv(R)*P'; buf_c = buf_c + Cmmse;endCmmse = buf_c/train_time;test_time = 100;N = 100000;BER_buf = [];for(ii = 1:test_time) bn = sign(rand(1,N)-0.5);%creat a new data sequence rn = linch(bn); re = conv(rn,Cmmse);% filter the signal from the channel bn_est = sign(re(5:N+4));%take away the wrong part caused by the delay of the filters and make decision errors = sum(abs(bn_est - bn)/2); BER = errors/N; BER_buf = [BER_buf BER];endtarget = zeros(1,length(BER_buf))+ 0.005;figure(1)n = 1:length(BER_buf);plot(n,target,'r-.');hold on;plot(BER_buf,'x');axis([1 test_time 0 0.01]);legend('Target BER','Real BER');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -