
% File: E5_118.M  and FIG5_38.m

clear;

N=32
T=1;
PSD=0;
f = 0:0.1:30;

for n=0:N-1
   x=Sa(pi*f*T-pi*(n-(N-1)/2));
  PSD=PSD+x.*x;
end

PdB = 10*log10(PSD);

plot(f,PdB);
axis([min(f) max(f) -40 5]);
xlabel('f');
ylabel('PSD of Complex Envelope, Pg(f), in dB');
title( ['PSD for Complex Envelope of OFDM for N=',num2str(N),'  ']);
