Skip to main content

A custom educational DSP suite featuring a from-scratch iterative FFT implementation - built by Hamd Waseem

Project description

Audiergon

A Python Digital Signal Processing (DSP) processor powered by a custom Cooley-Tukey Fast Fourier Transform implementation.

💻 GitHub Repo | 🐍 PyPI Page | 📝 Docs

Key Features

  • Cooley-Tukey FFT
    • Pure Python iterative implementations of 1D Forward and Inverse Fast Fourier Transforms.
  • Optimised Bit Reversal Permutations
    • Fast bit-reversal indexing using native compiled C-speed NumPy indexing.
  • Overlap-Add Audio EQ Pipeline
    • Complete pipeline for applying Hann windowing, processing frames through an equaliser, and rebuilding raw 16-bit PCM .wav streams without clicking or imaginary artifacts.

Installation

Install the library using pip:

pip install audiergon

Dependencies

  • numpy

Quick Start & API Examples

1 - Basic FFT & Frequency Analysis

Compute the Fourier Transform of a simple signal array and generate its matching frequency bins.

from audiergon import iterative_fft, iterative_fftfreq

# Input array must have a length that is a power of 2
signal = [1.0, 0.5, -0.2, 0.1, 0.8, -0.4, 0.3, -0.1]
sampling_interval = 1.0 / 44100  # 44.1 kHz Sample Rate

# 1. Perform Forward FFT
frequency_coefficients = iterative_fft(signal)

# 2. Compute matching frequencies for the spectrum bins
frequencies = iterative_fftfreq(len(signal), d=sampling_interval)

print("Frequency spectrum coefficients:", frequency_coefficients)
print("Calculated bin frequencies (Hz):", frequencies)

2 - Equalizing an Audio File

Process an audio track using the built-in Overlap-Add (OLA) processing pipeline.

from audiergon import process_audio

# Modify the frequency bands using multipliers
output_path = process_audio(
    audio_filepath="in.wav",
    bass_gain=1.5,
    low_mid_gain=1.2,
    mid_gain=1.0,
    high_mid_gain=0.8,
    treble_gain=0.5,
    output="out.wav"
)

The process_audio pipeline requires 16-bit Mono PCM WAV files. You can convert standard formats using ffmpeg:

ffmpeg -i in.mp3 -acodec pcm_s16le -ac 1 -ar 44100 out.wav

API Overview

audiergon.fast_fourier_transform

  • iterative_fft(arr)

    • Computes the 1D Discrete Fourier Transform (DFT).
    • Input: list or numpy.ndarray (length must be a power of 2).
    • Returns: list of complex numbers tracking amplitude and phase.
  • iterative_ifft(arr)

    • Computes the Inverse DFT converting frequencies back to the time domain.
    • Returns: numpy.ndarray scaled by the sequence length.
  • iterative_fftfreq(l, d=1.0)

    • Generates frequency values for each bin location.

audiergon.process

  • process_audio(audio_filepath, bass_gain, low_mid_gain, mid_gain, high_mid_gain, treble_gain, output=None)
    • Applies windowed equalisation filters over an absolute file path.
  • generate_hann_window(frame_size)
    • Generates a list containing real Hann coefficients to smooth frame boundary edges.
  • apply_equaliser(transformed, frame_size, framerate, ...)
    • Sirectly apply scale gains on an existing complex frequency domain segment.

audiergon.bit_reverse

  • bit_reverse(arr, convert_to_complex=False)
    • Applies bit-reversal array permutations optimized with high-performance NumPy vector operations.

License

Audiergon is open-source software licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audiergon-0.1.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audiergon-0.1.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file audiergon-0.1.1.tar.gz.

File metadata

  • Download URL: audiergon-0.1.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for audiergon-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ecd73b060b6b7e0c4aa8583b7c189c22cdf6e71598151f8697b0397d4dbfdc64
MD5 b887ddecdc15f576400461e25f70804c
BLAKE2b-256 6b677b5328b5dde9f6909c23827e0d5b2a5b7d8500cf466c06678c0630c736e6

See more details on using hashes here.

File details

Details for the file audiergon-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: audiergon-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for audiergon-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1f34e30ad579969610d6710de89a99fa752cd4bce67998023a20a53bf72cbce
MD5 82e22ecd038d6599a698809080a7eb59
BLAKE2b-256 6d5182d8c925c48f215b1432616492c44fbd47f9f62f48e53eac375a30d9fa6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page