Floating point MCU vs. Fixed point MCU for filtering

Discussion in 'Embedded Systems and Microcontrollers' started by Dritech, Feb 24, 2016.

  1. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Hi,

    Are there any advantages of using a fixed point MCU when designing FIR filgers?
    I saw many FIR designs being implemented on fixed point MCUs rather then floating point. Is there any particular reason?

    Thanks in advance.
     
  2. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    764
    Simpler maths?
     
  3. RamaD

    Active Member

    Dec 4, 2009
    254
    33
    Longer execution times and more memory with float?
     
  4. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    An ordinary processor without FPU was "good enough".
     
  5. Papabravo

    Expert

    Feb 24, 2006
    10,163
    1,796
    The tradeoff is that with floating point operations you have a large dynamic range, but you cannot perform as many operations per second. You can perform more fixed point operations per second, but you have to beware of overflow and underflow in your operations. Dedicated DSP processors have special hardware to help with these problems. For example if you add two positive fixed point numbers together in a normal processor, an overflow could produce a negative number. In a DSP, the overflow will produce the maximum positive number instead.
     
    Dritech likes this.
  6. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    The numbers you use in FIR filters have well-defined fixed range (e.g. 0 to 1023 coming from 10-bit from ADC). Floating point calculations only introduce a burden by keeping track of the scale when the scale is always the same anyway. Thus, fixed scale FIR is considerably faster.

    dsPIC33E with hardware DSP engine can calculate 3 million 16-tap FIR filters per second. You cannot easily match that with comparably priced MCU with FPU.
     
  7. Papabravo

    Expert

    Feb 24, 2006
    10,163
    1,796
    It is not so much the numbers themselves, but the result of successive MAC operations. Here is where you need to be mindful of the effects of underflow and overflow.
     
  8. dannyf

    Well-Known Member

    Sep 13, 2015
    1,828
    365
    More so on mcu's without a fpu -> most mcu's fall into that category.

    However, on mcu's with FPU (Cortex M4F for example), (single precision) floating point math can be done very quickly and the overhead with Q15/Q31 format may not be so desirable.
     
Loading...