Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Provided below is the Goertzel64 v0.0 component, which is a fixed-point implementation of an optimized Goertzel digital filter. Using this component allows to detect the amplitude of a single tone in the digital data stream.

Component features:

     * Compatible with PSoC4 and PSoC5
     * Implements optimized Goertzel filter
     * 64-bit fixed-point implementation
     * optional Hanning window

Component was developed for DTMF (touch tone) decoding. It can be used whenever single frequency amplitude must be estimated in the data stream, such as harmonics detection in the power line, sound equalizer, CTCSS (tone squelch), Morse code or FSK decoder.

Component is compatible with Creator 4.0 and Creator 4.4, and was tested using CY8KIT-059 PSoC5LP Prototyping Kit and CY8KIT-044 PSoC4M Pioneer Kit. Demo projects are provided.

Attached archive contains component library, component datasheet and several demo projects for PSoC4 and PSoC5. Please read installation instructions in the readme.pdf.

 

 

Figure 1. Project schematic for filter performance test. Custom  DDS and 32-bit fixed-point Square Root components are supplemented to produce a single tone and extract a magnitude of the tone form the filter output power.

Goetzel64_spetrum_basic_01a_A.png

Figure 2. Filter performance test: Red – normalized magnitude output, Blue – normalized power (magnitude squared). Filter input – 16-bit sine; filter length 64, filter target frequency 1 kHz, sampling rate 8 kHz. Left scale - dB, bottom scale – tone frequency, Hz.

Goertzel_01b_inp float_16bit len64_C.PNG

 

 

Figure 3. Filter performance with Hanning window enabled: Red – normalized magnitude output, Blue – normalized power (magnitude squared). Filter input – 16-bit sine; filter length 64, filter target frequency 1 kHz, sampling rate 8 kHz. Left scale - dB, bottom scale – tone frequency, Hz.

Goetzel64__basic_16bit_len64_log_win_01_D.PNG

 

 

Figure 4. Filter tone envelope extraction demo: Red trace– normalized magnitude output; Blue – input signal (strobed tone). Filter input – PWM modulated sine of 1019 Hz. Filter settings: 8-bit data width, filter length 64, target frequency 1 kHz, sampling rate 8 kHz. Scales: Left – amplitude, Bottom – data block index.

Goertzel64_Pulse_P4_8bit len64_n8.0_ k8.15_win_A.PNG

0 Replies