matlab 2ask相干解调误码率太低,关于误码率的问题 急!!!!!

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

求助各位大佬

要求是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

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的 MATLAB 代码示例,用于实现 ASK 信号的相干解调和非相干解调误码率曲线仿真: ```matlab % 定义 ASK 信号的基本参数 fs = 1000; % 采样频率 fc = 100; % 载波频率 T = 1/fs; % 采样间隔 n = 0:fs; % 时间序列 % 定义信号源和载波信号 msg = sin(2*pi*10*n*T); % 频率为 10 Hz 的信号源 carrier = sin(2*pi*fc*n*T); % 载波信号 % 生成 ASK 信号 ask = msg.*carrier; % 定义接收端的解调器参数 Eb = 1; % 信号能量 N0 = 0.1; % 噪声功率谱密度 SNR_dB = 0:1:10; % 信噪比范围(dB) % 计算相干解调和非相干解调误码率 for i = 1:length(SNR_dB) snr = 10^(SNR_dB(i)/10); % 将信噪比转换为线性单位 % 相干解调 y = ask.*cos(2*pi*fc*n*T); % 相干解调后的信号 y_noise = y + sqrt(Eb/(2*snr))*randn(size(y)); % 加入高斯白噪声 demod = y_noise > 0; % 解调后的信号 error_count_coh(i) = sum(xor(demod, msg)); % 统计误码数 % 非相干解调 y_abs = abs(ask); % 取信号的绝对值 y_abs_noise = y_abs + sqrt(Eb/snr)*randn(size(y_abs)); % 加入高斯白噪声 demod_abs = y_abs_noise > 0.5; % 解调后的信号 demod_noncoh = 2*demod_abs - 1; % 将二进制信号转换为±1的符号 error_count_noncoh(i) = sum(xor(demod_noncoh, msg)); % 统计误码数 end % 计算相干解调和非相干解调误码率 BER_coh = error_count_coh/length(msg); BER_noncoh = error_count_noncoh/length(msg); % 绘制误码率曲线 figure; semilogy(SNR_dB, BER_coh, 'o-', 'LineWidth', 2); hold on; semilogy(SNR_dB, BER_noncoh, 'o-', 'LineWidth', 2); grid on; xlabel('SNR (dB)'); ylabel('BER'); legend('Coherent', 'Non-Coherent'); ``` 上述代码中,我们首先定义了 ASK 信号的基本参数,包括采样频率、载波频率和信号源。然后使用这些参数生成 ASK 信号,并在接收端进行相干解调和非相干解调的操作,最后统计误码数并计算误码率,绘制误码率曲线。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值