FIRconv
raw JSON → 0.0.3 verified Mon Apr 27 auth: no python
Python library for real-time convolution, primarily for auralization. Current version 0.0.3, early development with infrequent releases.
pip install firconv Common errors
error ModuleNotFoundError: No module named 'firconv' ↓
cause Library is not installed or you are using the wrong package name (e.g., 'pyfir', 'fir').
fix
Run: pip install firconv
error AttributeError: module 'firconv' has no attribute 'FIRconv' ↓
cause You used 'import firconv' and tried firconv.FIRconv, but FIRconv is a class directly importable.
fix
Use: from firconv import FIRconv
error ValueError: Input must be float32 ↓
cause Passing int16 or float64 arrays to FIRconv.process().
fix
Convert input: input_signal = input_signal.astype(np.float32)
Warnings
breaking The API may change drastically before 1.0. No backward compatibility guarantees. ↓
fix Pin version and review release notes before upgrading.
gotcha Audio data must be float32 numpy arrays. Other types (int16, float64) cause silent errors or crashes. ↓
fix Ensure input arrays are dtype=np.float32.
gotcha Impulse response length must be a power of two or at least aligned with block size. Non-power-of-two IRs may produce artifacts. ↓
fix Pad IR to a power of two if necessary.
Imports
- FIRconv wrong
import FIRconvcorrectfrom firconv import FIRconv - PartitionedConvolution wrong
from firconv.core import PartitionedConvolutioncorrectfrom firconv import PartitionedConvolution
Quickstart
from firconv import FIRconv
import numpy as np
# Create a simple impulse response (e.g., 1024 samples)
ir = np.random.randn(1024).astype(np.float32)
# Initialize FIRconv with the IR
conv = FIRconv(ir)
# Process a block of audio
input_signal = np.random.randn(4096).astype(np.float32)
output = conv.process(input_signal)
# For real-time streaming, use process() repeatedly