DSPRelated.com
Forums

measuruement of peak amplitude of each cycle of sinusoid having varying frequency

Started by Unknown August 22, 2011
I am measuring the peak amplitude of each cycle of a sinusoid having
frequency of 125Hz but the frequency varies in the range 100Hz to
150Hz after around every 3 cycles. I sample the signal for 8ms to
capture 1 complete cycle of the sinusoid and then apply 128 point FFT
on it to get magnitude and phase information. The algorithm works
pretty well if the frequency remains constant at 125Hz however as the
frequency changes i get incorrect magnitude and phase due to spectral
leakage problem. I tried using windowing but still the results deviate
from actual a lot. It has been more than a week I am trying to solve
this problem but in vain:( Can any body please help me to solve this
issue.

Thanks.

sanaashaukat@hotmail.com wrote:
> I am measuring the peak amplitude of each cycle of a sinusoid having > frequency of 125Hz but the frequency varies in the range 100Hz to > 150Hz after around every 3 cycles. I sample the signal for 8ms to > capture 1 complete cycle of the sinusoid and then apply 128 point FFT > on it to get magnitude and phase information.
Peak value = maxumim value. Find maximum and minimum of your data and here is the peak amplitude. No need for FFTs and such.
> The algorithm works > pretty well if the frequency remains constant at 125Hz however as the > frequency changes i get incorrect magnitude and phase due to spectral > leakage problem. I tried using windowing but still the results deviate > from actual a lot. > It has been more than a week I am trying to solve > this problem but in vain:( > Can any body please help me to solve this > issue.
Sure. The price for my work will be equal to the price of two weeks of your work. Fair enough. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On Sun, 21 Aug 2011 23:03:18 -0700 (PDT), sanaashaukat@hotmail.com
wrote:

>I am measuring the peak amplitude of each cycle of a sinusoid having >frequency of 125Hz but the frequency varies in the range 100Hz to >150Hz after around every 3 cycles. I sample the signal for 8ms to >capture 1 complete cycle of the sinusoid and then apply 128 point FFT >on it to get magnitude and phase information. The algorithm works >pretty well if the frequency remains constant at 125Hz however as the >frequency changes i get incorrect magnitude and phase due to spectral >leakage problem. I tried using windowing but still the results deviate >from actual a lot. It has been more than a week I am trying to solve >this problem but in vain:( Can any body please help me to solve this >issue. > >Thanks.
Look into windows that provide flat-topped frequency response. These are used in spectrum analyzers for the purpose you mention. In the past HP/Agilent et al have published white papers, etc., on this topic that are publically available. Eric Jacobsen http://www.ericjacobsen.org http://www.dsprelated.com/blogs-1//Eric_Jacobsen.php
On Aug 22, 11:36�am, eric.jacob...@ieee.org (Eric Jacobsen) wrote:
> On Sun, 21 Aug 2011 23:03:18 -0700 (PDT), sanaashau...@hotmail.com > wrote: > > >I am measuring the peak amplitude of each cycle of a sinusoid having > >frequency of 125Hz but the frequency varies in the range 100Hz to > >150Hz after around every 3 cycles. I sample the signal for 8ms to > >capture 1 complete cycle of the sinusoid and then apply 128 point FFT > >on it to get magnitude and phase information. The algorithm works > >pretty well if the frequency remains constant at 125Hz however as the > >frequency changes i get incorrect magnitude and phase due to spectral > >leakage problem. I tried using windowing but still the results deviate > >from actual a lot. It has been more than a week I am trying to solve > >this problem but in vain:( Can any body please help me to solve this > >issue. > > >Thanks. > > Look into windows that provide flat-topped frequency response. � These > are used in spectrum analyzers for the purpose you mention. � In the > past HP/Agilent et al have published white papers, etc., on this topic > that are publically available. > > Eric Jacobsenhttp://www.ericjacobsen.orghttp://www.dsprelated.com/blogs-1//Eric_Jacobsen.php
The flattop windows are also given in the Bruel and Kjar (spelling ?) manuals as well. Last time I looked they were available online. Cheers, David
On Aug 22, 2:03�am, sanaashau...@hotmail.com wrote:
> I am measuring the peak amplitude of each cycle of a sinusoid having > frequency of 125Hz but the frequency varies in the range 100Hz to > 150Hz after around every 3 cycles. I sample the signal for 8ms to > capture 1 complete cycle of the sinusoid and then apply 128 point FFT > on it to get magnitude and phase information. The algorithm works > pretty well if the frequency remains constant at 125Hz however as the > frequency changes i get incorrect magnitude and phase due to spectral > leakage problem. I tried using windowing but still the results deviate > from actual a lot. It has been more than a week I am trying to solve > this problem but in vain:( Can any body please help me to solve this > issue. > > Thanks.
Besides, the flat top window suggestion, you could just do everything in the time domain and compute the instantaneous envelope. For this you need a Hilbert transformer or a pair of phase orthogonal filters. Clay

Clay wrote:

> On Aug 22, 2:03 am, sanaashau...@hotmail.com wrote: > >>I am measuring the peak amplitude of each cycle of a sinusoid having >>frequency of 125Hz but the frequency varies in the range 100Hz to >>150Hz after around every 3 cycles. I sample the signal for 8ms to >>capture 1 complete cycle of the sinusoid and then apply 128 point FFT >>on it to get magnitude and phase information. The algorithm works >>pretty well if the frequency remains constant at 125Hz however as the >>frequency changes i get incorrect magnitude and phase due to spectral >>leakage problem. I tried using windowing but still the results deviate >>from actual a lot. It has been more than a week I am trying to solve >>this problem but in vain:( Can any body please help me to solve this >>issue. >> > Besides, the flat top window suggestion, you could just do everything > in the time domain and compute the instantaneous envelope. For this > you need a Hilbert transformer or a pair of phase orthogonal filters.
On one of the projects, I had to measure an amplitude of approximately sinusoidal signal with a variable frequency, and with noise, too. Making a hystogram of samples and estimating the amplitude from that hystogram is what worked best. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On Aug 22, 10:55&#4294967295;am, Vladimir Vassilevsky <nos...@nowhere.com> wrote:
> sanaashau...@hotmail.com wrote: > > I am measuring the peak amplitude of each cycle of a sinusoid having > > frequency of 125Hz but the frequency varies in the range 100Hz to > > 150Hz after around every 3 cycles. I sample the signal for 8ms to > > capture 1 complete cycle of the sinusoid and then apply 128 point FFT > > on it to get magnitude and phase information. > > Peak value = maxumim value. Find maximum and minimum of your data and > here is the peak amplitude. No need for FFTs and such.
each sample, when used in a FFT, gives you a indirect estimate of the max, no need to throw away all those estimates

steve wrote:

> On Aug 22, 10:55 am, Vladimir Vassilevsky <nos...@nowhere.com> wrote: > >>sanaashau...@hotmail.com wrote: >> >>>I am measuring the peak amplitude of each cycle of a sinusoid having >>>frequency of 125Hz but the frequency varies in the range 100Hz to >>>150Hz after around every 3 cycles. I sample the signal for 8ms to >>>capture 1 complete cycle of the sinusoid and then apply 128 point FFT >>>on it to get magnitude and phase information. >> >>Peak value = maxumim value. Find maximum and minimum of your data and >>here is the peak amplitude. No need for FFTs and such. > > each sample, when used in a FFT, gives you a indirect estimate of the > max, no need to throw away all those estimates
Not quite. That's valid only on assumption that the signal is a perfect sinusoid. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
> > >steve wrote: > >> On Aug 22, 10:55 am, Vladimir Vassilevsky <nos...@nowhere.com> wrote: >> >>>sanaashau...@hotmail.com wrote: >>> >>>>I am measuring the peak amplitude of each cycle of a sinusoid having >>>>frequency of 125Hz but the frequency varies in the range 100Hz to >>>>150Hz after around every 3 cycles. I sample the signal for 8ms to >>>>capture 1 complete cycle of the sinusoid and then apply 128 point FFT >>>>on it to get magnitude and phase information. >>> >>>Peak value = maxumim value. Find maximum and minimum of your data and >>>here is the peak amplitude. No need for FFTs and such. >> >> each sample, when used in a FFT, gives you a indirect estimate of the >> max, no need to throw away all those estimates > >Not quite. That's valid only on assumption that the signal is a perfect >sinusoid.
If its a perfect sinusoid 4 successive samples gives you everything you need to know about it. Steve

Eric Jacobsen wrote:

> On Sun, 21 Aug 2011 23:03:18 -0700 (PDT), sanaashaukat@hotmail.com > wrote: > >>I am measuring the peak amplitude of each cycle of a sinusoid having >>frequency of 125Hz but the frequency varies in the range 100Hz to >>150Hz after around every 3 cycles. I sample the signal for 8ms to >>capture 1 complete cycle of the sinusoid and then apply 128 point FFT >>on it to get magnitude and phase information. The algorithm works >>pretty well if the frequency remains constant at 125Hz however as the >>frequency changes i get incorrect magnitude and phase due to spectral >>leakage problem. I tried using windowing but still the results deviate > >>from actual a lot. It has been more than a week I am trying to solve > >>this problem but in vain:( Can any body please help me to solve this >>issue. >> > Look into windows that provide flat-topped frequency response. These > are used in spectrum analyzers for the purpose you mention.
Dear doctor Jacobsen, A sinusoid with variable frequency is not a sinusoid. Hence any FFT based method will produce a wrong result for amplitude. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com