danish shahzad
Newbie level 1
HI
I need to implement QAM Modulation, what i have is the bits from data source and the code for this is below
function [ qam_symbol ] = qam_encoder( coded_bits, m )
x=coded_bits;
k = sqrt(m);
x = [x zeros(1,ceil(length(x)/k)*k-length(x))];
bits = reshape(x,k,length(x)/k).';
levels = bin2dec(num2str(bits));
r = 2*(0:k-1) - k + 1;
[xi, yi] = meshgrid(r);
c = xi + j*flipud(yi);
qam_symbol = c(levels+1);
end
here the function returns qam_symbols next what i need to do is Demodulation i need some help. kindly comment if this code seems illogical
Thanks
I need to implement QAM Modulation, what i have is the bits from data source and the code for this is below
function [ qam_symbol ] = qam_encoder( coded_bits, m )
x=coded_bits;
k = sqrt(m);
x = [x zeros(1,ceil(length(x)/k)*k-length(x))];
bits = reshape(x,k,length(x)/k).';
levels = bin2dec(num2str(bits));
r = 2*(0:k-1) - k + 1;
[xi, yi] = meshgrid(r);
c = xi + j*flipud(yi);
qam_symbol = c(levels+1);
end
here the function returns qam_symbols next what i need to do is Demodulation i need some help. kindly comment if this code seems illogical
Thanks