There are 3 messages in this thread.
You are currently looking at messages 1 to .
Is this discussion worth a thumbs up?
Hi all,
Please I humbly need your help concerning the MATLAB code I am modifying to
run the performance of PSK signal over Rayleigh fading channel. The code is
not working but just giving a straight line. Any help to sort this my
problem will be greatly appreciated.
% Create Rayleigh fading channel object.
chan = rayleighchan(1/10000,100);
% Generate data and apply fading channel.
M = 2; % PSK modulation order
hMod = modem.pskmod('M', M); % Create a PSK modulator
hDemod = modem.pskdemod(hMod); % Create a PSK demodulator
% using the modulator
sigLen = 50000;
tx = randi([0 M-1],sigLen,1); % Generate a random bit stream
pskSig = modulate(hMod, tx); % PSK modulate the signal
fadedSig = filter(chan,pskSig); % Apply the channel effects
SNR = 0:2:20; % Range of SNR values, in dB
numSNR = length(SNR);
BER = zeros(1, numSNR);
for n = 1:numSNR
rxSig = awgn(fadedSig,SNR(n)); % Add Gaussian noise
rx = demodulate(hDemod, rxSig); % Demodulate
% reset(hDemod);
[nErrors, BER(n)] = biterr(tx,rx); % Compute error rate
end
% Compute theoretical performance results, for comparison
BERtheory = berfading(SNR,'psk',M,1);
BERawgn = berawgn(SNR, 'psk', M, 'nondiff') ;
% Plot BER results
figure
semilogy(SNR, BERawgn,'c.:',SNR, BERtheory,'b-',SNR,BER,'r*');
legend('AWGN fading', 'Theoretical BER','Empirical BER');
xlabel('SNR (dB)'); ylabel('BER');
axis([0 20 10e-6 1])
title('Binary PSK over Rayleigh Fading Channel');
Thank you.
______________________________It looks like your sampling rate on the rayleighchan is 1/10000, but the sampling rate of pskSig is 1.______________________________