Forums

Goertzel algorithm:Overflow occured in Call Progress Detection!

Started by tian July 13, 2005
Dear friends
    I need to implement a call progress tone detector using goertzel
algorithm. To avoid strong signal inputs to the Goertzel filters,
additional gain control is used to prevent early overflow:

; Control gain of the input sample x(n)
; On a 32 samples length buffer of input samples, the average peak
; amplitude GAIN_amp is computed using the last 32 samples. The current
; input samples are then attenuated using the foll formulas:
;   GAIN_CON = (1/2)SQRT(2)
;   GAIN_AMP(n) =
GAIN_CON*(1/16)*[abs(x(n))+abs(x(n+1))+...+abs(x(n+31))]
;   if( GAIN_AMP > GAIN_THR )
;      y(n) = (GAIN_THR/GAIN_AMP) * x(n)
;   else
;      y(n) = x(n)

    But overflow STILL occured in goertzel by using this gain control.For
example,i need to calculate 205 points DFT.using the equation:
     vk(n) = 2*coef*vk(n-1) - vk(n-2) + x(n)
    In assemble code,first calculate
(1/2)vk(n)=coef*vk(n-1)-(1/2)vk(n-2)+(1/2)x(n)  to avoid 2coef overflow,
then multiplied by 2 to get vk(n).
    In my code, the overflow occured in the 80th loop, while (1/2)vk(n) <
-0.5, if multiplied by 2, vk(n)<-1, it is OVERFLOW!
    I use the same code to detect DTMF signal, no overflow occured, and
DTMF signal can be detected. So I want to know how can I avoid overflow in
CPT detection. 
    If each of you have any experince or idea, I will appreciate to
propose me.



    Tian



		
This message was sent using the Comp.DSP web interface on
www.DSPRelated.com
"tian" <fengtian1116@163.com> wrote in message 
news:65WdnYkzrZ3kY0nfRVn-3g@giganews.com...
> Dear friends > I need to implement a call progress tone detector using goertzel > algorithm. To avoid strong signal inputs to the Goertzel filters, > additional gain control is used to prevent early overflow: >
> But overflow STILL occured in goertzel by using this gain control.For > example,i need to calculate 205 points DFT.using the equation: > vk(n) = 2*coef*vk(n-1) - vk(n-2) + x(n) > In assemble code,first calculate > (1/2)vk(n)=coef*vk(n-1)-(1/2)vk(n-2)+(1/2)x(n) to avoid 2coef overflow, > then multiplied by 2 to get vk(n). > In my code, the overflow occured in the 80th loop, while (1/2)vk(n) < > -0.5, if multiplied by 2, vk(n)<-1, it is OVERFLOW! > I use the same code to detect DTMF signal, no overflow occured, and > DTMF signal can be detected. So I want to know how can I avoid overflow in > CPT detection. > If each of you have any experince or idea, I will appreciate to > propose me. > > > > Tian >
Hello Tian, The gain of a Goertzel is 2/N where N is the number of samples. I used to scale down the input by this factor before the Goertzel loop. Clay