Skip to content

jeremy7710/LowpassFilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages