/FIRconv

Real-time partitioned convolution algorithms for Finite Impulse Response (FIR) filters in Python.

Primary LanguagePythonMIT LicenseMIT

FIRconv

GitHub release GitHub last commit GitHub issues LICENSE


Python implementation of real-time convolution algorithms for Finite Impulse Response (FIR) filters.

The algorithms are mainly (but not strictly) the ones described in WEFERS, Frank. Partitioned convolution algorithms for real-time auralization. Logos Verlag Berlin GmbH, 2015. found here.

Current algorithms

  • Overlap-add (OLA);
  • Overlap-save (OLS);
  • Uniformily Partitioned Overlap-Save (UPOLS) (generalized/optimized version)

Installation

Use pip to install FIRconv:

$ pip install FIRconv

Getting started

Bellow there's a pseudo-code showing how to setup a basic use of FIRconv for real time convolutions.

from FIRconv import FIRfilter

# Initialize FIR filter
bufferSize = 2**10
method = 'upols'
FIRfilter(method, bufferSize, h=IR)

while True:
  output = FIRfilter.process(audio)
  play(output)

Collaborations are more than welcome!