matlab误码率计算公式,关于误码率的问题急!!!!!

matlab误码率计算公式,关于误码率的问题急该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
求助各位⼤佬
要求是2ask调制 通过滚降系数为0,0.5,1的升余弦滚降滤波器,信道加⼊1-15db的⾼斯⽩噪声,
相⼲解调,匹配滤波后计算出误码率与信噪⽐的关系图与理论值拟合
现在问题是计算出的误码率过⾼⽆法拟合,请教各位⼤佬应该怎么修改。明天就要交论⽂了 曲线⼀直拟合不上大小头
好急
%%---baseband signal parameters---%%
D_R = 32e3; %Date Rate = 32Kbps
P_D = 1/D_R; %Pulse duration
%Signal generation
苯溴马隆
bits = 16;
rand_data = randi([0 1], 1,16);
input = repmat(rand_data',1,2000)';
input = input(:)';
t = linspace(0,bits,numel(input));
figure(1);
subplot(3,1,1);
plot(t,input);
title('Input bit stream');
xlabel('samples');
ylabel('amplitude');
grid on
%%carrier generation
fc = 10;
carrier = cos(2 * pi * fc * t);
subplot(3,1,2);
plot(t,carrier);
title('carrier');
xlabel('samples');
ylabel('amplitude');
grid;
%%raised cosine rolloff filter
%%rolloff = 0
rolloff = 0;
span = 20;
sps = 50;
rcosfilter_1 = rcosdesign(rolloff, span, sps,'sqrt'); shapedsignal_1 = conv(input,rcosfilter_1,'same'); figure(2)
subplot(3,1,1);
plot(t,shapedsignal_1);
title('shaped signal rolloff = 0');
xlabel('samples');介词宾语
ylabel('amplitude');
rolloff = 0.5;
span = 20;
sps = 50;
rcosfilter_2 = rcosdesign(rolloff, span, sps,'sqrt'); shapedsignal_2 = conv(input,rcosfilter_2,'same'); subplot(3,1,2);
韦伯分布
plot(t,shapedsignal_2);
title('shaped signal rolloff = 0.5');
xlabel('samples');
ylabel('amplitude');
rolloff = 1;
span = 20;
sps = 50;
rcosfilter_3 = rcosdesign(rolloff, span, sps,'sqrt'); shapedsignal_3 = conv(input,rcosfilter_3,'same'); subplot(3,1,3);
plot(t,shapedsignal_3);
title('shaped signal rolloff = 1');
xlabel('samples');
ylabel('amplitude');
%%ASK modulation
modulationsignal_1 = carrier .* shapedsignal_1; figure(3);
subplot(3,1,1);
plot(t,modulationsignal_1);
title('modulation signal rolloff = 0');
xlabel('samples');
ylabel('amplitude');
grid on;
modulationsignal_2 = carrier .* shapedsignal_2; subplot(3,1,2);
plot(t,modulationsignal_2);
title('modulation signal rolloff = 0.5');
xlabel('samples');
ylabel('amplitude');
grid on;
modulationsignal_3 = carrier .* shapedsignal_3; subplot(3,1,3);
plot(t,modulationsignal_3);
title('modulation signal rolloff = 1');
xlabel('samples');
ylabel('amplitude');
grid on;
LPF = fdesign.lowpass('Fp,Fst,Ap,Ast',1,20,1,60,100); lowpass = design(LPF,'equiripple');
%[ A B C D] = butter(10,[1 5]/50);
[b a] = butter(5,0.95,'low');
%d=designfilt('bandpassfir','FilterOrder',50, ...
%'CutoffFrequency1',1,'CutoffFrequency2',5, ...
首都休闲大学
%'SampleRate',100);
%%add noise
h = 1;j = 1;
for SNR = 1:1:15
snrlin = 10.^(SNR./10);
RxSig_1=awgn(modulationsignal_3,SNR,'measured',1); %%demodulation
x = RxSig_1.* carrier;
%e = filter(d,x);
y = filter(lowpass,x);
%e = envelope(y);
z = conv(y,rcosfilter_3,'same');
%e = envelope(z);
figure(4);
subplot(4,4,SNR);
plot(t,RxSig_1,'g','LineWidth',2);
hold on;
plot(t,modulationsignal_3,'b');
title(['SNR:',num2str(SNR),'dB']); xlabel('Samples');
ylabel('Amplitude');
%%comparator
L = length(y);
for i = 1:1:L
directx 3dif z(i)> 2
output(i) = 1;
else
output(i) = 0;
end
end
figure(5);
xlabel('Samples');
ylabel('Amplitude');
subplot(5,3,SNR);
plot(t,output);
title(['SNR:',num2str(SNR),'dB'])
error = length(find(output ~= input)); cber(h) = error/32000;
h = h+1;
tber(j) = qfunc(sqrt(snrlin));
snrdb(j) = SNR;
j = j+1;
end
figure(4);
legend('Signal with noise','Signal after filteration');
figure(5);
legend('received bits with different singal to noise radio'); figure('Name','Comparison B/W Theoretical&Calculated BER'); semilogy(snrdb,cber,'-bo',snrdb,tber,'-mh');
hold on;
grid on;
legend('BER calculated','BER theoretical')
xlabel('SNR in dB');
ylabel('Bit error rate');

本文发布于:2024-09-22 14:22:20,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/294550.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:误码率   拟合   调制
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议