xcore / sc_dsp_filters

Code to perform standard DSP functions, such as Biquads, FIRs, sample rate conversion
http://github.xcore.com/sc_dsp_filters/
Other
20 stars 8 forks source link

Coding Conventions #3

Open lilltroll77 opened 13 years ago

lilltroll77 commented 13 years ago

From the community docs "Follow the Coding Conventions"

What is the convention in this module ?

Pure XC or ASM only !? , eg. not using inline asm in XC or XC mixed with C and stuff like that ?

What is the convention for sharing the coef. array with other threads (as updating the filters on the fly or using adaptive filters) avoiding the XC par. usage rule.

henkmuller commented 13 years ago

The coeff array should be shared with great care - since it should not be updated in the middle of the FIR (there lies chaos). So eventually there should be a proper update mechanism that, for example, provides a new array to this thread. As it is about making an "efficient as possible" FIR passing a pointer around over a channel is perfectly acceptable to me. In the meantime; whatever works for us.

About the Pure XC vs ASM, I think it would be good to keep a simple version in XC that is easily understood. The rest can mix, although once you want an inner loop to be really fast I find it easier understand the code if that part is pure assembly rather than a mix of asm and XC... If the final call is a clean function with a clean interface then that makes it all perfectly palatable: read the pure XC function to understand the intention, use the assembly version for speed.

lilltroll77 commented 13 years ago

OK, I start to meditate over biquadAsm.S Passing pointers over channels would solve timing issues i guess, specially IIR could become unstable if updating is performed in the middle, never recovering.