Hi Mr Al,
For the Hann function I get the following 9 samples in the time domain :
x(0) = 0, x(1) = 0.146, x(2) = 0.5, x(3) = 0.854, x(4) = 1, x(5) = 0.854, x(6) = 0.5, x(7) = 0.146, x(8) = 0 ;N = 9
Considering both positive and negative frequencies, DFT transforms this to
X(0) = 4, X(1) = -2.19 – j0.8, X(2) =0.16 + j0.14, X(3) = 0.03 + j0.05, X(4) = 0.0027 + j0.015, X(5) = 0.0027 – j0.015, X(6) = 0.03 – j0.05, X(7) = 0.16 –j0.14, X(8) = -2.19 + j0.8
|X(0)|/N = 4/9 = 0.444v = 0.2 watts = 22.95 dBm = dc or average value. MATLAB = 30 dBm
PEAK ;|X(1)|/N = 2.33/9 = 0.26v (pk) = 0.0676 watt (pk) = 18.3 dBm (pk) MATLAB = 23.98 dBm
RMS ; |X(1)|/N = 2.33/9 = 0.26v (pk) = 0.26/√2 v (rms) = 0.184 watt (rms) = 22.65 dBm (rms) MATLAB = 23.98 dBm
PEAK ;|X(2)|/N = 0.21/9 = 0.023v (pk) = 0.00053 watt (pk) = -2.76 dBm (pk) MATLAB = -32.99 dBm
RMS ; |X(2)|/N = 0.21/9 = 0.023v (pk) = 0.023/√2 v (rms) = 0.00027 watt (rms) = -5.78 dBm (rms) MATLAB = -32.99 dBm
I built a very simple model in MATLAB, Simulink (no coding required) consisting of a signal generator, an oscilloscope and a spectrum analyser.
The MATLAB readings above were taken from a power spectrum plot in the spectrum analyser – not sure if they are peak/rms.
As you can see none of my calculations match either what you say above or the readings MATLAB produces. I suspect I am not calculating X(f) correctly see page 2 of the attached pdf.