File Exchange

## M-QAM modulation and demodulation

version 1.0.0.0 (398 KB) by
this is the QAM modulation and demodulation tech. with speech example

Updated 27 Apr 2007

you can rum these files by my_speech.m file, taking an value like my_speech(64, 'qam') in the command window of MATLAB.

### Cite As

Santosh Shah (2021). M-QAM modulation and demodulation (https://www.mathworks.com/matlabcentral/fileexchange/14809-m-qam-modulation-and-demodulation), MATLAB Central File Exchange. Retrieved .

Dang Nguyen

TOEi SEKSAN

function z = my_qamdemod(y, m)

%this is the function for demodulation of QAM, y is the M-QAM Modulated
%signam, m is playing the same role. z is the demodulated output. input y
%is a row or coulmn vector and, z should be the row vector.

%santosh shah, The LNM IIT Jaipur (India)(santosh.jnt@gmail.com) 23/04/07

% again i need to check the value of M, so by the same process.
if log2(sqrt(m))~= floor(log2(sqrt(m)))
error('Please check the value of m that you have provided for type M-QAM.');
end

%taking the reverse process
k = sqrt(m);
r = 2*(0:k-1) - k + 1;
[xi, yi] = meshgrid(r);
c = xi + j*flipud(yi);
c = c(:);

%now comparing the data from c's vector after rounding the input data.
% Allocate space for output
z = zeros(size(y));

% Slicer: Find closest constellation symbol, symbol-by-symbol.
for k = 1:length(y)
[nil ind] = min(abs(y(k) - c));
z(k) = ind - 1;
end

Eugene Rychkov

Please, chack code in conditions of multipath channel. When I added it, qnd tried just on saw signal (QPSK = ' statements = 1 2 3 0), i didn't receive 3 in any conditions. Otherwise, when I tried it with waw file, there so much 3 appeared, but in initial massage there are so little 3 number. What is that?

Le Quy Duong

shervin shokri

Dear Santosh Shah
just like some friends i followed your description to run the code but it doesn't work.
how i can fix it?
all the best.
(shervin)

%%********************
Invalid Wave File. Reason: Cannot open file.

Error in my_speech (line 17)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

alejandro serrano

is good

William

Rashed

Sourav Mondal

this code is not working on command window.. even in R2011b version.
In addition, the quam modulator doesn't work for M=2,8,32 i.e., for odd powers of 2..!! Really needs some correction!

Otto Garcia

Hi friend!
I tried with my own file sound but it doesn't work
What do I do?
Thanks

chirawat

Hi, Santosh Shah
I use MATLAB 2009, I have tried to run your code but it doesn't work. In command window show this message.

>> my_speech(64,'qam')
??? Error using ==> wavread at 67
Cannot open file.

Error in ==> my_speech at 17

How can I fix it?
Best regard,
Chirawat

lijian zhang

very good

nikos mpairak

thanks a lot

alaa

zhao long

very good ,gold bless you

goooood
Thank

Luisa Fernanda Echevery

Me parece excelente el archivo

Ruben Bocos

WU Chia -da

snell marc

Rami Neseem

Nguyen Duc Phu

I am working for Vietnam television
I need QAM Modulation software

My speech_sim_result.bmp Tenqchen

Good fitting

great

simo azzed

##### MATLAB Release Compatibility
Created with R2007a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux