Could anyone help me how to rectify this problem as I facing a difficulties in generating a correct out of BEr vs SNR for ACO-OFDM program as the graph plotted in linear line. The ACO-OFDM program as follows:
N = 20; % Number of rows in the array
m = 10; % Number of columns in the array
M = 64; %constellation size --> M=4/8/16/32/64/128/256
Ncp=5;
%Generation of random bits matrix of size m x N
Data_new = randi([0 1],m,N);
Data_ACO = Data_new;
%ACO-OFDM Principle (Only apply on odd sc
for x=1:m %m=row
for y=1:N %N=column
if mod(y,2)==0 %perform modulas operator to find even sc
Data_ACO(x,y)=0;%set even sc to 0
end
end
end
disp(Data_ACO);
%Performing data modulation
DataQAM_ACO = qammod(Data_ACO, M);
disp(DataQAM_ACO);
DataMat_ACO = DataQAM_ACO.';
%Apply HS on N-Sc
DataMat_ACO(1,:)=0;
DataMat_ACO(11,:)=0;
DataMat_ACO(12:20 , :)=flipud(conj (DataMat_ACO (2:10,:)));
%IFFT computational
ACO_IFFT = ifft(DataMat_ACO);
ACO_IFFT_P2S = ACO_IFFT2.';
%Zero Clipping
ZeroClip_ACO=ACO_IFFT_P2S;
for row=1:m
for col=1:N
if(ACO_IFFT_P2S(row,col)<0)
ZeroClip_ACO(row,col)=0;
end
end
end
P_Part_ACO = ZeroClip_ACO(:,end - Ncp + 1:end);
CP_ACO = [CP_Part_ACO ZeroClip_ACO];
%--------------------------------------------------------------------------------------
% Optical Channel
%-------------------------------------------------------------------------------------
count=0;
snr_vector=0:1:18;
for snr=snr_vector
SNR_ACOOFDM = snr + 10 * log10 (log2 (M));
count=count + 1;
ACO_OFDM_Channel = awgn(CP_ACO, SNR_ACOOFDM, 'measured'); %add AWGN
ACO_CP_removal = ACO_OFDM_Channel(:,Ncp+1:N+Ncp);
ACO_Rx_S2P = ACO_CP_removal.';
%FFT computational (TD - FD)
ACO_Rx_FFT = fft(ACO_Rx_S2P);
ACO_Rx_P2S = ACO_Rx_FFT.';
%QAM Demodulation
ACO_Demod = qamdemod(ACO_Rx_P2S, M);
[~,bit_errorACO(count)] = biterr (Data_ACO(:,2:10), ACO_Demod(:,2:10));
end
Thanks in advanced.