Applications Of Goertzel Algorithm

download Applications Of Goertzel Algorithm

of 18

Transcript of Applications Of Goertzel Algorithm

  • 8/10/2019 Applications Of Goertzel Algorithm

    1/18

    Applications Of

    Goertzel Algorithm

    Presented by

    Wattamwar Reshma R.

    Roll No:13

    ME-FY(Digital system)

  • 8/10/2019 Applications Of Goertzel Algorithm

    2/18

    What is Goertzel algorithm?

    The Goertzel algorithmis a Digital Signal

    Processing technique that provides a means for

    efficient evaluation of individual terms of theDiscrete Fourier Transform.

  • 8/10/2019 Applications Of Goertzel Algorithm

    3/18

    A basic Goertzel

    Before you can do the actual Goertzel, you must

    do some preliminary calculations:

    1. Decide on the sampling rate.

    2. Choose the block size, N.

    3. Precompute one cosine and one sine term.

    4. Precompute one coefficient.

  • 8/10/2019 Applications Of Goertzel Algorithm

    4/18

    Sampling rate:

    The number of samples carried per second is

    called sample rate.

    Your sampling rate may already be determinedby the application. For example, in telecom

    applications, it's common to use a sampling rate

    of 8kHz (8,000 samples per second).

  • 8/10/2019 Applications Of Goertzel Algorithm

    5/18

    Block size:

    Goertzel block size N is like the number of points

    in an equivalent FFT. It controls the frequency

    resolution (also called bin width).

    For example, if your sampling rate is 8kHz and Nis 100 samples, then your bin width is 80Hz.

  • 8/10/2019 Applications Of Goertzel Algorithm

    6/18

    Precomputed constants

    per-sample processing

    calculate Q0, Q1, and Q2.

    Q0 = coeff * Q1 - Q2 + sample

    Q2 = Q1

    Q1 = Q0

    After running the per-sample equations N times,

    it's time to see if the tone is present or not.

    s

    tone

    f

    fNk

  • 8/10/2019 Applications Of Goertzel Algorithm

    7/18

    Magnitude calculation:

    real = (Q1 - Q2 * cosine)

    imag = (Q2 * sine) (Magnitude)2 = (real)2+(imag)2

  • 8/10/2019 Applications Of Goertzel Algorithm

    8/18

    An optimized Goertzel

    The optimized Goertzel requires lesscomputation than the basic one, at the expense

    of phase information.

    The per-sample processing is the same, but the

    end of block processing is different. Instead of

    computing real and imaginary components, and

    then converting those into relative magnitude

    squared, you directly compute the following:

    (Magnitude)2=(Q1)2+(Q2)2-Q1*Q2*coeff

  • 8/10/2019 Applications Of Goertzel Algorithm

    9/18

    Implementation

    (1) The first stage calculates an intermediate sequenceS(n).

    (2) The second stage applies the following filter to S(n),

    producing output sequence Y(n).

  • 8/10/2019 Applications Of Goertzel Algorithm

    10/18

    Implementation

    The Z transform of the first filter stage given in equation

    The Z transform of the second filter stage given in equation

    The combined transfer function of the cascade of the two filter stagesis then

  • 8/10/2019 Applications Of Goertzel Algorithm

    11/18

    Applications

    Dual Tone Multi-Frequency (DTMF) applications.

    Push-button digital telephone sets.

    electronic mail and telephone banking systems.

    Tuning of guitar string.

    Detection of specific frequencies in audio signals.

  • 8/10/2019 Applications Of Goertzel Algorithm

    12/18

    DTMF Signaling

    In a DTMF signaling system a combination of

    two frequency tones represents a specific digit,

    character (A, B, C or D) or symbol (* or #).

    Two types of signal processing are involved: Coding or generation.

    Decoding or detection.

    For coding, two sinusoidal sequences of finitelength are added in order to represent a digit,

    character or symbol as shown in the following

    example.

  • 8/10/2019 Applications Of Goertzel Algorithm

    13/18

    DTMF Tone Generation

    1 2 3

    654

    7 8 9

    #0*

    A

    B

    C

    D

    1209Hz 1336Hz 1477Hz 1633Hz

    697Hz

    770Hz

    852Hz

    941Hz

    1336770770770770

    Ou

    tput

    Freq (Hz)

    Example: Button 5 results in a 770Hz and a

    1336Hz tone being generated simultaneously.

  • 8/10/2019 Applications Of Goertzel Algorithm

    14/18

    N = 205 fs = 8kHz The decimal values are divided by 2 to be represented in

    Q15 format. This has to be taken into account during implementation

    Frequency kCoefficient

    (decimal)

    Coefficient

    (Q15)

    1633 42 0.559454 0x479C

    1477 38 0.790074 0x6521

    1336 34 1.008835 0x4090*

    1209 31 1.163138 0x4A70*

    941 24 1.482867 0x5EE7*852 22 1.562297 0x63FC*

    770 20 1.635585 0x68B1*

    697 18 1.703275 0x6D02*

  • 8/10/2019 Applications Of Goertzel Algorithm

    15/18

    DTMF Tone Detection

    Detection of tones can be achieved by using abank of filters or using the Discrete Fourier

    Transform (DFT or FFT).

    However, the Goertzel algorithm is more efficient

    for this application. The Goertzel algorithm is derived from the DFT

    and exploits the periodicity of the phase factor,

    exp(-j*2k/N) to reduce the computational

    complexity associated with the DFT, as the FFT

    does.

  • 8/10/2019 Applications Of Goertzel Algorithm

    16/18

    With the Goertzel algorithm only 16 samples of

    the DFT are required for the 16 tones

  • 8/10/2019 Applications Of Goertzel Algorithm

    17/18

    Advantage

    Simple structure of algorithm makes it well

    suited to small processors.

    More efficient than FFT for small number of

    frequencies ( if M < log2N).

  • 8/10/2019 Applications Of Goertzel Algorithm

    18/18

    THANK YOU!