Giter VIP home page Giter VIP logo

fir-filter's Introduction

FIR Filter

finite impulse response (FIR) digital filter for microcontroller

Library files

Concept block

alt text

alt text

Code usage

/* Include library */
#include "fir.h"

/* Filter objects */
movingAverage_t fir_ftr;
movingAverage_t fir_ftr_2;

/* co-eff value calculated from Iowa Hills FIR Filters tool */

float low_pass_coeff[] = {

 0.033037850144342927,
 0.115593443353483427,
 0.195352709288829529,
 0.244281564490212016,
 0.244281564490212016,
 0.195352709288829529,
 0.115593443353483427,
 0.033037850144342927

};


float high_pass_coeff[] = {

 0.020062112266054671,
 0.039940619065501934,
 0.053593365042411495,
 0.053416852363487331,
 0.031286041832566183,
-0.023735038477653174,
-0.142727313632826841,
-0.612151054466002487,
 0.612151054466002487,
 0.142727313632826841,
 0.023735038477653174,
-0.031286041832566183,
-0.053416852363487331,
-0.053593365042411495,
-0.039940619065501934,
-0.020062112266054671

};

void main()
{
   /* Initialization of filters */
   fir_create(&fir_ftr, low_pass_coeff, 8, 1.176, 100);    /* filter size 8, sample time 100ms */
   fir_create(&fir_ftr_2, high_pass_coeff, 16, 1, 150);    /* filter size 16, sample time 150ms */

   while(1)
   {
      signal = signal_source();  /* signal source function may ADC, Capture count, sensor data*/

      /* Filter process
      * 
      * call this function maximum passible short time
      */
      fir_filter(&fir_ftr, signal);
      fir_filter(&fir_ftr_2, signal);

      process_or_print = fir_ftr.filtered;
      process_or_print = fir_ftr_2.filtered;
   }
}

Filter images

  • channel 0 - signal + noise (+/- 50)
  • channel 1 - filter output

32 Tab filter 500Hz

  • Sampling frequency - 500hz
  • cutoff frequency - 5hz

alt text

Zoom

alt text

Iowa Hills FIR Filters tool configuration

alt text

32 Tab filter 100Hz

  • Sampling frequency - 100hz
  • cutoff frequency - 5hz

alt text

Iowa Hills FIR Filters tool configuration

alt text

16 Tab filter 500Hz

  • Sampling frequency - 500hz
  • cutoff frequency - 5hz

alt text

Iowa Hills FIR Filters tool configuration

alt text

Signed values

alt text

Thanks to Iowa Hills FIR Filters tool Download

Refer other filters

fir-filter's People

Contributors

binarymaker avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

fir-filter's Issues

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.