DSPRelated.com
Forums

RMS of a Sine Wave

Started by rudykeram January 28, 2014
eric.jacobsen@ieee.org (Eric Jacobsen) writes:

> On Tue, 28 Jan 2014 16:46:43 -0600, "rudykeram" <51467@dsprelated> > wrote: > [...] > The plots are two dimensional. Time matters.
To the OP: What Eric said. Perhaps you can resolve your dilemma by sectioning one cycle of a sine wave into small pieces, say, pi/8 chunks. Then "sample" the sine wave at a random phase between 0 and 2pi one million times. Then, by the relative frequency definition, http://en.wikipedia.org/wiki/Frequency_%28statistics%29 the probability of being in each pi/8 range is the number of times the sampling occurred in that range divided by one million. This is precisely what a histogram does. (Sometimes a histogram will only report the number of events in each interval instead of the probability, i.e., will not "divide by N".) Realize of course this isn't the PDF of a sine wave since the PDF will be continuous, but the limit as the intervals approach zero of a histogram should approach the continuous PDF. -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
>On 1/28/14 4:11 PM, rudykeram wrote: >> Would you please be more specific? >> Because when I am looking at the bell shape curve and the plot to its
left,
>> I can see a one to one correspndance between the drawn horizontal lines
(in
>> green) and the amplitude of the bell-curve. >> >>
http://www.mscsoftware.com/training_videos/patran/Reverb_help/index.html#page/Fatigue%20Quickstart%20Guide/fatq15_vibFAT.15.5.html
>> >> The top most horizontal line crosses only few points (maybe one or
two),
>> the second line from the top, crosses even more line, and the third
line,
>> crocess even more. And this count clearly reflects itself as the
magnitude
>> on the bell-curve. >> >> But, if we only consider the sine wave (let's just take only one
perdiod),
>> then every horizontal line will only corss the sine wave at ONLY two
points
>> (with the exception of the peak, crossing only once). Isn't this
correct?
>> >> Then, why is the sine wave PDF curve shaped the way it is? >> > >a sine wave PDF looks like >http://www.atx7006.com/img/hist/adc_sinusoidal_histogram_test_code_hits.jpg
>except that it goes up to infinity on the sides. > >rudy, do you know how to derive the p.d.f. of a random variable that is >the output of some continuous mapping from another random variable of >known p.d.f.? that's how you determine why a p.d.f. curve is shaped the >way it is. > > > >-- > >r b-j rbj@audioimagination.com > >"Imagination is more important than knowledge." > > >
Thank you all. These all makes sense. I just want to have an intuitive grasp of why the sine wave spends more times around its peaks? I can see that, for example, a sine wave spends (1/6)th of its period for 0<values <0.5, but spends (2/6)th of its period for 0.5<values<1. But how would this imply that it spends most of its time around peaks (+/-1)? Is this is a valid reasoning to say this happens due to the fact that slope (rate of change) of a sine wave is very slow (almost flat) around the peaks, and that is why it has a tendency to roam around the peak? Thanks, --Rudy _____________________________ Posted through www.DSPRelated.com
On Wednesday, January 29, 2014 12:38:46 PM UTC-5, rudykeram wrote:
> >On 1/28/14 4:11 PM, rudykeram wrote: > > >> Would you please be more specific? > > >> Because when I am looking at the bell shape curve and the plot to its > > left, > > >> I can see a one to one correspndance between the drawn horizontal lines > > (in > > >> green) and the amplitude of the bell-curve. > > >> > > >> > > http://www.mscsoftware.com/training_videos/patran/Reverb_help/index.html#page/Fatigue%20Quickstart%20Guide/fatq15_vibFAT.15.5.html > > >> > > >> The top most horizontal line crosses only few points (maybe one or > > two), > > >> the second line from the top, crosses even more line, and the third > > line, > > >> crocess even more. And this count clearly reflects itself as the > > magnitude > > >> on the bell-curve. > > >> > > >> But, if we only consider the sine wave (let's just take only one > > perdiod), > > >> then every horizontal line will only corss the sine wave at ONLY two > > points > > >> (with the exception of the peak, crossing only once). Isn't this > > correct? > > >> > > >> Then, why is the sine wave PDF curve shaped the way it is? > > >> > > > > > >a sine wave PDF looks like > > >http://www.atx7006.com/img/hist/adc_sinusoidal_histogram_test_code_hits.jpg > > > > >except that it goes up to infinity on the sides. > > > > > >rudy, do you know how to derive the p.d.f. of a random variable that is > > >the output of some continuous mapping from another random variable of > > >known p.d.f.? that's how you determine why a p.d.f. curve is shaped the > > >way it is. > > > > > > > > > > > >-- > > > > > >r b-j rbj@audioimagination.com > > > > > >"Imagination is more important than knowledge." > > > > > > > > > > > > > Thank you all. These all makes sense. > > I just want to have an intuitive grasp of why the sine wave spends more > > times around its peaks? > > I can see that, for example, a sine wave spends (1/6)th of its period for > > 0<values <0.5, but spends (2/6)th of its period for 0.5<values<1. > > But how would this imply that it spends most of its time around peaks > > (+/-1)? > > Is this is a valid reasoning to say this happens due to the fact that slope > > (rate of change) of a sine wave is very slow (almost flat) around the > > peaks, and that is why it has a tendency to roam around the peak? > > > > Thanks, > > --Rudy > > > > > > _____________________________ > > Posted through www.DSPRelated.com
The rate of change, or let's be precise here and call it its first derivative, is EXACTLY zero at the tops and bottoms. You need more analysis, less hand-waving .....
On Wed, 29 Jan 2014 11:38:46 -0600, rudykeram wrote:

