Can any one have some information about matlab code of QAM

Status
Not open for further replies.
Re: Can any one have some information about matlab code of Q

matlab provides the inbuilt function for QAM. Here is the code...
just try over this

Create a random digital message
M = 16; % Alphabet size
x = randint(5000,1,M); % Message signal

% Use 16-QAM modulation.
y = qammod(x,M);

% Transmit signal through an AWGN channel.
ynoisy = awgn(y,15,'measured');

% Create scatter plot from noisy data.
scatterplot(ynoisy);

% Demodulate to recover the message.
z = qamdemod(ynoisy,M);

% Check symbol error rate.
[num,rt]= symerr(x,z)

Added after 11 minutes:

Also go through this

clear all;
ampqam=[-3 -1 1 3] %Number of amplitudes(4 for 16QAM)
A = repmat(ampqam,4,1)
B = flipud(A')
constellation_qam = A+j*B %Matrix that contains all the constellation points(complex)
constellation_qam1 = constellation_qam) %Change to column vector
qam = constellation_qam1(floor((16)*rand(1,10000))+1);%Generate 16QAM symbol sequence(complex)
figure(1)
plot(qam,'o'); %Plot the constellation
axis([-4 4 -4 4]); grid on;
xlabel('Q Amplitude');ylabel('I Amplitude');
title('16 QAM Constellation')
phaseangle_rad=atan2(imag(constellation_qam1),real(constellation_qam1))
phaseangle_deg=57.29577*phaseangle_rad
sort(phaseangle_deg)% Count number of DIFFERENT phase angles in command window(12 for 16QAM)
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…