DSPRelated.com
Forums

Power Measurement of Complex Signal

Started by b2508 8 years ago9 replieslatest reply 8 years ago5659 views

Hi all,

I am trying to find the correct formula to calculate power spectrum in dBm from windowed FFT and to scale it properly for different data and FFT lengths. I would just like to verify the results that I get with you.

Are the following points correct?

- If I have a real sine wave (frequency f) with 2V peak to peak, its power in dBm is suppose to be 10 dBm. If I plot it as regular two-sided spectrum it gives me two peaks at +f and -f with 7 dBm value.

- If I use the same formula to calculate complex sine wave (same frequency, same amplitudes as above for both I and Q) I get one peak at f of value 13 dB.

Is this ok? When do I actually get 10 dBm in my power spectrum? Is it correct that I am suppose to get it when I want to present single sided power spectrum of real signal which means multiplying power in watts by 2 one one side and ignoring the negative frequencies?

Namely, initially I thought that single sided spectrum of real sine and complex sine power values would be the same. 


[ - ]
Reply by Joe_WestOctober 22, 2016

You need to understand that dB is always the base-10 log of a _power_ ratio. dB = 10*log(P2/P1). This is commonly bastardized to be 20*log(V2/V1) which is correct _only_ if each voltage is measured across the same resistance. To calculate power, you need to know both the voltage and current (and phase angle between the two). If you know the voltage and the load is a known resistance then with voltage and resistance you have everything you need to calculate power (from Ohm's law). 

dBm is the ratio using 1mw (10^(-3) watts) as a reference. So 10dBm would be 10mw, 20dBm would be 100mw, 30dBm would be 1000mW = 1 Watt, etc.

Hence the previous poster's "P in dBm = 10*log10(Vrms^2/R) + 30", the "+30" is to account for the 1mW reference power.

Your 2V p-p signal is +10dBm _only_ in a 50 ohm system. 2Vp-p is .707Vrms, so power in a 50 ohm system is .707^2/50=.01  10*log(.01)=-20. -20+30=10

For your two-sided spectrum, each peak has half the power. A halving of power is a 3dB decrease. So each peak is 3dB less than the total 10dBm signal.

For your I-Q example, if the I term is +10dBm and the Q term is also +10dBm, then each term has a Vp-p of 2V, and a 1V peak. The vector sum of the two is sqrt(2). Since the two terms have a fixed phase relation, the total power is the sum of the two components. Doubling the power is a 3dB increase (log(2)=.301, so actually the increase is 3.01dB). So 10+3=13 as you stated.

Hope this helps.

Joe



[ - ]
Reply by b2508October 22, 2016

Thank you very much, this is very helpful. System does have 50 ohm resistance, I forgot to write it as I assumed that it is the most commonly used one, since all the conversion tables refer to this resistance.

[ - ]
Reply by Tim WescottOctober 22, 2016

Oh, lordy.  My Inner Pedant, excited by all the nits to pick, is becoming ascendant:

  • If you have an actual (I hesitate to use "real" here for fear that you'll think I mean the numbering system) sine wave with a peak to peak voltage of 2V, it's power in dBm can be anything at all, from zero to infinite.  Without an impedance for it to work into, there is no power consumed.  However, a 2V p-p sinewave dissipates 10dBm of power in a 50 ohm resistor, and in a system that has a characteristic impedance of 50 ohms, a 2V p-p sinewave is taken as having a power of 10dBm
  • 7dBm how?  How do you do an FFT on a continuous-time voltage, when an FFT is (at least usually) something that happens in digital-land?  If you're doing what I suspect you're doing, then you have scaling at the ADC and scaling in the FFT.  You need to figure out the proper scaling.  You also need to remember that the FFT reads out in amplitudes, and you want to add power -- and when a 10dBm signal loses \( \frac{1}{2} \) of it's amplitude, it drop to 3dBm.
  • How do you get a 2V complex sine wave?  Can you point me to a length of coax cable that'll support a voltage of i2V?  What are your "complex" numbers actually representing?  If you have a "complex waveform" that's actually something that registers 2V on the inphase channel and 2V on the quadrature channel, then what you actually have is a \(2 \sqrt(2) \) volt sine wave that's \( 45^\circ \) shifted from the carrier phase -- and that multiplication by \( \sqrt(2) \) should increase your power by 3dB, not 6.
  • Assuming that you actually have 10dBm in the real world, you actually get 10dBm in your power spectrum when you get all of your scaling right.
  • If you're dealing with quadrature (your "complex") signals, then no, you can't ignore negative frequencies -- in a system with quadrature demodulation, those "negative" frequencies correspond to real signals on the other side (probably the lower side) of your carrier frequency than signals that show up as "positive" frequency.

You are trying to cherry-pick a bunch of rules at random, and then apply them by rote, without ever understanding the fundamentals.  I can't say that you will never, ever get there from here by doing this -- but if you do get there, wherever "there" is, you won't have the faintest clue how you got there, or how to prove that you're there, you may not even know that you're there, and if you ever get knocked off of "there" you'll have no clue how to get back.

Learn the basics.  Get a copy of Oppenheim & Shaffer's "Signal Processing".  Read it.  If you crack it open and you don't understand the underlying math, learn that math.  If it's overwhelming to try to learn it on your own, find on-line classes and take them.

(Math isn't working.  I give up.  Stephan, you need an "easy math guide" someplace, or you need to add math buttons to your tool bar.)

[ - ]
Reply by b2508October 22, 2016

Thank you very much for your answer. Your 'tone' is absolutely horrible and you should also assume sometimes that you did not understand what others mean by their question, or maybe they did not express themselves correctly before starting your "rant". 




[ - ]
Reply by Rick LyonsOctober 22, 2016

Hello b2508. Your original question is worded in a strange way. You made statements there that we cannot fully understand. We can read your words but we don't know EXACTLY what it is you're asking.

You wrote, "I have a real sine wave (frequency f) with 2V peak to peak, its power in dBm is suppose(d) to be 10 dBm." An analog sine wave only has three characteristics; peak amplitude, frequency, and initial phase. An analog sine wave does NOT have a power value!

Now had you written, "I have a real sine wave having a peak to peak voltage of 2 volts across a K-ohm resistor." then we can talk sensibly about the average power (measured in watts) dissipated in that resistor.

In the mathematical world of discrete samples (DSP) we don't have resistors so we don't generally talk about power measured in watts or power measured in dBm. (Remember: dBm typically means a measure of average analog power dissipated in a 50-ohm resistor.) In DSP we have the "notion" (the agreed-upon idea) of "instantaneous power" of a discrete sequence that's equal to the magnitude squared of each sample in the sequence.

So if I have a discrete sequence equal to [4, -3, 5, 2, 1, -7] then its instantaneous "power" is the sequence [16, 9, 25, 4, 1, 49]. And over those six sample values we can say the average power of the sequence is 104/6 = 17.333. That 17.333 value is NOT measured in watts nor dBm, it's dimensionless.

And if I had a second six-sample sequence whose average power was 2*17.333 = 34.666 then I could say the 2nd sequence is 3 dB (that's dB, NOT dBm!!) higher in power than the 1st sequence.

Don't worry about asking a question that's open to all manner of interpretation. I've made that error myself MANY times. You merely have to reword (and maybe reword again) your question until a meaning dialogue can take place.

[ - ]
Reply by b2508October 22, 2016

Hi, thank you very much for your response and for kindness as well.

I have a signal generator and I set it to output umnodulated sine wave with power of 10 dBm (this is a setting in my generator) and it is 50 Ohm system and I receive this through SMA to SMA cable in my receiver that has ADC and FPGA (everywhere its 50 ohm) and later I read the same data from FPGA using some software. Because of sampling what I can access from software is, say 16 bit unsigned values but they represent some voltage.

What I should do is convert these signed 16 bit values back to voltages and try to calculate power spectrum in dBm using FFT. Because I want to test this power spectrum calculation software I simulate this sine wave that I would receive in this case and try to see if values are correct.

When I do that, as sine wave is real, it has two peaks in FFT, or power is equally split beween positive and negative axes. This is when I get 7 dBm values for each peak.

If on my FPGA I did complex downconversion (I reaaaally dont know what is correct and what is incorrect way of saying it, but multiplication with exp and not just sine or cosine), then I get complex/IQ whatever you call it signal. Then I need to again read this signal from FPGA using some software and calculate power. This is what I call complex sine and I also try to simulate it in software using j*sin(2pi*f*t)+cos(2pi*f*t). If I assume that level for these sine and cosine is +-1V and that it is a 50 ohm system, and I try to get power spectrum using FFT, I get one peak at frequency f and of power 13 dBm.

Does this explanation make more sense? And is this result correct?

[ - ]
Reply by Rick LyonsOctober 22, 2016
Hi b2508,
   There are MANY signal processing concepts for you to keep in mind here.

[1] An analog sinusoidal waveform has four voltage characteristics; its average voltage, its peak voltage, its peak-to-peak voltage, and its RMS voltage. Hopefully you know the meanings of those four characteristics.

[2] Hopefully you know the difference between a 'ratio of two average powers measured in dB' and a 'single absolute average power value' measured in dBm. (And converting a single sine wave's RMS voltage value measured in volts to a single power value measured in dBm (or watts) depends on the whether you're system is based on 50-, 300-, or 600-ohm impedances.)

[3] For a given ADC, what is its input voltage range and what are the output values (sample values) corresponding to various sampled input voltage levels. For example, when the ADC samples a voltage of +1 volt, what is the ADC's output sample value (a sample value is a single number)?

[4] Hopefully you know why the FFT of a real-valued sine wave sequence results in spectral components at both a negative and a positive frequency.

[5] Related to the above item# [4], hopefully you know how the frequency of a real-valued sine wave sequence (depending on the number of samples and the sample rate measured in samples/second) determines the FFT results' spectral magnitude values. (This topic is related to the ideas called "spectral leakage" and "scalloping.")

[6] Related to the above item# [5], hopefully you know that if the frequency of a real-valued sine wave sequence (whose peak value is A) is equal to an integer multiple of 'the Fs sample rate measured in samples/second divided by the number of samples N, the FFT results' spectral magnitude values will be AN/2.

If an ADC samples an analog sine wave whose peak voltage is 1 volt, and produces a sine wave sequence whose peak value is A = 100, and the sine wave's freq is a multiple of Fs/N, the two 64-point FFT magnitude values will be AN/2 = 100*64/2 = 3200. So your job is the figure out: if a spectral magnitude value is 3200 what is the power of the sine wave in a 50-ohm system?

There's *SO* much to keep in mind here BEFORE you start to think about complex-downconversion operations. By the way a complex sinusoidal squence represented by exp(±j*2*pi*f*t) is called a "complex exponential."

You wrote:
   "I also try to simulate it in software using
    j*sin(2pi*f*t)+cos(2pi*f*t)."

That's not correct for complex down-conversion. There's no addition operation. Multiplying a real-valued cosine sequence of freq f2 by a complex exponential of freq f1 is described algebraically as: exp(±j*2*pi*f1*t)*cosine(2*pi*f2*t).

We could spend hours in front of a white board (with a pot of hot coffee, or a pitcher of Irish whiskey) discussing all these topics.
[ - ]
Reply by neiroberOctober 22, 2016

Hi,

To compute a power in dBm you need to define the resistance.  P = Vrms^2/R Watts.

P in dBm = 10*log10(Vrms^2/R) + 30

See also my recent post at https://www.dsprelated.com/showarticle/1004.php


[ - ]
Reply by b2508October 22, 2016

Thank you, I forgot to write it, it is 50 ohm.