GithubHelp home page GithubHelp logo

adis300 / filter-c Goto Github PK

View Code? Open in Web Editor NEW
134.0 4.0 31.0 27 KB

Elegant Butterworth and Chebyshev filter implemented in C, with float/double precision support. Works well on many platforms. You can also use this package in C++ and bridge to many other languages for good performance.

License: MIT License

C 99.50% Makefile 0.50%
filter butterworth-filter signal-processing butterworth chebyshev chebyshev-filter

filter-c's Introduction

filter-c

Elegant Butterworth and Chebyshev filter implemented in C, with float/double precision support. Works well on many platforms. You can also use this package in C++ and bridge to many other languages for good performance.

Features

  • lowpass
  • highpass
  • bandpass
  • bandstop

This imlementation is based on algorithm from https://exstrom.com/journal/sigproc/dsigproc.html

Run example

make example
./example

Steps to use a filter

  1. Create a filter object using create_***_pass/stop(params...)

  2. Use filter to filter incoming numbers one by one. The output is a double or float that can be specified in header.

  3. After using the filter, release the filter using free_***_pass/stop(filter).

filter-c's People

Contributors

adis300 avatar rinoreyns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

filter-c's Issues

Cutoff frequency set directly

Hello, s/f as normalized frequency. When I set the sampling frequency to 250HZ according to the example, and set f to 3hz, I cannot get the ideal result using a simple sine wave test. I would like to ask how to conveniently set the cutoff frequency?

thanks

The high-pass filter oscillates.

After I use a 0.5Hz high-pass filter, small signals will turn into sawtooth waves. However, if I use a 10Hz low-pass filter, there is no problem.
I use arduino external ADC and use this filter
HPF:
BWHighPass* filter = create_bw_high_pass_filter(3, 400, 0.5);
Serial.println(bw_high_pass(filter,adcv[2]),6);
image

LPF:
BWLowPass* filter = create_bw_low_pass_filter(3, 400, 10);
Serial.println(bw_low_pass(filter,adcv[2]),6);
image

Chebyshev filter type?

Thanks for your work!
I wanted to know whether the Chebyshev bandpass filter implementation is type I or type II?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.