Thread: Cascade of Fir filters using c

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    1

    Cool Cascade of Fir filters using c

    Does anyone know how to implement the cascade of Fir Filters using c programming given filter coefficients generated by matlab. Any rough idea or sample code.

  2. #2
    Registered User
    Join Date
    Mar 2011
    Posts
    546
    the simple way: create an array of the length of the filter. put your samples in the array, oldest first to newest. multiply each element Sn in the array by the corresponding coefficient Cn to get the output for that iteration. then for the next sample, delete the oldest element by moving each element to the left by 1. then add the new sample at the end of the array. recompute etc.

    a more efficient way would be to use the array as a circular buffer : google 'circular buffer C'
    or use a linked list where you can delete from the front and add to the end.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Filters in C
    By banderas55 in forum C Programming
    Replies: 1
    Last Post: 01-16-2010, 08:28 AM
  2. Creating Filters ? Help Please
    By c0dex in forum C Programming
    Replies: 0
    Last Post: 11-22-2009, 09:01 AM
  3. Audio Filters
    By samGwilliam in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 07-08-2007, 01:41 PM
  4. Digital Filters
    By Shiro in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 01-19-2002, 01:18 PM

Tags for this Thread