>>On 1/28/14 4:11 PM, rudykeram wrote: >>> Would you please be more specific? >>> Because when I am looking at the bell shape curve and the plot to its > left, >>> I can see a one to one correspndance between the drawn horizontal >>> lines > (in >>> green) and the amplitude of the bell-curve. >>> >>> > http://www.mscsoftware.com/training_videos/patran/Reverb_help/
index.html#page/Fatigue%20Quickstart%20Guide/fatq15_vibFAT.15.5.html
>>> >>> The top most horizontal line crosses only few points (maybe one or > two), >>> the second line from the top, crosses even more line, and the third > line, >>> crocess even more. And this count clearly reflects itself as the > magnitude >>> on the bell-curve. >>> >>> But, if we only consider the sine wave (let's just take only one > perdiod), >>> then every horizontal line will only corss the sine wave at ONLY two > points >>> (with the exception of the peak, crossing only once). Isn't this > correct? >>> >>> Then, why is the sine wave PDF curve shaped the way it is? >>> >>> >>a sine wave PDF looks like >>http://www.atx7006.com/img/hist/
adc_sinusoidal_histogram_test_code_hits.jpg
> >>except that it goes up to infinity on the sides. >> >>rudy, do you know how to derive the p.d.f. of a random variable that is >>the output of some continuous mapping from another random variable of >>known p.d.f.? that's how you determine why a p.d.f. curve is shaped the >>way it is. >> >> >> >>-- >> >>r b-j rbj@audioimagination.com >> >>"Imagination is more important than knowledge." >> >> >> >> > Thank you all. These all makes sense. > I just want to have an intuitive grasp of why the sine wave spends more > times around its peaks? > I can see that, for example, a sine wave spends (1/6)th of its period > for 0<values <0.5, but spends (2/6)th of its period for 0.5<values<1. > But how would this imply that it spends most of its time around peaks > (+/-1)? > Is this is a valid reasoning to say this happens due to the fact that > slope (rate of change) of a sine wave is very slow (almost flat) around > the peaks, and that is why it has a tendency to roam around the peak?
Valid reasoning, but, IMHO, backwards. I would just look at a graph of a sine wave and say "gee, that there wave spends a lot of time close to the peaks". Then I might say "so of course that's why the slope is small at the peaks -- it has to be". -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Tue, 28 Jan 2014 15:11:03 -0600, rudykeram wrote:

> Would you please be more specific? > Because when I am looking at the bell shape curve and the plot to its > left, > I can see a one to one correspndance between the drawn horizontal lines > (in green) and the amplitude of the bell-curve. > > http://www.mscsoftware.com/training_videos/patran/Reverb_help/
index.html#page/Fatigue%20Quickstart%20Guide/fatq15_vibFAT.15.5.html
> > The top most horizontal line crosses only few points (maybe one or two), > the second line from the top, crosses even more line, and the third > line, > crocess even more. And this count clearly reflects itself as the > magnitude on the bell-curve. > > But, if we only consider the sine wave (let's just take only one > perdiod), > then every horizontal line will only corss the sine wave at ONLY two > points (with the exception of the peak, crossing only once). Isn't this > correct? > > Then, why is the sine wave PDF curve shaped the way it is?
You are, perhaps, having trouble with the fact that it's a probability _density_ function. A histogram of a PDF is just an approximation. The PDF is a calculus thing: it is a _density_, not an actual _amount_. You can find the probability that the variable falls between any two values by integrating the PDF between those two values -- but you're stuck with having to use calculus to do it. It's like when you pour a glass of water: the density is pretty close to 1 gram per cc, but if you take the actual amount of water in any infinitesimally thin plane slicing through the glass you'll find that it contains zero mass of water, because it has zero volume. Only when you integrate the volume of the water and multiply by its density can you find the mass (unless, of course, you have a scale handy, and know the mass of the glass). So if you're reaching for an intuitive grasp of the subject, start by using your calculusical intuition. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Randy Yates <yates@digitalsignallabs.com> writes:

> eric.jacobsen@ieee.org (Eric Jacobsen) writes: > >> On Tue, 28 Jan 2014 16:46:43 -0600, "rudykeram" <51467@dsprelated> >> wrote: >> [...] >> The plots are two dimensional. Time matters. > > To the OP: > > What Eric said. > > Perhaps you can resolve your dilemma by sectioning one cycle of a sine > wave into small pieces, say, pi/8 chunks. Then "sample" the sine wave > at a random phase between 0 and 2pi one million times. Then, by the > relative frequency definition, > > http://en.wikipedia.org/wiki/Frequency_%28statistics%29 > > the probability of being in each pi/8 range is the number of times the > sampling occurred in that range divided by one million.
OK, I screwed this up. (Who saw it but didn't say anything?) In a histogram, the x-axis represents ranges of the result of the random experiment, in this case, sampling a sine wave y = sin(x) as x varies uniformly. So it's not the phase that would be sectioned, but the output range of -1 < y < +1. The rest of the post is accurate, I think.
> This is precisely what a histogram does. (Sometimes a histogram will > only report the number of events in each interval instead of the > probability, i.e., will not "divide by N".) > > Realize of course this isn't the PDF of a sine wave since the PDF will > be continuous, but the limit as the intervals approach zero of a > histogram should approach the continuous PDF.
-- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
On Wednesday, January 29, 2014 8:21:32 AM UTC+13, rudykeram wrote:
> Hi, > > I am trying to have a deeper understanding of what RMS means in terms of > > probability distribution function. > > > > There is a figure (toward the end) of the following article (doesn't have a > > figure number) > > http://www.mscsoftware.com/training_videos/patran/Reverb_help/index.html#page/Fatigue%20Quickstart%20Guide/fatq15_vibFAT.15.5.html > > > > It depicts the bell shape of a random normal distribution, where was > > generated by basically taking the histogram of a snapshot of a signal. And > > this makes perfect sense. > > However, the figure below it depicts the PDF of a sine wave, and I am just > > not sure why this is the case? > > To me, it looks like the distribution should be uniform. Any horizontal > > lines through the signal (sine wave), will cross the signal the same number > > of times! Isn't it? > > > > something more in line with this: > > http://en.wikipedia.org/wiki/Uniform_distribution_(continuous) > > > > > > Please correct me if I am wrong? > > > > Thanks, > > --Rudy > > > > _____________________________ > > Posted through www.DSPRelated.com
RMS is standard deviation. RMS squared is average power (assuming no dc) otherwise known as variance.
Randy Yates <yates@digitalsignallabs.com> wrote:
> eric.jacobsen@ieee.org (Eric Jacobsen) writes:
>> On Tue, 28 Jan 2014 16:46:43 -0600, "rudykeram" <51467@dsprelated> >> wrote: >> [...] >> The plots are two dimensional. Time matters.
(snip)
> Perhaps you can resolve your dilemma by sectioning one cycle of a sine > wave into small pieces, say, pi/8 chunks. Then "sample" the sine wave > at a random phase between 0 and 2pi one million times. Then, by the > relative frequency definition,
> http://en.wikipedia.org/wiki/Frequency_%28statistics%29
It is slightly more interesting in the case of sine, as the PDF goes to infinity at the ends, but it is still normalized. So, yes, you have to have the right limit to get it to work.
> the probability of being in each pi/8 range is the number of times the > sampling occurred in that range divided by one million.
> This is precisely what a histogram does. (Sometimes a histogram will > only report the number of events in each interval instead of the > probability, i.e., will not "divide by N".)
> Realize of course this isn't the PDF of a sine wave since the PDF will > be continuous, but the limit as the intervals approach zero of a > histogram should approach the continuous PDF.
Reminds me of an interesting limit problem. Draw a graph of -1/x for x from 0 to 1, and rotate around the y axis. You have a shape that looks a little like a wine glass with a very long stem. Now, fill it with wine. What is the volume? Next, paint the outside, what is the area? (You can also paint the inside, but take the wine out first.) -- glen
On Tuesday, January 28, 2014 1:21:32 PM UTC-6, rudykeram wrote:
> Hi, > > I am trying to have a deeper understanding of what RMS means in terms of > > probability distribution function. > > > > There is a figure (toward the end) of the following article (doesn't have a > > figure number) > > http://www.mscsoftware.com/training_videos/patran/Reverb_help/index.html#page/Fatigue%20Quickstart%20Guide/fatq15_vibFAT.15.5.html > > > > It depicts the bell shape of a random normal distribution, where was > > generated by basically taking the histogram of a snapshot of a signal. And > > this makes perfect sense. > > However, the figure below it depicts the PDF of a sine wave, and I am just > > not sure why this is the case? > > To me, it looks like the distribution should be uniform. Any horizontal > > lines through the signal (sine wave), will cross the signal the same number > > of times! Isn't it? > > > > something more in line with this: > > http://en.wikipedia.org/wiki/Uniform_distribution_(continuous) > > > > > > Please correct me if I am wrong? > > > > Thanks, > > --Rudy > > > > _____________________________ > > Posted through www.DSPRelated.com
A snapshot of a random signal is modeled mathematically as a segment of a _sample function_ of a _random process_ which is a collection of (infinitely many) random variables One method of estimating some of the (infinitely many) parameters of the random process is to assume that all the random variables have the same pdf and CDF and that the process is ergodic, meaning that measurements made on sample functions are representative of the random variable parameters. In particular, if the duration of your snapshot is T seconds (where T is reasonably large so that most of the variations of the process are captured), then the _proportion of time_ that the random signal spends below a given level x is a good measure of F(x), the value of the common CDF of the random variables, at x. For many random signals, this CDF looks like the CDF of a normal random variable with mean m and standard deviation s. "Looks like" is important in that the measured CDF is 0 at the minimum value of the signal in the segment and 1 at the maximum value whereas the normal CDF approaches 0 at -infinity and 1 at +infinity, but the match is pretty good at values between m-3s and m+3s, and certainly good enough for gummint purposes. Correspondingly, the _histogram_ from the snapshot looks like the pdf of a normal random variable with mean m and standard deviation s. For periodic nonrandom signals such as sinusoids, calculations like the above should be made with an integer number of periods. Even one period will do, and in the case of sin(t), we can even use the half-period from -pi/2 to +pi/2 during which the sinusoid varies from -1 to +1. What will the _histogram_ look like? Well, for any fixed x between -1 and +1, the sinusoid has value x at t = arcsin(x) and value x+dx at time t = arcsin(x+dx) and so the proportion of time that the signal spends between x and x+dx is [arcsin(x+dx) - arcsin(x)]/pi. Jumping to the pdf, this is saying that f(x)dx = [arcsin(x+dx) - arcsin(x)]/pi and so f(x) = (1/pi) (d/dx) arcsin(x) = 1/[pi sqrt{1-x^2}], -1 < x < 1 which, as many have already pointed out, approaches infinity as x approaches +/-1. It is by no means a uniform pdf. If you want a uniform pdf for the amplitude, use periodic ramps or sawtooth signals. Dilip Sarwate
On 1/30/14 11:52 AM, dvsarwate wrote:
...
> p(y) = (1/pi) (d/dy) arcsin(y) = 1/[pi sqrt{1-y^2}], -1< y< 1 > > which, as many have already pointed out, approaches infinity > as y approaches +/-1.
yea! i'm glad someone did this. i was too lazy to, or even look for the book, but i was surprized that all i could find with Google images was this histogram that approximates it. and, like we would with ergodic random processes, we equate probabilistic averages +inf integral{ x^M p(x) dx} -inf to time averages +T lim 1/(2T) integral{ ( x(t) )^M dt} T -> +inf -T N-1 lim 1/(2N) SUM{ ( x[n] )^M } for some integer M>0 N -> +inf n=-N then we get consistent r.m.s. values from f(x) and from x(t).
> It is by no means a uniform pdf.
but you can think of it as a uniform PDF (doesn't matter if it's white or not) random variable p(x) = 1/(2pi) rect( x/(2pi) ) going through y = sin(x) then p(y) is as Dilip says.
> If > you want a uniform pdf for the amplitude, use periodic ramps > or sawtooth signals. >
or the output of a decent rand() function. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."