### Install fastgoertzel with pip Source: https://github.com/0zean/fastgoertzel/blob/master/docs/pypi.md Install the package from PyPI using pip. ```bash $ pip install fastgoertzel ``` -------------------------------- ### Use fastgoertzel to compute amplitude and phase Source: https://github.com/0zean/fastgoertzel/blob/master/docs/pypi.md Example showing how to use the goertzel function to extract amplitude and phase from a signal, and compare with FFT results. ```python 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}') ``` -------------------------------- ### Clone and build fastgoertzel from source Source: https://github.com/0zean/fastgoertzel/blob/master/docs/pypi.md Clone the repository and build the package using python -m build. ```bash $ git clone git://github.com/0zean/fastgoertzel.git $ cd fastgoertzel $ python -m build ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.