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.
- Overlap-add (OLA);
- Overlap-save (OLS);
- Uniformily Partitioned Overlap-Save (UPOLS) (generalized/optimized version)
Use pip to install FIRconv:
$ pip install FIRconv
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)
- For more in-depth examples have a look at testFIR.py or Algorithms_validation.py
Collaborations are more than welcome!