各位好
小弟新手剛接觸MATLAB
最近需要跑BPSK通過rayleigh和AWGN的模擬
從MathWorks的Fading Channel頁面有一段範例
裡面的rayleigh fading是用comm.RayleighChannel直接產生的
接著通過AWGN channel通道後做hard decision
範例裡面是用DBPSK做modulation
接著我把調變方式換成BPSK之後
BER直接飆升到0.5
請問為甚麼會有這種情形QQ
我的寫法如下
==================================
tx_signal = randi([0 1],10000,1);
SNR = 0:1:35;%dB
errorRate = comm.ErrorRate;
Rayleigh = comm.RayleighChannel;
%BPSK modulation
for i = 1 : length(tx_signal)
if tx_signal(i) == 0
BPSK(i,:) = -1;
else
BPSK(i,:) = 1;
end
end
%Rayleigh fading channel
fad_BPSK = Rayleigh(BPSK);
for snrdb = 1 : length(SNR)
AF_BPSK = awgn(fad_BPSK,snrdb);
%demodulate BPSK
for i = 1 : length(tx_signal)
if AF_BPSK(i,1) > 0
rx_BPSK(i,1) = 1;
else
rx_BPSK(i,1) = 0;
end
end
reset(errorRate)
BPSK_error{snrdb} = errorRate(tx_signal,rx_BPSK);
BPSK_BER(snrdb) = BPSK_error{snrdb}(1);
end
semilogy(SNR,BPSK_BER)
grid on
=================================
感謝各位