GitHunt
JE

jeremy7710/LowpassFilter

It's a simple low pass filter with a single input and a single output.

LowpassFilter

It's a simple low pass filter with a single input and a single output.
I also try second-order and third-order lowpass filter, but they seem the same.


I use the formula from wiki:
y_i = \alpha x_i + (1 - \alpha) y_{i-1} \qquad \text{where} \qquad \alpha \triangleq \frac{\Delta_T}{RC + \Delta_T}

So It look like:

double Yp;

public double firstOrder_lowpassFilter(double X, double beta)
{
    double Y;

    Y = beta * X + (1 - beta) * Yp;

    Yp = Y;

    return Y;
}

How to use?

1.You can just copy the method above.
2.Use .dll in library folder.
3.Download the project and add in to your project.

Example

You can open project in example folder.
It's a simple lowpass filter demo.
Just keep cliking "GO" button, and output will go closer to the input value you just enter.



Reference:

https://en.wikipedia.org/wiki/Low-pass_filter
https://en.wikipedia.org/wiki/Exponential_smoothing

Languages

C#100.0%

Contributors

Created October 16, 2017
Updated December 23, 2023
jeremy7710/LowpassFilter | GitHunt