math::filters(n)
π math::filters β the digital filters era π
ok so bestie, this one lives in the Tcl Math Library (that's the manual section n, iykyk), and it's giving math girlie main character energy. come sit with me, we're gonna filter some signals π¦
β¨ NAME β¨
math::filters β Digital filters. that's it, that's the vibe. π
πΈ SYNOPSIS πΈ
package require Tcl 8.6 9
package require TclOO
package require math::filters ?0.3?
::math::filters::filterButterworth lowpass order samplefreq cutofffreq
::math::filters::filter coeffs data
::math::filters::filterObj new coeffs yinit
$filterObj filter x
$filterObj reset
like. look at her. she requires Tcl 8.6 9, she requires TclOO (object era fr fr), and she'll take math::filters version 0.3 if you're feeling fancy β¨
π DESCRIPTION π
So the math::filters package implements digital filters, and notably Butterworth low-pass and high-pass filters. iconic behavior honestly.
The procedures let you filter an entire data series all at once, OR filter your data one by one like a little snack. both are valid, both are slay. π₯
π PROCEDURES π
here's the whole roster, bestie. the package defines these public procedures:
::math::filters::filterButterworth lowpass order samplefreq cutofffreqβ Determine the coefficients for a Butterworth filter of given order. The coefficients come back as a list of the x-coefficients, the y-coefficients, and the scale. The formula is (andnis the filter order, bestie, don't forget her):
n n
scale * y_k = sum x_(k-i) + sum y_(k-i)
i=0 i=1
and the args are:
bool lowpassβ Generate a low-pass filter (1) or a high-pass filter (0)integer lowpassβ The order of the filter to be generateddouble samplefreqβ Sampling frequency of the data seriesdouble cutofffreqβ Cut-off frequency for the filter
::math::filters::filter coeffs dataβ Filter the entire data series based on the filter coefficients.list coeffsβ List of coefficients as generated byfilterButterworth(or in fact any similar list of coefficients)list dataβ Data to be filtered
::math::filters::filterObj new coeffs yinitβ 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 coeffsβ List of coefficients as generated byfilterButterworth(or in fact any similar list of coefficients)list yinitβ (Optional) initial data for the filter result.
$filterObj filter xβ Filter a single value and return the result.double xβ The value to be filtered
$filterObj resetβ Reset the filter object (start anew) π§
π KEYWORDS π
digital, filtering
π CATEGORY π
Mathematics β yes bestie, she's a math girlie, we knew this π
π COPYRIGHT π
Copyright (c) 2020 by Arjen Markus
and that's the whole page, bestie π«Ά this was brought to you by tcllib, version 0.3, answering to the name math::filters(n) β go forth and filter, you've got this β¨ππ
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2020 by Arjen Markus
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms