Metadata-Version: 2.4
Name: ultrafastgoertzel
Version: 0.1.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: numpy>=2.0
Requires-Dist: pytest>=7.0 ; extra == 'test'
Requires-Dist: black ; extra == 'lint'
Requires-Dist: ruff~=0.11.2 ; extra == 'lint'
Provides-Extra: test
Provides-Extra: lint
Summary: A fast goertzel calculator Rust
Keywords: goertzel,rust,pyo3,signal-processing,fft,dsp
Author-email: Joseph Chotard <joseph@chotard.com>
License: WTFPL
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/JosephChotard/ultrafastgoertzel
Project-URL: Source, https://github.com/JosephChotard/ultrafastgoertzel

# ultrafastgoertzel Python Bindings

Ultra-fast Goertzel algorithm implementation with SIMD optimization for Python.
## Usage

```python
import ultrafastgoertzel as ufg
import math

# Generate a test signal (sine wave at frequency 0.1)
signal = [math.sin(2 * math.pi * 0.1 * i) for i in range(1000)]

# Analyze a single frequency
magnitude = ufg.goertzel(signal, 0.1)
print(f"Magnitude at 0.1: {magnitude:.4f}")

# Analyze multiple frequencies efficiently (recommended)
frequencies = [0.1, 0.2, 0.3]
magnitudes = ufg.goertzel_batch(signal, frequencies)
for freq, mag in zip(frequencies, magnitudes):
    print(f"Frequency {freq}: {mag:.4f}")
```

## Frequency Normalization

Frequencies are normalized, where:
- 0.0 = DC (0 Hz)
- 0.5 = Nyquist frequency (half the sampling rate)

For example, if your sampling rate is 1000 Hz:
- 0.1 represents 100 Hz
- 0.25 represents 250 Hz
- 0.5 represents 500 Hz (Nyquist)

## Performance

This implementation uses SIMD instructions for optimal performance. The `goertzel_batch` function is particularly efficient when analyzing multiple frequencies on the same signal, as it can process multiple frequencies in parallel.

## License

WTFPL License.
