DSPRelated.com
Forums

Power and phase of a signal: newbie question

Started by xargon July 26, 2005
Hi everyone,

I just started with DSP and basically I am trying to go through the
material on my own and I am finding it kind of difficult.

I was going through the section on Power of a signal. I understand that
the power of a digital signal is defined by the sum of the square of
all the signal values.

Then I had an exercise question, where the given signal was: y =
ASin(wt). Now what would be the power of such a signal. I think the
intergral Sin(wt) = Cos(wt). So is the power going to be equal to A^2 *
Cos^2 (wt). I know I am misunderstanding something here and would
appreciate some help.

Another question is when we talk about the phase of a signal, what does
that actually mean? I am finding it hard to grasp this concept of phase
and the book assumes that the reader knows what it is :(

Would really appreciate any help on this.

Thanks,
-K

xargon wrote:
> Hi everyone, > > I just started with DSP and basically I am trying to go through the > material on my own and I am finding it kind of difficult. > > I was going through the section on Power of a signal. I understand that > the power of a digital signal is defined by the sum of the square of > all the signal values.
The "power" (in quotes because it really isn't power in watts) is the _average_ of the squares of all the signal values.
> > Then I had an exercise question, where the given signal was: y = > ASin(wt). Now what would be the power of such a signal. I think the > intergral Sin(wt) = Cos(wt). So is the power going to be equal to A^2 * > Cos^2 (wt). I know I am misunderstanding something here and would > appreciate some help.
You are not using either your definition or mine. y^2 = A^2 * sin^2(wt). Getting the power from this is pretty easy: sin^2(wt) = 1/2 - 1/2 cos(2wt), which averages out to 1/2.
> > Another question is when we talk about the phase of a signal, what does > that actually mean? I am finding it hard to grasp this concept of phase > and the book assumes that the reader knows what it is :( >
Define your signal as cos(wt + q). Then w is the frequency (in radians per second) and q is the phase (in radians). Absolute phase can be a slippery thing to pin down because then you have to argue about when is t=0, but it's pretty easy to talk about phase shift through linear filters. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Hi,

Thanks for replying! You are right about the power. I had "power"
confused with "energy" of the signal.

One question though:

How do you get this identity:

sin^2(wt) = 1/2 - 1/2 cos(2wt), which averages out to 1/2.

Rather, I am more confused as to why it would average out to 1/2.

-K
Thanks!

xargon wrote:
> Hi, > > Thanks for replying! You are right about the power. I had "power" > confused with "energy" of the signal. > > One question though: > > How do you get this identity: > > sin^2(wt) = 1/2 - 1/2 cos(2wt), which averages out to 1/2. > > Rather, I am more confused as to why it would average out to 1/2. > > -K > Thanks! >
From the basic trig identity: cos(a) * cos(b) = 1/2 cos(a + b) + 1/2 cos(a - b). Then _another_ trig identity: sin(a) = cos(a - pi/2). I'll let you work them out -- if you're going to be doing much signal processing you should be quite conversant with your trig identities. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
xargon wrote:
> Hi, > > Thanks for replying! You are right about the power. I had "power" > confused with "energy" of the signal. > > One question though: > > How do you get this identity: > > sin^2(wt) = 1/2 - 1/2 cos(2wt), which averages out to 1/2. > > Rather, I am more confused as to why it would average out to 1/2. > > -K > Thanks!
Consider the complex number exp(i*x). In rectangular coordinates, that's cos(x) + i*sin(x) Multiplying two complex numbers multiplies the magnitudes and adds the angles. Can you take it from there? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
xargon wrote:

> Thanks for replying! You are right about the power. I had "power" > confused with "energy" of the signal.
> One question though:
> How do you get this identity:
> sin^2(wt) = 1/2 - 1/2 cos(2wt), which averages out to 1/2.
> Rather, I am more confused as to why it would average out to 1/2.
Well, since it is squared it can't go negative, so it oscillates between zero and one. That doesn't guarantee that it is 1/2 but the average needs to be somewhere between zero and one. -- glen

xargon wrote:

> Another question is when we talk about the phase of a signal, what does > that actually mean? I am finding it hard to grasp this concept of phase > and the book assumes that the reader knows what it is :(
Some time ago, somebody posted a link here to a java demo http://www.falstad.com/fourier/ that I think demonstrates the concept nicely. Drag and drop both the magnitudes and the phases to see how the signal changes. The java applet above might just be what you need to understand the concepts you read about in your book. Rune
This is a great applet. Thanks!

What I am having trouble understanding is how would the ear
differentiate between same signal but which are out of phase with each
other. Like we know frequency is related to pitch and the magnitude is
related to loudness... what is phase perceived as?

xargon wrote:
> This is a great applet. Thanks! > > What I am having trouble understanding is how would the ear > differentiate between same signal but which are out of phase with each > other. Like we know frequency is related to pitch and the magnitude is > related to loudness... what is phase perceived as?
Phase has no meaning to the ear or any other sensor. What matters is phase difference. Detecting that requires either memory or a reference. Phase is usually expressed in radians or degrees. I usually think about it in fractions of a cycle. A story might bring the concept home to you. A couple live near a subway stop whose platform is between the uptown and downtown tracks. Trains in both directions open onto it. They go to One of two movie theaters every Saturday night; one is uptown, the other is downtown. Trains run on a ten-minute headway in both directions. When they get to the platform, they take the first train to arrive and go to the theater in that direction. After a while, they notice that for every time they go downtown, they go uptown five times. If they arrive at the platform at random times, how is that possible? Since the arrival of trains is a periodic phenomenon and their periods are equal, we can compare their phases. It should be clear that the downtown train arrives two minutes before the uptown train, giving it a phase lead of 20%, or 72 degrees. For eight out of ten minutes -- 288 degrees -- the uptown train will be the next one to arrive. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������

xargon wrote:
> This is a great applet. Thanks! > > What I am having trouble understanding is how would the ear > differentiate between same signal but which are out of phase with each > other. Like we know frequency is related to pitch and the magnitude is > related to loudness... what is phase perceived as?
I believe the human auditory system uses the phase difference between the ears to estimate the direction to the sound source. At least in some frequency bands. But I am way out on my depth now, so don't take my word for it. Rune