This repository contains the VHDL implementation of the Goertzel Algorithm designed to detect a 150 kHz signal in a data set sampled at 4 MHz. The design is modular, synthesizable, and handles input and output data efficiently.
The Goertzel algorithm is a digital signal processing technique used to detect specific frequencies within a block of input data. It's particularly useful for applications like tone detection in telecommunication systems.
In simple terms:
The Goertzel algorithm is designed to detect a specific frequency component within a block of input samples.
It transforms the input data into a frequency domain representation but is optimized to focus on one frequency of interest.
It’s more efficient than performing a full Fast Fourier Transform (FFT) when you only need to detect a single frequency.
Set initial values:
- ( s[0] = 0 )
- ( s[1] = 0 )
-
Compute k, the index for the target frequency:
- k = (N * f_target) / f_sample
-
Compute the coefficient:
- omega = (2 * pi * k) / N
- coeff = 2 * cos(omega)
-
Update state:
- s[n] = x[n] + (coeff * s[n-1]) - s[n-2]
-
Shift the states:
- s[n-2] = s[n-1]
- s[n-1] = s[n]
Compute the magnitude of the target frequency component:
- real_part = s[N-1] - (s[N-2] * cos(omega))
- imag_part = s[N-2] * sin(omega)
- magnitude = sqrt(real_part^2 + imag_part^2)
The Goertzel algorithm processes each input sample to update its internal state and finally computes the magnitude of the desired frequency component. This method is efficient for detecting specific frequencies within a signal.
The Goertzel Algorithm is implemented with the following specifications:
- Number of samples (N): 135
- Input data: 12-bit unsigned (offset binary numbers)
- Internal data: 20-bit signed (2’s complement numbers)
- Sample frequency: 4 MHz
- Signal frequency to detect: 150 kHz
- Output: 20-bit signed level indication
There are 2 folder :
- Goertzel filter matlab : signal waveform generated and goertzel filter verified in matlab.
- vhdl :- code of goertzel filter implementation in vhdl.
- VHDL Simulator (e.g., ModelSim, Vivado)
- FPGA Development Board (optional for synthesis and real-world testing)
- Clone the repository:
git clone https://github.com/MR-Khan0099/Goertzel-Filter-vhdl.git cd Goertzel-Filter-vhdl