23#ifndef __IIRFILTER_H__
24#define __IIRFILTER_H__
29#ifndef HIDE_FROM_DOXYGEN
48 Iir16(
void) : m_tc(0), m_z(0) {};
53 void Update(uint16_t input) {
54 m_z = ((
static_cast<int64_t
>(m_z) * m_tc) >> 15) -
55 ((
static_cast<int32_t
>(input) * m_tc) << 1) +
56 (
static_cast<int32_t
>(input) << 16);
61 uint16_t LastOutput() {
68 void Tc(uint16_t newTc) {
79 void TcSamples(uint16_t riseSamples99pct) {
80 float tcTemp = powf(.01, 1. / riseSamples99pct) * 32768 + 0.5;
81 m_tc = (tcTemp < INT16_MAX) ? tcTemp : INT16_MAX;
84 uint16_t TcSamples() {
85 return logf(0.01) / logf(m_tc / 32768.);
92 void Tc_ms(uint16_t riseMs99pct) {
97 void Reset(uint16_t newSetting) {
98 m_z = (newSetting << 16);
ClearCore timing profiling utility functions.
#define MS_TO_SAMPLES
Definition SysTiming.h:49
Namespace to encompass the ClearCore board API.
Definition AdcManager.h:36