FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > DSP

DSP comp.dsp newsgroup, mailing list

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-20-2005, 09:55 PM
Thomas Magma
Guest
 
Posts: n/a
Default bandwidth of the Goertzel

Say I set up my Goertzel algorithm to detect a 1000Hz tone. What happens if
the tone coming in is 1020Hz?How about 1100Hz? Will I still get gain from my
Goertzel detector? I guess my question is, what is the shape and bandwidth
of the Goertzel when used as a tone detector? I'm guessing it has something
to do with the amount of samples processed...is there a formula for this?


Reply With Quote
  #2 (permalink)  
Old 06-20-2005, 10:22 PM
Tim Wescott
Guest
 
Posts: n/a
Default Re: bandwidth of the Goertzel

Thomas Magma wrote:
> Say I set up my Goertzel algorithm to detect a 1000Hz tone. What happens if
> the tone coming in is 1020Hz?How about 1100Hz? Will I still get gain from my
> Goertzel detector? I guess my question is, what is the shape and bandwidth
> of the Goertzel when used as a tone detector? I'm guessing it has something
> to do with the amount of samples processed...is there a formula for this?
>
>

The Goertzel algorithm implements an IIR filter that has an impulse
response equal to sin(q0 * n), where q0 is frequency of the band center
in radians/sample and n is the sample offset. If you run the Goertzel
algorithm for N samples, then the Goertzel algorithm will have a
response exactly equal to a FIR filter who's coefficents are calculated
from:

{ sin(q0 * k) 0 <= k <= N-1
h(k) = { .
{ 0 otherwise

Barring stupid math errors on my part such a filter will have a
frequency-domain shape of

H(theta) = sin((q0 - theta) * N/2) / (q0 - theta) +
sin((q0 + theta) * N/2) / (q0 + theta)

-- i.e. a pair of sinc functions centered on q0 and -q0. So the shorter
your filter length is the wider the bandwidth is going to be. For
infinite filter lengths, of course, your filter will be infinitely
narrow but you may experience some problems with overflow.

--
-------------------------------------------
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Reply With Quote
  #3 (permalink)  
Old 06-21-2005, 05:50 AM
Clay S. Turner
Guest
 
Posts: n/a
Default Re: bandwidth of the Goertzel


"Thomas Magma" <[email protected]> wrote in message
news:[email protected]
> Say I set up my Goertzel algorithm to detect a 1000Hz tone. What happens
> if the tone coming in is 1020Hz?How about 1100Hz? Will I still get gain
> from my Goertzel detector? I guess my question is, what is the shape and
> bandwidth of the Goertzel when used as a tone detector? I'm guessing it
> has something to do with the amount of samples processed...is there a
> formula for this?
>


Hello Thomas,

Yes there is a formula for this. The function is called a Dirichlet
function - otherwise known as a periodic sync function. This is found by
finding the DFT of a rectangular window. Remember the Goertzel algo is a way
of finding the DFT of a function for a single bin's frequency.

The gain formula is

X(f) = (1/N)*sin(pi*f*N/F)/sin(pi*f/F)

where N is the number of samples,

f is the difference between your signal's frequency and the analysis
frequency,

and F is the sample rate.

For example let N=205, the sample rate is 8000Hz, your signal's freq. is 697
Hz, and you are using bin number 18, so the center frequency is simply
702.439Hz.

Then f = 697 - 702.439 = - 5.439 Hz.

X(f) then equals 0.96835 or -0.279 dB.

Also the energy loss is 1-X(f)*X(f) = 0.06229 or 6.229% of the energy will
show up in the other bins. This last formula is the result of Bessel's
identity (special case of Parseval's theorem)

IHTH,

Clay


Reply With Quote
  #4 (permalink)  
Old 06-21-2005, 03:00 PM
Thomas Magma
Guest
 
Posts: n/a
Default Re: bandwidth of the Goertzel

Thanks Clay, I think this is exactly what I am looking for. I will play with
the math and then sweep simulated signal data using the Goertzel to verify.

Thomas



"Clay S. Turner" <[email protected]> wrote in message
news:[email protected] ...
>
> "Thomas Magma" <[email protected]> wrote in message
> news:[email protected]
>> Say I set up my Goertzel algorithm to detect a 1000Hz tone. What happens
>> if the tone coming in is 1020Hz?How about 1100Hz? Will I still get gain
>> from my Goertzel detector? I guess my question is, what is the shape and
>> bandwidth of the Goertzel when used as a tone detector? I'm guessing it
>> has something to do with the amount of samples processed...is there a
>> formula for this?
>>

>
> Hello Thomas,
>
> Yes there is a formula for this. The function is called a Dirichlet
> function - otherwise known as a periodic sync function. This is found by
> finding the DFT of a rectangular window. Remember the Goertzel algo is a
> way of finding the DFT of a function for a single bin's frequency.
>
> The gain formula is
>
> X(f) = (1/N)*sin(pi*f*N/F)/sin(pi*f/F)
>
> where N is the number of samples,
>
> f is the difference between your signal's frequency and the analysis
> frequency,
>
> and F is the sample rate.
>
> For example let N=205, the sample rate is 8000Hz, your signal's freq. is
> 697 Hz, and you are using bin number 18, so the center frequency is simply
> 702.439Hz.
>
> Then f = 697 - 702.439 = - 5.439 Hz.
>
> X(f) then equals 0.96835 or -0.279 dB.
>
> Also the energy loss is 1-X(f)*X(f) = 0.06229 or 6.229% of the energy will
> show up in the other bins. This last formula is the result of Bessel's
> identity (special case of Parseval's theorem)
>
> IHTH,
>
> Clay
>



Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DPSK Bandwidth porterboy DSP 1 08-13-2004 12:57 PM
3db bandwidth Le Phong DSP 3 04-21-2004 02:41 AM
FSK bandwidth Jach DSP 1 04-09-2004 05:48 PM
Re: Goertzel detector to Goertzel filter? Clay S. Turner DSP 6 01-14-2004 02:44 AM
FM and its bandwidth kbc DSP 6 07-21-2003 10:05 AM


All times are GMT +1. The time now is 11:17 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved