Re: [LAU] About Algorithms

From: Fons Adriaensen <fons@email-addr-hidden>
Date: Mon Jul 18 2011 - 17:56:04 EEST

On Mon, Jul 18, 2011 at 08:52:55PM +1000, Erik de Castro Lopo wrote:
 
> For instance in Secret Rabbit Code (my code), all data entering
> and leaving the converter plus the actual filter coefficients are
> stored as 32 bit floats. However, the inner loop which does the
> multiply accumulate (similar to what is done when mixing) does:
>
> double result = 0.0 ;
>
> for ( ..... )
> sum += coeff [k] * data [k] ;
>
> Specifically all the inputs are 32 bit floats, but all intermediate
> results are 64 bit.
  
In the case they would probably be even if the sum was declared
float - it's very likely that the intermediate result will be
stored in a FP register anyway. OTOH there are compiler options
that would force it to single precision even in that case.

Zita-resampler does this a little bit different: it calculates
the sum from the start and end of the filter (where the very small
coefficients are) and working towards the center.

Ciao,

-- 
FA
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Mon Jul 18 20:15:02 2011

This archive was generated by hypermail 2.1.8 : Mon Jul 18 2011 - 20:15:02 EEST