fastgoertzel 
A Python implementation of the Goertzel algorithm built using C++ for improved run time and efficiency on large datasets and loops.
To-Do:
-
Improved speed.(Significantly increased speed by using numpy arrays). - Implement benchmarking for speed comparison. (fastgoertzel is ~75 times faster than native python)
- Implement batch processing for multiple frequencies.
- Add IIR and k-th FTT implementation of Goertzel.
- Add support for sampling rate.
Installation
You can install using two methods:
Using pip install:
$ pip install fastgoertzel
Using setup.py after cloning repository:
$ git clone git://github.com/0zean/fastgoertzel.git
$ cd fastgoertzel
$ python -m build
Usage
import numpy as np
import pandas as pd
import fastgoertzel as fg
def wave(amp, freq, phase, x):
return amp * np.sin(2*np.pi * freq * x + phase)
x = np.arange(0, 512)
y = wave(1, 1/128, 0, x)
amp, phase = fg.goertzel(y, 1/128)
print(f'Goertzel Amp: {amp:.4f}, phase: {phase:.4f}')
# Compared to max amplitude FFT output
ft = np.fft.fft(y)
FFT = pd.DataFrame()
FFT['amp'] = np.sqrt(ft.real**2 + ft.imag**2) / (len(y) / 2)
FFT['freq'] = np.fft.fftfreq(ft.size, d=1)
FFT['phase'] = np.arctan2(ft.imag, ft.real)
max_ = FFT.iloc[FFT['amp'].idxmax()]
print(f'FFT amp: {max_["amp"]:.4f}, '
f'phase: {max_["phase"]:.4f}, '
f'freq: {max_["freq"]:.4f}')
Release files for fastgoertzel 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 8.5 MB
Release files / fastgoertzel-1.0.2-cp313-cp313-win_amd64.whl
| Download URL | fastgoertzel-1.0.2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 101.9 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f831d7bd5545a91ec2579685e748674a0a77eee28de7fb7b69b61dd04309c1f7
|
|
BLAKE2b-256 checksum How to use checksums |
2f7b334bf57a450539735f70fd55d9787093f546ddaf0279e22c8c642751ff06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp313-cp313-win32.whl
| Download URL | fastgoertzel-1.0.2-cp313-cp313-win32.whl |
|---|---|
| Size | 94.8 kB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
bbde7f256b0b8aa7655c977449c101647a8d540925d3dfd132fb566ed6e1c493
|
|
BLAKE2b-256 checksum How to use checksums |
58f81d0ebb67ec7270e155135351d6c924721996825a5cad97e98db44733df50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | fastgoertzel-1.0.2-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
f81ab5f989b539e2b984124edd5d38a130abbe4be9da708f00ebe9a2c247c280
|
|
BLAKE2b-256 checksum How to use checksums |
d27aafa12acc41d9087754d7448036dfa97d32ccc91ee9c0eda9660d48dedf2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fastgoertzel-1.0.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 351.4 kB |
| Tags | CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
5e0438877856d787dc106ebae05ea5f78ce5cc3562f8519ed08f25753db4247f
|
|
BLAKE2b-256 checksum How to use checksums |
869dcbe1f6b4a74c5816cdfa201485db4dd6f85a2900b57287ae2e601886f314
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | fastgoertzel-1.0.2-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 81.1 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
42efd94316f1f459be8a082f6cbc1164fec65c4e9f9fd3106bdcfe5377c38e2b
|
|
BLAKE2b-256 checksum How to use checksums |
6c79427bcb3a9355a672616641e2d37fc042661c6796db2207a778e3cf57de94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp312-cp312-win_amd64.whl
| Download URL | fastgoertzel-1.0.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 101.9 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8d2b22f5c563528becf8f2161348304dc5e2ac25fb8092e0534721e87aa48c7f
|
|
BLAKE2b-256 checksum How to use checksums |
0711e5ca9c93dddafd03bfd113f715bdd2f4c1415b0b3d17ee17fd7790d5911e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp312-cp312-win32.whl
| Download URL | fastgoertzel-1.0.2-cp312-cp312-win32.whl |
|---|---|
| Size | 94.7 kB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
bd07c15f21d88d56cb568b215e63bf202a0cb3f094cc3bff502148e9ed573f17
|
|
BLAKE2b-256 checksum How to use checksums |
94a5cb6f171de813f4d84a365159d4754c084650d44c377a3c4982d9d0fb9759
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | fastgoertzel-1.0.2-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
b30121a571facd3c6050bb7462ea259fc218e1e0f1a2a861b27ae805e333b167
|
|
BLAKE2b-256 checksum How to use checksums |
476212331e244ac57abccf49a55534b0c94fa042224c7be74a0b6ea68197f0e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fastgoertzel-1.0.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 352.4 kB |
| Tags | CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ccf7737d3512cccfda4f71f082a98a0a156a6b0c119fd09c7927ea5229e42fba
|
|
BLAKE2b-256 checksum How to use checksums |
48bc90769b33296e35e93f9e611d7714b72758e1b930545f9bcb20d61d907b07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | fastgoertzel-1.0.2-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 81.1 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
83e4efc6cdf1d51feb31048d554c2e5fe374bbe83888bb6924055d1a057105b4
|
|
BLAKE2b-256 checksum How to use checksums |
9d7ba4690541fa6282e3255c3fd37fb589ae29847025968f6f59a7e0f8e129ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp311-cp311-win_amd64.whl
| Download URL | fastgoertzel-1.0.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 100.6 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0a41797a6f78172e7af0c75e9b41afe0d6c8df45f6912eaf23919d4185d07413
|
|
BLAKE2b-256 checksum How to use checksums |
5e6c7a7fdbb74ed53092f22e0c26afcd167ec84a183b89cec450658cd6d6b1d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp311-cp311-win32.whl
| Download URL | fastgoertzel-1.0.2-cp311-cp311-win32.whl |
|---|---|
| Size | 94.1 kB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
72ddefa584c6b6930ca94725a35e5ce2c845474765b313683d4f2f2d1f98ad39
|
|
BLAKE2b-256 checksum How to use checksums |
5d725c18535a52976e13ece989fc9c14fb8bc838150aa12e9954b44e0756f171
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | fastgoertzel-1.0.2-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
fbfe3d0a308b26608bbc2dcd675db7deeb1bd0f7609c5043d30cec0fbc81f5fa
|
|
BLAKE2b-256 checksum How to use checksums |
d3b9963228dfa9867b8f2586890a6cb78aaa8103a7f00708116e22e993131641
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fastgoertzel-1.0.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 344.6 kB |
| Tags | CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b20306772ebb0098cf28ea049b29ed14987cc29736c45153093e09b46d9616ea
|
|
BLAKE2b-256 checksum How to use checksums |
0c9b8216cd35e4a422732fe7abd1f9d549e043689df91c40fa6d2d4a3ad43a6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | fastgoertzel-1.0.2-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 80.7 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e49581d422233d2a0f90c2bffb13fc5a05b4aa6eb9d908c02a674fb7b2b721be
|
|
BLAKE2b-256 checksum How to use checksums |
608a5036497616e98912061f5a03078ec57f86ee7fe0566c579b71b1587650cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp310-cp310-win_amd64.whl
| Download URL | fastgoertzel-1.0.2-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 99.8 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9c02161b930054257c29631b035600cd7f08c33a371aa1bf368752a05dc5ab8f
|
|
BLAKE2b-256 checksum How to use checksums |
85a083a8616dc5d9ec06af32af95c15421dd3515a4832871c067dead46ab1bd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp310-cp310-win32.whl
| Download URL | fastgoertzel-1.0.2-cp310-cp310-win32.whl |
|---|---|
| Size | 93.0 kB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
c327350ec8944ec40620ec1fa8e6b57cc3302c7f92bd64873b18526084a218c6
|
|
BLAKE2b-256 checksum How to use checksums |
f24a2647baa1a662cbb34a6726d7ca6407f3b0123848a7f16633d51821a76815
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | fastgoertzel-1.0.2-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
e3a73c2e0fa3f9573b6da22ef2eb37887e7040849246d021a692d248ce2b9440
|
|
BLAKE2b-256 checksum How to use checksums |
34b23a06f5a588308db48a6d8ea979e750fab45ba27adc9f4f7153e3c879f05f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | fastgoertzel-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 313.5 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
fa537417df54cfee969758b939f4ea18a0968876e2323230048139c46c81b55d
|
|
BLAKE2b-256 checksum How to use checksums |
4ad510af709cbf9d4568845edbd92dace2abfba075f64b70c08a4540619d667a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | fastgoertzel-1.0.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 320.0 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
6b27716c43da639af12cb3842fe87ed4bef281aee747dbb9b0b32b9b2712db8b
|
|
BLAKE2b-256 checksum How to use checksums |
5716dd495398bef68d76b032b5c1e25d7e0fed3a090d0cdc2cd90fa14c7907a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fastgoertzel-1.0.2-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | fastgoertzel-1.0.2-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 79.5 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fa9740610cfbf34b2420cf3ee4de0234292cf42d06fc8d361e4c7dd31865872d
|
|
BLAKE2b-256 checksum How to use checksums |
7fd1a8deeefc28cff041164f71a9f4fb82cc2fc85fa6dd108d634e75a75b2260
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|