Skip to main content

Fast realtime IIR filter

Project description

This is an IIR filter class which performs sample by sample realtime processing of data. It’s very efficient because it’s not using any indexing operations internally. The class instance acts as the memory of the filter so that it remembers its past.

Import

Use the standard python command to import it:

import iir-filter

Calculate the coefficients

Use your favourite scipy IIR design command and export the coefficients as an SOS:

sos = signal.butter(order, [cutoff(s)], '[filter type]', output='sos')

Create an instance

The constructor takes the sos chain as an argument:

f = iir_filter.IIR_filter(sos)

Perform filtering sample by sample

Filtering is sample by sample by processing the samples as they arrive, for example from an ADC:

sample = f.filter(sample)

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

py-iir-filter-1.0.5.tar.gz (2.2 kB view hashes)

Uploaded source

Built Distribution

py_iir_filter-1.0.5-py3-none-any.whl (6.4 kB view hashes)

Uploaded 3 8

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