No BSD License  

Highlights from
n-PSK modulation and demodulation

image thumbnail
from n-PSK modulation and demodulation by Santosh Shah
keep all files in a folder and run any of the test my speech file, with any value of n, in power of

my_pskdemod(y , m)
function z = my_pskdemod(y , m)

%this function demodulate the psk modulated signal, here y is the modulated
%signal with m-psk, and z is the output. here y can be row or coulmn
%vector, m is the integer power of 2 and , z should be a row vector.

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

%i have to check if M is equal to the power of 2 and x is in between 0 to
%M-1 so..
if log2(m)~= floor(log2(m))
    error('Please check the value of m that you have provided for type M-QAM.');
end

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

%now generating the cancellation points
t = (0:m-1);
c  = exp(2*pi*t*(m-1)/m*(-i)); % taking the concept of cosx + i*sinx

% 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





Contact us at files@mathworks.com