For the normalization, we divide by sqrt(Oversamp), both at the transmitter and receiver.

And also after oversampling bit energy equals Eb=Oversamp*mean((abs(Sig1)).^2)/k;

The complete code is given below:

%% Transmitter

x=transpose(round(rand(1,N)));

h1=modem.qammod(M);

h1.inputtype=’bit’;

h1.symbolorder=’gray’;

y=modulate(h1,x);

y1 = transpose(y);

Sig = ones(Oversamp,1)*y1;

Sig1 = (1/sqrt(Oversamp))*(Sig(:));

%% Channel

EbNo=10.^(EbNodB(ii)/10);

% Eb=mean((abs(Sig1)).^2)/k;

Eb=Oversamp*mean((abs(Sig1)).^2)/k;

sigma=sqrt(Eb/(2*EbNo));

w=sigma*(randn(Oversamp*N/k,1)+1i*randn(Oversamp*N/k,1));

rx= Sig1 + w;

%% Receiver

rr = transpose(rx);

Rx_sig = reshape(rr,Oversamp,N/k);

Rx_sig1 = (1/sqrt(Oversamp))*ones(1,Oversamp)*Rx_sig;

r = transpose(Rx_sig1);

h2=modem.qamdemod(M);

h2.outputtype=’bit’;

h2.symbolorder=’gray’;

h2.decisiontype=’hard decision’;

z=demodulate(h2,r);

count=(N-sum(x==z))/N ;

But still, it doesn’t work.

]]>Eb=mean((abs(Sig1)).^2)/k;

It should be:

Eb=Oversamp*mean((abs(Sig1)).^2)/k;

]]>http://www.raymaps.com/index.php/m-qam-bit-error-rate-in-rayleigh-fading/

But when I using the oversampling factor, I am not able to normalize it properly. Can you please look at the below code and suggest any recommended changes. Thank you.

clc

clear all

close all

N = 10000; % Number of bits

Oversamp =8; % oversamling factor

itr=5;

M=16;

k=log2(M);

EbNodB = 0:2:10;

for ii = 1:length(EbNodB)

nErr =[];

for kk = 1:itr

%% Transmitter

x=transpose(round(rand(1,N)));

h1=modem.qammod(M);

h1.inputtype=’bit’;

h1.symbolorder=’gray’;

y=modulate(h1,x);

y1 = transpose(y);

Sig = ones(Oversamp,1)*y1;

Sig1 = (1/sqrt(Oversamp))*(Sig(:));

%% Channel

EbNo=10.^(EbNodB(ii)/10);

Eb=mean((abs(Sig1)).^2)/k;

sigma=sqrt(Eb/(2*EbNo));

w=sigma*(randn(Oversamp*N/k,1)+1i*randn(Oversamp*N/k,1));

rx= Sig1 + w;

%% Receiver

rr = transpose(rx);

Rx_sig = reshape(rr,Oversamp,N/k);

Rx_sig1 = ones(1,Oversamp)*Rx_sig;

r = transpose(Rx_sig1);

h2=modem.qamdemod(M);

h2.outputtype=’bit’;

h2.symbolorder=’gray’;

h2.decisiontype=’hard decision’;

z=demodulate(h2,r);

count=(N-sum(x==z))/N ;

nErr = [nErr count];

end

Err(ii) = sum(nErr)/itr;

end

simBer = Err; % simulated ber

EbNo=10.^(EbNodB/10);

x=sqrt(3*k*EbNo/(M-1));

theoryBerAWGN=(4/k)*(1-1/sqrt(M))*(1/2)*erfc(x/sqrt(2));

semilogy(EbNodB,theoryBerAWGN,’bd-‘,’LineWidth’,2);

hold on

semilogy(EbNodB,simBer,’rx-‘,’LineWidth’,2);

hold on

legend(‘AWGN-Theory’, ‘Simulation’);

xlabel(‘Eb/No, dB’);

ylabel(‘Bit Error Rate’)

There are two ways you can approach this problem (each requiring a bit of work from you).

– You can modify the code for 64-QAM by just changing the parameter M from 64 to 16 and run the BER simulation.

http://www.raymaps.com/index.php/ber-64-qam-awgn/

– If you want to go back to basics you can use the 4-PAM code for this. 16-QAM is nothing but two orthogonal 4-PAM constellations.

http://www.raymaps.com/index.php/pulse-amplitude-modulation-symbol-error-rate-in-awgn/

I hope this was helpful!

]]>Can you please provide the bit error rate of 16-QAM modulation through MATLAB simulations using oversampling.

Thank you in advance

]]>My doubt is regarding a solar-powered cellular base station. Could you tell me what are the equipment which form a base station and also could you let me know how I can calculate the power consumption of each of these equipment so that I can get a rating for my solar array?

]]>This is quite simple. You just need to convolve the symbol stream with the Impulse Response of the Gaussian pulse shaping filter before passing it through the fading channel. Remember to use “same” as output length of the pulse shaping filter. The MATLAB function is named “conv”. Please let me know if something is still not clear.

YA ]]>

Thank you very much. ]]>

Thanks for reaching out. Please look at the four references, at the start of the post, to understand the basics. If you still do not understand something please let us know.

YA

]]>