qpsk in rayleigh channel simulation changes everytime you simulate

1 回表示 (過去 30 日間)
sharvari samant
sharvari samant 2013 年 9 月 30 日
コメント済み: sharvari samant 2013 年 9 月 30 日
plot of ber vs enno for qpsk in rayleigh channel using the object rayleighchan changes for each simulation.why is this happening?my code is as follows: % Create Rayleigh fading channel object. chan = rayleighchan(1/10000,0);
% Generate data and apply fading channel. M = 4; % QPSK modulation order hMod = modem.pskmod('M', M,'InputType','bit'); % Create a QPSK modulator hDemod =modem.pskdemod('M',M,'OutputType','bit','DecisionType','hard decision'); % Create a QPSK demodulator % using the modulator tx = randsrc(50000,1,[0 1]); % Generate a random bit stream dpskSig = modulate(hMod, tx); % QPSK modulate the signal fadedSig = filter(chan,dpskSig); % Apply the channel effects
% Compute error rate for different values of SNR. SNR = 0:2:40; % 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 % Compute error rate. [nErrors, BER(n)] = biterr(tx,rx); end
% Plot BER results. semilogy(SNR,BER,'r*'); legend('Empirical BER'); xlabel('SNR (dB)'); ylabel('BER'); title('Binary QPSK over Rayleigh Fading Channel');
  3 件のコメント
sharvari samant
sharvari samant 2013 年 9 月 30 日
編集済み: sharvari samant 2013 年 9 月 30 日
plot of ber vs enno for qpsk in rayleigh channel using the object rayleighchan changes for each simulation.why is this happening?my code is as follows:
% Create Rayleigh fading channel object.
chan = rayleighchan(1/10000,0);
% Generate data and apply fading channel.
M = 4; % QPSK modulation order
hMod = modem.pskmod('M', M,'InputType','bit'); % Create a QPSK modulator
hDemod =modem.pskdemod('M',M,'OutputType','bit','DecisionType','hard decision'); % Create a QPSK demodulator
tx = randsrc(50000,1,[0 1]); % Generate a random bit stream
dpskSig = modulate(hMod, tx); % QPSK modulate the signal
fadedSig = filter(chan,dpskSig); % Apply the channel effects
% Compute error rate for different values of SNR.
SNR = 0:2:40; % 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
% Compute error rate.
[nErrors, BER(n)] = biterr(tx,rx);
end
% Compute theoretical performance results, for comparison.
% Plot BER results.
semilogy(SNR,BER,'r*');
legend('Empirical BER');
xlabel('SNR (dB)'); ylabel('BER');
title('Binary QPSK over Rayleigh Fading Channel');
sharvari samant
sharvari samant 2013 年 9 月 30 日
this code is the modified version of the code given in matlab help for dpsk

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangePropagation and Channel Models についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by