Floating point MCU vs. Fixed point MCU for filtering

Thread Starter

Dritech

Joined Sep 21, 2011
901
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.
 

Papabravo

Joined Feb 24, 2006
21,159
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.
 

NorthGuy

Joined Jun 28, 2014
611
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.
 

Papabravo

Joined Feb 24, 2006
21,159
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.
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.
 

dannyf

Joined Sep 13, 2015
2,197
Are there any advantages of using a fixed point MCU when designing FIR filgers?
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.
 
Top