日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

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

發(fā)布時間:2024/10/12 103 豆豆
生活随笔 收集整理的這篇文章主要介紹了 matlab 计算误码率,关于误码率的问题 急!!!!! 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

該樓層疑似違規(guī)已被系統(tǒng)折疊?隱藏此樓查看此樓

求助各位大佬

要求是2ask調(diào)制 通過滾降系數(shù)為0,0.5,1的升余弦滾降濾波器,信道加入1-15db的高斯白噪聲,

相干解調(diào),匹配濾波后計算出誤碼率與信噪比的關(guān)系圖與理論值擬合。

現(xiàn)在問題是計算出的誤碼率過高無法擬合,請教各位大佬應(yīng)該怎么修改。明天就要交論文了 曲線一直擬合不上

好急

%%---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

if 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');

總結(jié)

以上是生活随笔為你收集整理的matlab 计算误码率,关于误码率的问题 急!!!!!的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。