cp_len = floor(0.1 * block_size);
data_source= abs(round(randn(1,no_of_data_bits)));
stem (x*(1/Fm),data_source);
xlabel('time(Microsecond)','Fontsize',14);
ylabel('amplitude','Fontsize',14);
title('Transmitted Data','Fontsize',14);
qam_modulated_data = qammod(data_source, M);
nqdata = length(qam_modulated_data);
scatterplot(qam_modulated_data,1,0,'r*');
[udata, uidx] = unique(qam_modulated_data);
text(real(udata(k))-0.4,imag(udata(k))+0.4,num2str(data_source(uidx(k))));
qm = abs(qam_modulated_data);
title('MODULATED TRANSMITTED DATA','Fontsize',14);
y=ifft(qam_modulated_data);
ylabel('amplitude of ifft');
title('without hermitian ifft','Fontsize',14);
udata1(1:(M/2))=qam_modulated_data(1:(M/2));
udata1(((M/2)+1):M)=qam_modulated_data(1:(M/2));
xlabel('frequency(MHZ)','Fontsize',14);
ylabel('amplitude','Fontsize',14);
title('Hermitian symmetry','Fontsize',14);
xlabel('Freq(Mhz)','Fontsize',14);
ylabel('amplitude','Fontsize',14);
title('even frequency suppressed output','Fontsize',14);
xlabel('Freq(Mhz)','Fontsize',14);
ylabel('amplitude of real values of ifft','Fontsize',14);
title('real value of ifft','Fontsize',14);
assert(number_of_subcarriers <= M);
cp_start=block_size-cp_len;
for i=1:number_of_subcarriers,
S2P = reshape(qam_modulated_data, no_of_data_bits/M,M);
ifft_Subcarrier(:,i) = ifft((S2P(:,i)),16);
cyclic_prefix(j,i) = ifft_Subcarrier(j+cp_start,i);
Append_prefix(:,i) = vertcat( cyclic_prefix(:,i), ifft_Subcarrier(:,i));
figure(12), subplot(8,1,1),plot(real(A1),'r'),title('Cyclic prefix added to all the sub-carriers')
subplot(8,1,2),plot(real(A2),'y')
subplot(8,1,3),plot(real(A3),'b')
subplot(8,1,4),plot(real(A4),'g')
subplot(8,1,5),plot(real(A5),'m')
subplot(8,1,6),plot(real(A6),'k')
subplot(8,1,7),plot(real(A7),'c')
subplot(8,1,8),plot(real(A8),'g')