math::filters - Digital filters
The math::filters package implements digital filters, notably Butterworth low-pass and high-pass filters. The procedures allow to filter an entire data series as well as filter data one by one.
The package defines the following public procedures:
Determine the coefficients for a Butterworth filter of given order. The coefficients are returned as a list of the x-coefficients, the y-coefficients and the scale. The formula is (n is the filter order):
n n scale * y_k = sum x_(k-i) + sum y_(k-i) i=0 i=1
Generate a low-pass filter (1) or a high-pass filter (0)
The order of the filter to be generated
Sampling frequency of the data series
Cut-off frequency for the filter
Filter the entire data series based on the filter coefficients.
List of coefficients as generated by filterButterworth (or in fact any similar list of coefficients)
Data to be filtered
Create a filter object. The initial x data are taken as zero. The initial y data can be prescribed. If they are not given, they are taken as zero as well.
List of coefficients as generated by filterButterworth (or in fact any similar list of coefficients)
(Optional) initial data for the filter result.
Filter a single value and return the result.
The value to be filtered
Reset the filter object (start anew)
Mathematics
Copyright © 2020 by Arjen Markus