DSPRelated.com
Forums

find magnitude of varying signal

Started by Unknown September 24, 2013
dear all, 

I am looking at methods to measure the rms from the changing magnitude of a sinusoidal voltage. the voltage has been acquired over 5 seconds and is fluctuating within this time interval. I want to be able to find the maximum and minimum measured voltage during this five seconds. the signal is not very noisy and i am just interested in the different approaches to be able to do this. Thanks.
On Tuesday, September 24, 2013 5:03:50 PM UTC+12, zoulz...@googlemail.com wrote:
> dear all, > > > > I am looking at methods to measure the rms from the changing magnitude of a sinusoidal voltage. the voltage has been acquired over 5 seconds and is fluctuating within this time interval. I want to be able to find the maximum and minimum measured voltage during this five seconds. the signal is not very noisy and i am just interested in the different approaches to be able to do this. Thanks.
In analogue or digital?? In analogue you normally end up rectifying and smoothing to get a measure on size. In digital you could find the variance (assuming zero dc) and take the square root. This is rms. if you wish to do this recursively you could do v*k)=beta*v(k-1)+(1-beta)*x(k)*x(k) where x(k) is the sampled signal and v(k) is its variance. The beta value needs to be less than unity - say 0.95 but depends on convergence rate,smoothness etc. me
On Mon, 23 Sep 2013 22:03:50 -0700, zoulzubazz wrote:

> dear all, > > I am looking at methods to measure the rms from the changing magnitude > of a sinusoidal voltage. the voltage has been acquired over 5 seconds > and is fluctuating within this time interval. I want to be able to find > the maximum and minimum measured voltage during this five seconds. the > signal is not very noisy and i am just interested in the different > approaches to be able to do this. Thanks.
You are asking two different things -- the RMS voltage is related to the maximum and minimum voltages, but the relationship isn't fixed. Which do you want? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Tim Wescott <tim@seemywebsite.really> wrote:
> On Mon, 23 Sep 2013 22:03:50 -0700, zoulzubazz wrote:
(snip)
>> I am looking at methods to measure the rms from the changing magnitude >> of a sinusoidal voltage. the voltage has been acquired over 5 seconds >> and is fluctuating within this time interval. I want to be able to find >> the maximum and minimum measured voltage during this five seconds. the >> signal is not very noisy and i am just interested in the different >> approaches to be able to do this. Thanks.
> You are asking two different things -- the RMS voltage is related to > the maximum and minimum voltages, but the relationship isn't fixed.
It used to be that RMS meant peak-to-peak divided by 2 sqrt(2). Well, he did say sinusoidal! When I first read it, I thought he wanted the maximum and minimum for the positive and negative peak. (maybe divided by sqrt(2)). -- glen
On Tue, 24 Sep 2013 18:10:34 +0000, glen herrmannsfeldt wrote:

> Tim Wescott <tim@seemywebsite.really> wrote: >> On Mon, 23 Sep 2013 22:03:50 -0700, zoulzubazz wrote: > > (snip) >>> I am looking at methods to measure the rms from the changing magnitude >>> of a sinusoidal voltage. the voltage has been acquired over 5 seconds >>> and is fluctuating within this time interval. I want to be able to >>> find the maximum and minimum measured voltage during this five >>> seconds. the signal is not very noisy and i am just interested in the >>> different approaches to be able to do this. Thanks. > >> You are asking two different things -- the RMS voltage is related to >> the maximum and minimum voltages, but the relationship isn't fixed. > > It used to be that RMS meant peak-to-peak divided by 2 sqrt(2). > > Well, he did say sinusoidal! > > When I first read it, I thought he wanted the maximum and minimum for > the positive and negative peak. (maybe divided by sqrt(2)).
I missed the "sinusoidal". Really, it's not RMS unless you _measure_ RMS. Otherwise, it's just an _estimate_ of RMS. Not that I'm like, opinionated or anything. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Tuesday, September 24, 2013 1:03:50 AM UTC-4, zoulz...@googlemail.com wrote:
> dear all, > > > > I am looking at methods to measure the rms from the changing magnitude of a sinusoidal voltage. the voltage has been acquired over 5 seconds and is fluctuating within this time interval. I want to be able to find the maximum and minimum measured voltage during this five seconds. the signal is not very noisy and i am just interested in the different approaches to be able to do this. Thanks.
The magnitude can be computed using the Hilbert transform. In Matlab: mag = abs(hilbert(x)) A pair of bandpass filters with 90 degree different phase can be used in place of hilbert(). John
On Mon, 23 Sep 2013 22:03:50 -0700 (PDT), zoulzubazz@googlemail.com
wrote:

