Algorithm for FIR filters

Discussion in 'Embedded Systems and Microcontrollers' started by atferrari, Jan 22, 2011.

  1. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    18F family - Assembler.

    I intend to program a micro to filter (FIR) a noisy audio signal. Prior starting to code I would like to be sure I got it right, thus my questions:

    1) Basis this sequence, am I right if I implement this:?

    V0 = Vin0 * h0
    Output V0 to DAC
    Wait delay time

    V1 = (Vin1 * h1) + V0
    Output V1 to DAC
    Wait delay time

    V2 = (Vin2 * h2) + V1
    Output V2 to DAC
    Wait delay time

    VN-2 = (VinN-2 * hN-2) + VN-3
    Output VN-2 to DAC
    Wait delay time

    VN-1 = (VinN-1 * hN-1) + VN-2
    Output VN-1 to DAC
    Wait delay time

    V0 = Vin0 * h0 (??)
    Output V0 to DAC
    Wait delay time
    2) When repeating the sequence with the following set of samples, is VN-1 from the old one, added to V0 of the new set?

    3) If I process the signal off-line and do the output to the DAC module at a later time I will be using the same delay used for sampling, right?
    The only way to go is using high priority interrupts to ensure a steady pace. Do you agree?

    4) I have no access to MATLAB nor the so called "clones" which I do not plan to install for now. Any suggestion for a free software that I could use to calculate coefficients, maybe online?

    5) Not now but in the future I expect the signal to be also affected by echoes of itself? What type of filter should I consider?

    6) Have read on the necessity of an analog antialising filter previous to the ADC. Any comments?

    Absolutely new to all this. Gracias for any help
    Last edited: Jan 23, 2011
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    VHDL Source for FIR Filter

    Well commented, 32 tap filter.

    For your other question: Offline processing/filtering is done a byte or few at a time, and as some signals cannot be processed realtime, the results are saved at the bitrate they were read once processing is complete.
  3. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    My algorithm was completely wrong.

    The solution is to read about convolution.

    Doubt solved.
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    I have had a lot of luck using averaging as filtering technique.