# Plot the Power Spectral Density for a signal in Matlab

I have an OFDM signal x, generated using QAM modulation, I first use the command in matlab y1 = ifft(x); to generate the time-domain signal. Then when I plot the PSD, I get that figure in the right of below picture. On the other hand, when I generate the time-domain signal using y2 = F’*x; where F = dftmtx(N)/sqrt(N); and N is the length of subcarriers, I get the PSD plot as shown on the left of picture!
However (y1 – y2) is almost 0, why do we get that difference ? Which one is correct? NP: What is strange for me is the difference between the two ways however the signal is the same.

• @DanBoschen I am asking why do I get that difference. However i almost use the same way to plot the PSD .. The way of ploting the PSD is OK and I agree with the explanation you shared, but I couldn't understand the difference shown above. Commented Apr 14, 2022 at 1:56
• @Sajjad It looks like on the right-hand side you're plotting only half the spectrum.
– MBaz
Commented Apr 14, 2022 at 2:00
• @DanBoschen I only use ifft(x), I don't use what you mentioned y1 = ifftshift (ifft(x)). Commented Apr 14, 2022 at 2:08
• @MBaz but also y axis is different, the right one is between 20 - 40 while the other one between 0 - 60. Commented Apr 14, 2022 at 2:09
• @DanBoschen Pxx=periodogram(x); Hpsd=dspdata.psd(Pxx,'Fs',1.0000e+09); plot(Hpsd); I use this code to plot the PSD. 2- the signal x is real because I am using [0 x 0 flipud(conj(x))]; iso the output of ifft becomes real. Commented Apr 14, 2022 at 2:25

The reason is the OP is using the MATLAB/Octave periodogram(X) function to plot the power spectral density and this function will return different results depending on if X is real or complex. When X is real-values, a one-sided spectrum will be estimated, but if X is complex-valued, or the optional 'RANGE" parameter is used to specify "twosided", then a full spectrum will be estimated.