DSPRelated.com
Forums

Best way to estimate amplitude and phase

Started by Mimar July 9, 2013
small typo...

On 7/9/13 12:40 PM, robert bristow-johnson wrote:
> > you will see that > > A = 2*sqrt( (LPF{x[n]*r[n]})^2 + (LPF{x[n]*r[n]})^2 ) >
should be A = 2*sqrt( (LPF{x[n]*r[n]})^2 + (LPF{x[n]*q[n]})^2 ) -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
>On Tue, 09 Jul 2013 06:14:09 -0500, "Mimar" <94571@dsprelated> wrote: > >>Hello, >> >>as Tim Wescott wrote in his last followup it will be better to create
new
>>thread instead to continue in "Sliding Goertzel problem" thread. >> >>I need to estimate amplitude and phase of power line voltage. My boss
has
>>said me recently we have to compute these values quickly and accurately.
>>At the moment we use normal DFT, but this method is too slowly. So I
tried
>>to implement sliding Goertzel, but without good results. More in
previous
>>thread.... >> >>Yesterday I asked myself:"What about to use GA with integer K and then >>correct errors according well-known frequency?" Do you think it can
work?
>> >>I tried to find information about other method how to estimate ampl. and >>phase, but there are only several articles on the web. Any tips? >> >>Thank you a lot. >> >>Miroslav > >How are you currently using the DFT? Are you computing all of the >bins or just the bin(s) of interest? The nice thing about a DFT is >you only need to compute the bins you want. This can dramatically >reduce the computational load compared to computing the entire DFT. > >Or is the problem that the window length takes too long to collect >data? > >And what are you measuring the phase against? > >Eric Jacobsen >Anchor Hill Communications >http://www.anchorhill.com >
Hello Eric, we are using single bin DFT (for 50 Hz) at the moment, this algorithm is very simple, but still slowly and the accuraty is also no great shakes. We have got 8 channels to measure - thera are 4 for voltage and 4 for current. If we can perform meas. process in real time (sample rate is 2400 Hz), we need faster method to determine first harmonic of signal. The sliding DFT or sliding Goertzel seems good for our aim, but there is still leakage effect. But on the other hand error is according my boss acceptable. The lenghth of each buffer doesn&acute;t introduce problem, problem is execution speed. And the phase means a delay between voltage and current. I have written it confusedly. But we are also interested in angle between real and imag. components of DFT result. Thanks! _____________________________ Posted through www.DSPRelated.com
>On Tue, 09 Jul 2013 06:14:09 -0500, "Mimar" <94571@dsprelated> wrote: > >>Hello, >> >>as Tim Wescott wrote in his last followup it will be better to create
new
>>thread instead to continue in "Sliding Goertzel problem" thread. >> >>I need to estimate amplitude and phase of power line voltage. My boss
has
>>said me recently we have to compute these values quickly and accurately.
>>At the moment we use normal DFT, but this method is too slowly. So I
tried
>>to implement sliding Goertzel, but without good results. More in
previous
>>thread.... >> >>Yesterday I asked myself:"What about to use GA with integer K and then >>correct errors according well-known frequency?" Do you think it can
work?
>> >>I tried to find information about other method how to estimate ampl. and >>phase, but there are only several articles on the web. Any tips? >> >>Thank you a lot. >> >>Miroslav > >How are you currently using the DFT? Are you computing all of the >bins or just the bin(s) of interest? The nice thing about a DFT is >you only need to compute the bins you want. This can dramatically >reduce the computational load compared to computing the entire DFT. > >Or is the problem that the window length takes too long to collect >data? > >And what are you measuring the phase against? > >Eric Jacobsen >Anchor Hill Communications >http://www.anchorhill.com >
Hello, we are computing just only one bin - bin for 50 Hz. But we have got 8 channels for voltage and current, so single bin DFT is too slow for us if we must measure all of them in real time (sampling rate is 2400 Hz). Buffer length is not the problem, problem is computing speed. So I found sliding DFT algorithm, it seems it can be suitable for our system. As I mentioned, I wrote asm and C program with Goertzel last week. I have to say it works pretty fine, but there is leakage effect. It is clear. But yesterday I was talking with my boss and the result is, small error is acceptable (like the DFT, we applied before). Super. So the GA is winner for us. A phase introduces the delay between voltage and current. I have written it confusedly :-). But we are interested in DFT agle between real and complex components, too. _____________________________ Posted through www.DSPRelated.com
On Thu, 11 Jul 2013 06:23:36 -0500, Mimar wrote:

>>On Tue, 09 Jul 2013 06:14:09 -0500, "Mimar" <94571@dsprelated> wrote: >> >>>Hello, >>> >>>as Tim Wescott wrote in his last followup it will be better to create > new >>>thread instead to continue in "Sliding Goertzel problem" thread. >>> >>>I need to estimate amplitude and phase of power line voltage. My boss > has >>>said me recently we have to compute these values quickly and >>>accurately. > >>>At the moment we use normal DFT, but this method is too slowly. So I > tried >>>to implement sliding Goertzel, but without good results. More in > previous >>>thread.... >>> >>>Yesterday I asked myself:"What about to use GA with integer K and then >>>correct errors according well-known frequency?" Do you think it can > work? >>> >>>I tried to find information about other method how to estimate ampl. >>>and phase, but there are only several articles on the web. Any tips? >>> >>>Thank you a lot. >>> >>>Miroslav >> >>How are you currently using the DFT? Are you computing all of the bins >>or just the bin(s) of interest? The nice thing about a DFT is you only >>need to compute the bins you want. This can dramatically reduce the >>computational load compared to computing the entire DFT. >> >>Or is the problem that the window length takes too long to collect data? >> >>And what are you measuring the phase against? >> >>Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com >> > Hello Eric, > > we are using single bin DFT (for 50 Hz) at the moment, this algorithm is > very simple, but still slowly and the accuraty is also no great shakes. > We have got 8 channels to measure - thera are 4 for voltage and 4 for > current. > If we can perform meas. process in real time (sample rate is 2400 Hz), > we need faster method to determine first harmonic of signal. The sliding > DFT or sliding Goertzel seems good for our aim, but there is still > leakage effect. But on the other hand error is according my boss > acceptable. > The lenghth of each buffer doesn&acute;t introduce problem, problem is > execution speed. > > And the phase means a delay between voltage and current. I have written > it confusedly. But we are also interested in angle between real and > imag. components of DFT result.
If you're being careful, a Goertzel algorithm requires one multiply per cycle, and three additions. A single-bin DFT, with inphase and quadrature outputs, requires two multiplies and two additions per cycle. What are you using for a processor that one more multiply per sample bogs you down so very badly? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com