How to scale PSD/Pwelch highest point to 0dB?

Hi,
I am currently using the pwelch function to simulate the spectrum of an OFDM signal.
Note: I used random numbers, QPSK modulation, zero padding and finally IFFT to obtain my OFDM signal.
fsMHz = 80;
Len = length(ofdm_signal);
[Pxx,f] = pwelch(ofdm_signal,[],[],Len,fsMHz);
plot([-(Len/2):((Len/2)-1)]/1024,10*log10(fftshift(Pxx)));
Resulting in:
As you can see on the PSD axis, the highest point is at around -50dBr.
I also did some calculations and I came up with the following:
Re = real(ofdm_signal); % Real part of the signal.
Im = imag(ofdm_signal); % Imaginary part of the signal.
Power = Re.*Re+Im.*Im; % Calculating Power.
AvgP = sum(Power)/Len; % Calculating Average Power.
AvgP_db = 10*log10(AvgP); % Average Power in dB.
PeakP = max(Power); % Calculating Peak Power.
PeakP_db = 10*log10(PeakP); % Peak Power in dB.
PAPR_db = 10*log10(PeakP/AvgP); % PAPR in dB.
disp(['Average Power1 = ' num2str(AvgP)]);
disp(['Average Power1 (dB) = ' num2str(AvgP_db)]);
disp(['Peak Power = ' num2str(PeakP)]);
disp(['Peak Power (dB) = ' num2str(PeakP_db)]);
disp(['PAPR (dB) = ' num2str(PAPR_db)]);
Which resulted in:
Average Power = 0.00024414
Average Power (dB) = -36.1236
Peak Power = 0.0020307
Peak Power (dB) = -26.9235
PAPR (dB) = 9.2001
What I want to know is whether there is a way to scale that PSD axis so that the highest point is around 0dB, as frequently used in theory. Here are some pictures of what I'm trying to do.
Please help me out here.
Looking forward to your answers.

 Respuesta aceptada

Honglei Chen
Honglei Chen el 30 de Sept. de 2013
Editada: Honglei Chen el 30 de Sept. de 2013
You just need to normalize it, for example
plot([-(Len/2):((Len/2)-1)]/1024,10*log10(fftshift(Pxx/max(Pxx))));
and
AvgP_db = 10*log10(AvgP/max(AvgP))

2 comentarios

Jean-luc
Jean-luc el 30 de Sept. de 2013
Thank you so much Honglei Chen.
What you're trying to tell me is that I need to normalize my average power too, right?
Honglei Chen
Honglei Chen el 30 de Sept. de 2013
No, I'm just saying if you want to get 0dB, you can just normalize it. If you want the true average power, you should not normalize it. Sorry for the confusion.

Iniciar sesión para comentar.

Más respuestas (1)

Wayne King
Wayne King el 30 de Sept. de 2013
Editada: Wayne King el 30 de Sept. de 2013
Can't you just scale the PSD estimate, Pxx, by the maximum value?
You did not provide your OFDM signal, so I'll just create a signal here
Fs = 1000;
t = 0:0.001:1;
x = cos(2*pi*100*t)+randn(size(t));
[Pxx,F] = pwelch(x,300,250,512,Fs);
maxval = max(Pxx);
Pxx = Pxx./maxval;
plot(F,10*log10(Pxx))

1 comentario

Jean-luc
Jean-luc el 30 de Sept. de 2013
Thank you Wayne King, it didn't occurred to me to divide by the max value.
If you don't mind;
Why did you use window as 300 and nonoverlap as 250?

Iniciar sesión para comentar.

Preguntada:

el 30 de Sept. de 2013

Comentada:

el 30 de Sept. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by