>dear all, > >I am looking at methods to measure the rms from the changing magnitude of a sinusoidal voltage. the voltage has been acquired over 5 seconds and is fluctuating within this time interval. I want to be able to find the maximum and minimum measured voltage during this five seconds. the signal is not very noisy and i am just interested in the different approaches to be able to do this. Thanks.
Hi, There's a way to compute the "real-time" moving variance of a signal. The method's too complicated for me to describe in just a few words here. Send me an E-mail and I'll send you the info if you wish. Perhaps you can modify the variance computation to yield the moving standard deviation. (The standard deviation of a sine wave is equal to its rms value.) [-Rick-]
Rick Lyons <R.Lyons@_bogus_ieee.org> wrote:
> On Mon, 23 Sep 2013 22:03:50 -0700 (PDT), zoulzubazz@googlemail.com
(snip)
>>I am looking at methods to measure the rms from the changing >> magnitude of a sinusoidal voltage. the voltage has been acquired >> over 5 seconds and is fluctuating within this time interval. >> I want to be able to find the maximum and minimum measured voltage >> during this five seconds. the signal is not very noisy and i >> am just interested in the different approaches to be able to >> do this. Thanks.
This reminds me of the VTVM, which should be familiar to at least some of the readers of this group. I still have the one I got as a Heathkit for a Christmas present when I was in high school. There are a few different ways to measure AC voltages. For light bulbs, we want RMS. The VTVM in AC mode measures peak to peak with a vacuum tube based rectifier and some capacitors and resistors. The capacitors charge up on the peaks, and resistors slowly discharge them, such that the reading will change with time. (You don't want the largest value ever seen in the lifetime of the meter, just in the last second or so.) The meter is then calibrated with both a P-P scale and RMS, the latter assuming sine.
> There's a way to compute the "real-time" moving > variance of a signal. The method's too complicated > for me to describe in just a few words here. > Send me an E-mail and I'll send you the info if you > wish. Perhaps you can modify the variance computation > to yield the moving standard deviation. > (The standard deviation of a sine wave is equal > to its rms value.)
-- glen
On 10/4/13 9:42 AM, Rick Lyons wrote:
> On Mon, 23 Sep 2013 22:03:50 -0700 (PDT), zoulzubazz@googlemail.com > wrote: > >> dear all, >> >> I am looking at methods to measure the rms from the changing magnitude of a sinusoidal voltage. the voltage has been acquired over 5 seconds and is fluctuating within this time interval. I want to be able to find the maximum and minimum measured voltage during this five seconds. the signal is not very noisy and i am just interested in the different approaches to be able to do this. Thanks. > > Hi, > There's a way to compute the "real-time" moving > variance of a signal. The method's too complicated > for me to describe in just a few words here.
how many words does it take (if you can make use of "ASCII math")? x[n] is the input signal N = constant integer >= 2 n x_moving_mean[n] = 1/N SUM{ x[i] } i=n-N n x_moving_variance[n] = 1/(N-1) SUM{ (x[i] - x_moving_mean)^2 } i=n-N n = 1/(N-1)( SUM{ (x[i])^2 } - N/(N-1) (x_moving_mean[n])^2 i=n-N the moving variance estimate is unbiased. if you want the simpler, but slightly biased, variance estimate then replace (N-1) with N in the final equality. moving standard deviation is the sqrt() of the moving variance. the moving SUMs of x[n] and (x[n])^2 can be implemented cheaply with a delay line and integrator, the simplest non-trivial Truncated IIR (TIIR) filter or like in this thing they sometimes call a Cascaded Integrator Comb (CIC) filter.
> Send me an E-mail and I'll send you the info if you > wish. Perhaps you can modify the variance computation > to yield the moving standard deviation. > (The standard deviation of a sine wave is equal > to its rms value.)
a sine wave with no DC. the standard deviation of *any* waveform with its mean or DC removed is the same as its rms value. ain't it? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."

whoops, an off-by-one error.  and one i can't blame on MATLAB...

meant to say:





     x[n] is the input signal

     N = constant integer >= 2


                               n
     x_moving_mean[n]  =  1/N SUM{ x[i] }
                             i=n-N+1

                                     n
   x_moving_variance[n]  =  1/(N-1) SUM{ (x[i] - x_moving_mean[n])^2 }
                                   i=n-N+1

                      n
          =  1/(N-1) SUM{ (x[i])^2 }  -  N/(N-1) (x_moving_mean[n])^2
                    i=n-N+1



and you have to view it with a mono-spaced font to make the limits of 
the summation line up with the \Sigma .

and remember that the variance estimate is unbiased, which is why we're 
dividing by (N-1) instead of N.





-- 

r b-j                  rbj@audioimagination.com

"Imagination is more important than knowledge."