I wish to convert the FFT magnitude of square wave into dBm. I use FFT to covert voltage of square wave to a complex number, then i absolute the complex number into magnitude. Then i divide the magnitude by 2048. convert the magnitude to dBm:
$$FFT(A)= \frac{abs((fft(A))}{2048}$$
$$10\log ( \frac{(\frac{FFT(A)^2}{50})}{1mW})$$
is this correct? Can anyone correct me? What 1st harmonic and 2nd harnonic amplitude calculation? thank you.
dBm is an abbreviation for the power ratio in decibels (dB) of the measured power referenced to one milliwatt (mW). So if $P$ is a power expressed in Watt ($P_{\rm Watt}$), then $P$ expressed in dBm is $$ P_{\textrm{dBm}}=10\log_{10}\left(\frac{P_{\rm Watt}}{1\text{mW}}\right)=30+10\log_{10}\left(\frac{P_{\rm Watt}}{1\text{W}}\right)=30+P_{\textrm{dB}} $$
If $\frac{\left(\text{FFT}(A)\right)^2}{50}$ represents a power, then it is correct.