Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform


Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | bandwidth of the Goertzel

There are 4 messages in this thread.

You are currently looking at messages 0 to 4.


bandwidth of the Goertzel - Thomas Magma - 2005-06-20 16:55:00

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? 


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: bandwidth of the Goertzel - Tim Wescott - 2005-06-20 17:22:00



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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: bandwidth of the Goertzel - Clay S. Turner - 2005-06-21 00:50:00

"Thomas Magma" <s...@overtherainbow.com> wrote in message 
news:43Gte.47813$El.1433@pd7tw1no...
> 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 


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: bandwidth of the Goertzel - Thomas Magma - 2005-06-21 10:00:00

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" <P...@Bellsouth.net> wrote in message 
news:4_Mte.149703$J...@bignews6.bellsouth.net...
>
> "Thomas Magma" <s...@overtherainbow.com> wrote in message 
> news:43Gte.47813$El.1433@pd7tw1no...
>> 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
> 


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.