[sdiy] Best book /resource for fixed point math??

rsdio at sounds.wa.com rsdio at sounds.wa.com
Thu Sep 12 22:37:28 CEST 2013


What's fun (for me, at least) is that processors like the TMS320 have  
special options on most opcodes to handle these shift operations for  
fixed-point math. The programmer still has to architect everything  
for each specific system, but extra instructions are not necessary  
for most shift operations because they can be selected as part of the  
normal opcodes. This saves a lot of processor cycles and is one of  
many reasons why DSP chips are faster at certain types of processing  
than general-purpose chips.

Not to say that you can't do this on an AVR, but you'll have to  
handle the shifts with additional instructions. Also note that DSP  
chips usually have an oversized accumulator register, such as 40 bits  
for a 16-bit fixed-point DSP. That 40-bit accumulator can hold the  
result of a 16-bit product and still have 8 bits for overflow.  
Handling the same thing in an AVR will require working with a memory- 
based accumulator, and that requires multiple instructions for the  
same task that a DSP can handle in one instruction.

Anyway, if you're really excited about fixed-point math, I recommend  
one of the cheap TMS320 development platforms from Texas Instruments.  
Most even have stereo audio input and output and are $50 or less.

Brian Willoughby
Sound Consulting


On Sep 12, 2013, at 12:16, Veronica Merryfield wrote:
> In the early days of the TMS320, TI had a very good book ok working  
> with fixed point math since at that stage the TMS320 was mostly a  
> fixed point math DSP.
>
> Ti have maintained a lot of their older data books and app notes in  
> digital format as part of their website's educational section.
>
> Conceptually it is not that difficult - break a sized quantity into  
> a number of sections that have meaning, so perhaps a 32 bit word  
> would be 16 bit int and 16 bit fraction. I have used this kind of  
> method based on having a DAC to output data. Hook it up to the top  
> bits of a buss and then use the full data width to do all the work  
> with only the relevant data being outputted to the DAC.
>
> With limited CPU resources (say no FPU), doing things this was can  
> be quick but the int/fraction break down has to be architected for  
> the system correctly. Having down that, most of the math is pretty  
> simple based on those numbers of bits. The difficultly is moving  
> between number systems (putting an int into the format say), but  
> this can be done with shifts for variable data and constants can be  
> setup appropriately.
>
> As I recall, TI had a lot of interest DSP stuff done in fixed point  
> math (FFT, correlation etc) and although the code was for the  
> TMS320, they explained it well such that it could be implemented  
> for other devices.
>
> Veronica
>
>
> On 2013-09-12, at 7:56 AM, Dan Snazelle <subjectivity at hotmail.com>  
> wrote:
>> In a few different wavetable synth programs (for avr) that I have  
>> been studying, I keep finding references to  fixed point math
>>
>> Variables like
>>
>> Q16n16
>> Q0n31
>> Q1n15 etc
>> And functions for seperating the "fractional part" of a number, etc.
>>
>>
>> Im wondering which book , video, etc
>> Might be best for really coming to terms with understanding fixed  
>> point/floating point so that I can understand programs and so my  
>> own programs can improve.
>>
>> I know it would be useful as I have read that the AVR can use  the  
>> help with math it can get (just like me)
>>
>> Thanks!
>



More information about the Synth-diy mailing list