MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
marvin_LPF.h
Go to the documentation of this file.
1// ========================================================================================================
2// _______ _______ ______ ___ ___ _______ _______
3// | | | _ | __ \ | |_ _| | |
4// | | | < | |_| |_| |
5// |__|_|__|___|___|___|__|\_____/|_______|__|____|
6//
7// This file is part of the Marvin open source library and is licensed under the terms of the MIT License.
8//
9// ========================================================================================================
10
11#ifndef MARVIN_LPF_H
12#define MARVIN_LPF_H
14namespace marvin::dsp::filters {
18 template <FloatType SampleType>
19 class LPF {
20 public:
25 void initialise(double sampleRate) noexcept;
37 void setCutoff(SampleType cutoff) noexcept;
43 void setCoeff(SampleType newCoeff) noexcept;
52 [[nodiscard]] SampleType operator()(SampleType x) noexcept;
56 void reset() noexcept;
57
58 private:
59 double m_sampleRate{ 0.0 };
60 SampleType m_prev{ static_cast<SampleType>(0.0) };
61 SampleType m_coeff{ static_cast<SampleType>(0.0) };
62 };
63} // namespace marvin::dsp::filters
64#endif
A direct form i first order single pole lowpass filter.
Definition marvin_LPF.h:19
void initialise(double sampleRate) noexcept
void setCutoff(SampleType cutoff) noexcept
void setCoeff(SampleType newCoeff) noexcept
SampleType operator()(SampleType x) noexcept
Digital filter functions and classes.
Definition marvin_SVF.h:15