Hello! I'm trying to write a simple C filter code with less than unity coefficients. (I'm using CodeWarrior v5.5) I've initially declared all my constants and variables as float numbers, however, I found that floating point operations consumed so much more machine cycles than integer operations. What would be the best way to represent my coefficients in integer. I'm familiar with the Q notation used by Texas Instruments which is well supported by their Code Composer. However, I don't if CodeWarrior supports something like this. I don't have any problem doing Q operations in CodeWarrior since its only a matter of knowing where my decimal point is. But it would be quite tedious if I have to manually verify the value of each variable. Regards, Evan |
|
Q notation equivalent
Started by ●November 2, 2004
Reply by ●November 2, 20042004-11-02
Hello Evan The Motorola Motor Control Library makes extensive use of fixed point fractional numbers which use a 16 bit integer variables to represent values between -1 and +1. The 56F83xx chips support assembler codes for multiplying these, so it makes for the same efficiency as plain integers (at least as far as my understanding of this goes). You can read about it in the DSP56800E Core Reference manual: http://www.freescale.com/files/dsp/doc/ref_manual/DSP56800ERM.pdf Good Luck! Robert On 02.11.2004, at 07:01, emespina wrote: > > > Hello! > > I'm trying to write a simple C filter code with less than unity > coefficients. (I'm using CodeWarrior v5.5) > > I've initially declared all my constants and variables as float > numbers, however, I found that floating point operations consumed so > much more machine cycles than integer operations. > > What would be the best way to represent my coefficients in integer. > I'm familiar with the Q notation used by Texas Instruments which is > well supported by their Code Composer. However, I don't if > CodeWarrior supports something like this. I don't have any problem > doing Q operations in CodeWarrior since its only a matter of knowing > where my decimal point is. But it would be quite tedious if I have > to manually verify the value of each variable. > > Regards, > Evan > _____________________________________ > Note: If you do a simple "reply" with your email client, only the > author of this message will receive your answer. You need to do a > "reply all" if you want your answer to be distributed to the entire > group. > > _____________________________________ > About this discussion group: > > To Join: > > To Post: > > To Leave: > > Archives: http://www.yahoogroups.com/group/motoroladsp > > More Groups: http://www.dsprelated.com/groups.php3 > > Yahoo! Groups Links > > |