![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Calculates the derivative (rate of change) of input values with filtering for stability. More...
#include <DerivativeFilter.h>

Public Member Functions | |
| DerivativeFilter () | |
Constructs a DerivativeFilter instance with default configurations. | |
| float | GetOutput () |
| Retrieves the current filtered derivative output. | |
| float | Filter (float value) |
| Filters the derivative of the input value and normalizes the output. | |
Private Attributes | |
| RunningAverageFilter< 10 > | output = RunningAverageFilter<10>(0.2f) |
| Running average filter for smoothing the derivative output. | |
| MinFilter< 40 > | minFilter |
| Minimum filter for baseline normalization. | |
| float | previousReading = 0.0f |
| Stores the previous input value for calculating the rate of change. | |
| float | outputValue = 0.0f |
| Stores the most recent filtered derivative value. | |
Calculates the derivative (rate of change) of input values with filtering for stability.
The DerivativeFilter smooths the derivative output using a running average filter and normalizes it using a minimum filter to prevent rapid fluctuations.
Definition at line 26 of file DerivativeFilter.h.
| DerivativeFilter | ( | ) |
Constructs a DerivativeFilter instance with default configurations.
Definition at line 3 of file DerivativeFilter.cpp.
Filters the derivative of the input value and normalizes the output.
| value | The current input value. |
Definition at line 9 of file DerivativeFilter.cpp.
References Mathematics::Constrain(), MinFilter< memory >::Filter(), RunningAverageFilter< memory >::Filter(), minFilter, output, outputValue, and previousReading.
Referenced by MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
| float GetOutput | ( | ) |
Retrieves the current filtered derivative output.
Definition at line 5 of file DerivativeFilter.cpp.
References outputValue.
|
private |
Minimum filter for baseline normalization.
Definition at line 29 of file DerivativeFilter.h.
Referenced by Filter().
|
private |
Running average filter for smoothing the derivative output.
Definition at line 28 of file DerivativeFilter.h.
Referenced by Filter().
|
private |
Stores the most recent filtered derivative value.
Definition at line 31 of file DerivativeFilter.h.
Referenced by Filter(), and GetOutput().
|
private |
Stores the previous input value for calculating the rate of change.
Definition at line 30 of file DerivativeFilter.h.
Referenced by Filter().