Reply by Tim Wescott July 11, 20132013-07-11
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
Reply by electrin July 11, 20132013-07-11
>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
Reply by Mimar July 11, 20132013-07-11
>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
Reply by robert bristow-johnson July 10, 20132013-07-10
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."
Reply by Vladimir Vassilevsky July 10, 20132013-07-10
On 7/10/2013 12:49 PM, Kevin Neilson wrote:
> Yes; this sounds much simpler to me than some type of DFT. I don't > know if the poster said what his sample rate is. If it's low > (compared to the fundamental freq) he'll need to interpolate, but a > cubic interpolator based on four samples is pretty easy to make. >
It is about AC mains frequency; how could sample rate be slow? Oh, I forgot: OP is in Bohemia. They do things without haste. Starting project in March, no result by now. Perhaps, this slowness applies to sample rate, too. VLV
Reply by Kevin Neilson July 10, 20132013-07-10
Yes; this sounds much simpler to me than some type of DFT.  I don't know if the poster said what his sample rate is.  If it's low (compared to the fundamental freq) he'll need to interpolate, but a cubic interpolator based on four samples is pretty easy to make.
Reply by Greg Berchin July 10, 20132013-07-10
On Wed, 10 Jul 2013 07:54:26 -0700 (PDT), clay@claysturner.com
wrote:

>Re: Imaginary power and related poorly worded/named concepts. > > >The state of Georgia used to always ask near the end of the individual annual tax return "Did you file an intangible tax return? If not, why not?"
Would it have been so difficult to call it a "tax on intangibles", and avoid the ambiguity? People pronounce "Empire State Building" as "empire STATE building", as though it is the "'STATE Building' of the Empire". It should be pronounced "(EMPIRE state) building", as "Building of the 'Empire State'". Same goes for Madison Square Garden. It is not a "square garden" on Madison Avenue, it is a garden at Madison Square.
Reply by July 10, 20132013-07-10
On Wednesday, July 10, 2013 8:57:24 AM UTC-4, Randy Yates wrote:
> writes: > > > [...] > > > Ps, excellent opportunity for jokes about "imaginary power" > > > > Apparently. > > -- > > Randy Yates > > Digital Signal Labs > > http://www.digitalsignallabs.com
Re: Imaginary power and related poorly worded/named concepts. The state of Georgia used to always ask near the end of the individual annual tax return "Did you file an intangible tax return? If not, why not?" I used to always answer "No, because if it is intangible, it doesn't relate to anything!" I never had a problem with the state for this answer. Of course an "intangible tax return" was for declaring dividend payments and paying income tax on them. The state no longer asks that question. But yes, one still shows dividends as income and pays tax on it! Clay
Reply by Randy Yates July 10, 20132013-07-10
radams2000@gmail.com writes:
> [...] > Ps, excellent opportunity for jokes about "imaginary power"
Apparently. -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
Reply by July 10, 20132013-07-10
Since the OP has mentioned he is measuring power-line  frequencies, it's safe to assume he has a voltage channel and a current channel, so the phase difference between them is what's important. 

Bob

Ps, excellent opportunity for jokes about "imaginary power"