Thursday, September 15, 2011

When you are dealing only with signed and unsigned integers to represent antenna transmission powers expressed in milliwatts and decibels and there are lot of logarithm and exponential function conversions in a signalling processor where floating operations are banned due to CPU cycle consumption (as per coding guidelines), life is difficult.

But then that's what programming on a dsp is all about - hard and challenging and dealing with only integers. tough stuff. Yesterday we are faced with a problem of calculating (y)^x when x can be = {2,4,8,16,20,40,80,160} and y = {0.000 ..... 0.9999}. Yes there is a 4 digit precision needed and you need to use only integers. But then we saw some code on the web and we could adapt that code.

It was interesting to say the least.

2 comments:

test123 said...

Did you use fixed point computation and if so curious to know what base you choose and why?
(Are there any other alternatives to fixed point?)

sudeep said...

floating point would not be a good alternative (that's what i was told) because we are dealing with a process which should finish on or before 4/3 = 1.333 milliseconds.

So yes, i had to google for fixed point computation. Got introduced to something called as Q-format, very recently but have to be very careful while dealing with those kind of numbers and need to keep the range of each and every variable..hard job, these days.

Sometimes we find it better to use base-10 and in some cases base 2 (while dealing with binary logarithms- It was proposed by the specification guys and I am still wondering why)

Also, there is an interesting numerical algorithm to find base10 by interpolation.

Also , I started dabbling with something called "cmockery" - a very good unit testing framework which was available as a part of googlecode... maybe you might know about it :-) simple and easy and sakkath aagi ide - for people who know next to nothing about ruby/python it is the ideal...since i do not know python (i would love to learn it...somehow, i am not finding an opportunity to write a program in py)