Plot of OFDM Subcarriers

MATLAB PROGRAM

clear all; 

close all;

%--------Simulation parameters----------------

nSym=10^4; %Number of OFDM Symbols to transmit

EbN0dB = -10:2:8; % bit to noise ratio 

 

N=64; %FFT size or total number of subcarriers (used + unused) 64

 

%subcarriers plot

Indx = 0.01;    % Over sampling index

vi = 1;         % counter index

for k = 0:Indx:N-1

  hi = 1; % counter index

  for l = 0:N-1

  % this function calculates effect of CFO. Bias 1 is deliberately

  % added in order to evaluate function at zero CFO.

  f(vi,hi) = 1+ (sin(pi*(l+e-k))*exp(1i*pi*(N-1)*(l+e-k)/N))/(N*sin(pi*(l+e-k)/N));

  hi = hi+1;

  end

  vi = vi+1;

end

figure;

plot([0:Indx:N-1],abs(f(:,1)),'r');

hold on; grid on;

for n = 1:N-1

    plot([0:Indx:N-1],abs(f(:,n+1)));

end

hold off;

xlim([0 63])

xlabel('Subcarrier index');ylabel('Amplitude');title('Plot of OFDM Subcarriers');


SIMULATED OUTPUT

DOWNLOAD LINK