16-QAM over AWGN Channel
Hello,
I want to simulate 16-QAM over AWGN Channel. The Emprical and Theoretical result are different.
Maybe I made a mistake in SNR and Eb/No.
How I can solve this problem?
clear all; close all; clc
% Variables
c = [-3-3i -3-1i -3+3i -3+1i -1-3i -1-1i -1+3i -1+1i 3-3i 3-1i 3+3i 3+1i 1-3i 1-1i 1+3i 1+1i];
M = length(c); % Size of modulation constellation
k = log2(M); % Number of bits per symbol
numBits = 10000; % Each trial uses 10000 bits.
SNR = 0:1:20; % Range of SNR values, in dB.
numSNR = length(SNR);
berVec = zeros(3, numSNR); % Preallocate a vector for BER results
%————————————————————————–
mod = comm.GeneralQAMModulator(c);
demod = comm.GeneralQAMDemodulator(c);
tx = randi([0 M-1],numBits,1);
modSignal = mod(tx);
% Add white Gaussian noise to the modulated signal by passing the signal through an AWGN channel.
awgnChan = comm.AWGNChannel(‘NoiseMethod’, ‘Signal to noise ratio (SNR)’);
errorCalc = comm.ErrorRate;
for n = 1:numSNR
reset(errorCalc)
awgnChan.SNR = SNR(n);
noisySignal = awgnChan(modSignal); % Add Gaussian noise
rx = demod(noisySignal);
berVec(:,n) = errorCalc(tx,rx); % Compute error rate.
end
BER = berVec(1,:);
[BERtheory, SERtheory] = berawgn(SNR,’qam’,M);
semilogy(SNR,BERtheory,’b-‘,SNR,BER,’r*’);
legend(‘Theoretical BER’,’Empirical BER’);
xlabel(‘SNR (dB)’); ylabel(‘BER’);
title(’16-QAM over AWGN Channel’);
Code ResultHello,
I want to simulate 16-QAM over AWGN Channel. The Emprical and Theoretical result are different.
Maybe I made a mistake in SNR and Eb/No.
How I can solve this problem?
clear all; close all; clc
% Variables
c = [-3-3i -3-1i -3+3i -3+1i -1-3i -1-1i -1+3i -1+1i 3-3i 3-1i 3+3i 3+1i 1-3i 1-1i 1+3i 1+1i];
M = length(c); % Size of modulation constellation
k = log2(M); % Number of bits per symbol
numBits = 10000; % Each trial uses 10000 bits.
SNR = 0:1:20; % Range of SNR values, in dB.
numSNR = length(SNR);
berVec = zeros(3, numSNR); % Preallocate a vector for BER results
%————————————————————————–
mod = comm.GeneralQAMModulator(c);
demod = comm.GeneralQAMDemodulator(c);
tx = randi([0 M-1],numBits,1);
modSignal = mod(tx);
% Add white Gaussian noise to the modulated signal by passing the signal through an AWGN channel.
awgnChan = comm.AWGNChannel(‘NoiseMethod’, ‘Signal to noise ratio (SNR)’);
errorCalc = comm.ErrorRate;
for n = 1:numSNR
reset(errorCalc)
awgnChan.SNR = SNR(n);
noisySignal = awgnChan(modSignal); % Add Gaussian noise
rx = demod(noisySignal);
berVec(:,n) = errorCalc(tx,rx); % Compute error rate.
end
BER = berVec(1,:);
[BERtheory, SERtheory] = berawgn(SNR,’qam’,M);
semilogy(SNR,BERtheory,’b-‘,SNR,BER,’r*’);
legend(‘Theoretical BER’,’Empirical BER’);
xlabel(‘SNR (dB)’); ylabel(‘BER’);
title(’16-QAM over AWGN Channel’);
Code Result Hello,
I want to simulate 16-QAM over AWGN Channel. The Emprical and Theoretical result are different.
Maybe I made a mistake in SNR and Eb/No.
How I can solve this problem?
clear all; close all; clc
% Variables
c = [-3-3i -3-1i -3+3i -3+1i -1-3i -1-1i -1+3i -1+1i 3-3i 3-1i 3+3i 3+1i 1-3i 1-1i 1+3i 1+1i];
M = length(c); % Size of modulation constellation
k = log2(M); % Number of bits per symbol
numBits = 10000; % Each trial uses 10000 bits.
SNR = 0:1:20; % Range of SNR values, in dB.
numSNR = length(SNR);
berVec = zeros(3, numSNR); % Preallocate a vector for BER results
%————————————————————————–
mod = comm.GeneralQAMModulator(c);
demod = comm.GeneralQAMDemodulator(c);
tx = randi([0 M-1],numBits,1);
modSignal = mod(tx);
% Add white Gaussian noise to the modulated signal by passing the signal through an AWGN channel.
awgnChan = comm.AWGNChannel(‘NoiseMethod’, ‘Signal to noise ratio (SNR)’);
errorCalc = comm.ErrorRate;
for n = 1:numSNR
reset(errorCalc)
awgnChan.SNR = SNR(n);
noisySignal = awgnChan(modSignal); % Add Gaussian noise
rx = demod(noisySignal);
berVec(:,n) = errorCalc(tx,rx); % Compute error rate.
end
BER = berVec(1,:);
[BERtheory, SERtheory] = berawgn(SNR,’qam’,M);
semilogy(SNR,BERtheory,’b-‘,SNR,BER,’r*’);
legend(‘Theoretical BER’,’Empirical BER’);
xlabel(‘SNR (dB)’); ylabel(‘BER’);
title(’16-QAM over AWGN Channel’);
Code Result ber, modulation, qam, lte MATLAB Answers — New Questions