math::filters(3tcl)
β¨ NAME β¨
okay so bestie, math::filters is the Digital filters page from the Tcl Math Library π it lives in the 3tcl manual, and it's all about filtering your data, no cap.
π¦ 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 yes, it needs Tcl 8.6 or 9 and it needs TclOO too, because we're object-oriented in this house π
πΈ DESCRIPTION πΈ
The math::filters package implements digital filters, notably Butterworth low-pass and high-pass filters. The procedures let you filter an entire data series or filter data one by one. Both. Your choice. Main character energy either way β¨
π PROCEDURES π
The package defines the following public procedures:
::math::filters::filterButterworth lowpass order samplefreq cutofffreqβ figure out the coefficients for a Butterworth filter of the given order. You get back a list of the x-coefficients, the y-coefficients, and the scale. Here's the formula, where n is the filter order:
n n
scale * y_k = sum x_(k-i) + sum y_(k-i)
i=0 i=1
boollowpass β generate a low-pass filter (1) or a high-pass filter (0) πintegerlowpass β the order of the filter to be generateddoublesamplefreq β sampling frequency of the data seriesdoublecutofffreq β cut-off frequency for the filter
bestie the second one sayslowpassin the original, notorder, and I'm not about to gaslight you by "fixing" it. Transcribing it fr fr π«Ά
::math::filters::filter coeffs dataβ filter the entire data series based on the filter coefficients. whole series, one call, slay.listcoeffs β list of coefficients as generated byfilterButterworth(or in fact any similar list of coefficients)listdata β 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're not given, they're taken as zero as well.listcoeffs β list of coefficients as generated byfilterButterworth(or in fact any similar list of coefficients)listyinit β (Optional) initial data for the filter result.
$filterObj filter xβ filter a single value and return the result.doublex β the value to be filtered
$filterObj resetβ reset the filter object (start anew) π
π KEYWORDS π
digital, filtering
π CATEGORY π
Mathematics
π COPYRIGHT π
Copyright (c) 2020 by Arjen Markus
and that's the whole vibe check π this is tcllib, version 0.3, and the page itself is math::filters(3tcl) β go filter something gorgeous, bestie π
β¨π¦
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- 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