Skip to main content

Real-time digital butterworth IIR filter

Project description


Python implementation of the digital butterworth IIR filter


  • numpy – used for its math modules and fast array calculations

  • numba – used to increase calculation speed

Basic Usage

Importing the Butter module:

from butterworth import Butter

Creating the Butter instance for a lowpass butterworth filter with cutoff frequency 1000Hz and rolloff frequency 48Hz for data taken with sampling frequency 44100:

filter_ = Butter(btype="Lowpass", cutoff=1000, rolloff=48, sampling=44100)

Sending sample data into filter and retrieving the filtered data:

data=[1.0, -2.0, 3.0, . . . .]
filtered_data = filter_.send(data)

Retrieving forward-backward filtered data for the accumulated data:

data1=[1.0, -2.0, 3.0, . . . .]
filtered_data = filter_.send(data1)
data2=[-1.0, 2.0, -3.0, . . . .]
more_filtered_data = filter_.send(data2)
forward_backwards_filtered_data = filter_.filtfilt()

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

butterworth-0.0.3.tar.gz (13.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page