Technical discussions related to Speech Coding (all itu and other vocoders, ACELP, CELP, AMR, etc)
Post a new Thread
p++ in Fixed Point?? - aditya_naidu1 - Apr 27 2:25:00 2005
Hello all,
Thank You for help and useful tips.
Is there any special way for implementing variable increment in fixed
point such as p++;
for eg.
plc[i]+=(*p0)*a;
p++;
or this can be left as such?
because p++ is euqivalent to p=p+1.Shouldnt this cause a prob if 'p' is
in a different representation format(say Q2.13).
Thanks
Aditya

(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )
Re: p++ in Fixed Point?? - Arvind - Apr 27 9:14:00 2005
Assume p is x.y format. Then p++ is
p = p+ ((1<<y)-1)
if p saturates(max value of x.y reached), change Q-format of p to x+1.y-1 by scaling
down.
Enjoy
A
aditya_naidu1 <a...@pmail.ntu.edu.sg> wrote:
Hello all,
Thank You for help and useful
tips.
Is there any special way for implementing variable increment in fixed
point
such as p++;
for eg.
plc[i]+=(*p0)*a;
p++;
or this can be
left as such?
because p++ is euqivalent to p=p+1.Shouldnt this cause a prob if 'p' is
in a different representation format(say Q2.13).
Thanks
Aditya
NEW! You can now post a message or access and search the archives of this
group on DSPRelated.com:
http://www.dsprelated.com/groups/speechcoding/1.php
_____________________________________
/groups/speechcoding/1.php
To
Post: Send an email to s...@yahoogroups.com
Other DSP Related Groups:
http://www.dsprelated.com/groups.php
__________________________________________________

(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )
Re: p++ in Fixed Point?? - Steve Holle - Apr 27 10:32:00 2005
What would you increment by? I would suggest p += x with x being
your increment value.
At 12:25 AM 4/27/2005, aditya_naidu1 wrote:
>Hello all,
>
>Thank You for help and useful tips.
>Is there any special way for implementing variable increment in fixed
>point such as p++;
>
>for eg.
>
>plc[i]+=(*p0)*a;
>p++;
>
>or this can be left as such?
>because p++ is euqivalent to p=p+1.Shouldnt this cause a prob if 'p' is
>in a different representation format(say Q2.13).
>
>Thanks
>Aditya
Steve Holle
Link Communications, Inc.
1035 Cerise Rd.
Billings, MT 59101
sholle@shol...

(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )
Re: p++ in Fixed Point?? - Andrew Nesterov - Apr 27 20:22:00 2005
> Date: Wed, 27 Apr 2005 06:25:45 -0000
> From: "aditya_naidu1" <adityanaidu@adit...>
>
> Is there any special way for implementing variable increment in fixed
> point such as p++;
>
> for eg.
>
> plc[i]+=(*p0)*a;
> p++;
>
> or this can be left as such?
> because p++ is euqivalent to p=p+1.Shouldnt this cause a prob if 'p' is
> in a different representation format(say Q2.13).
As you said, p++ is equivalent to p = p + 1, where p and 1 are integers.
This means that if the variable represents a fixed point Q3.12 value,
p++ increments the LSB, which is equial to 2**(-13). If a 1.0 was to be
added to a Q2.13 value, the Q2.13's 1.0 has to be written as 0x2000
or 8192 decimal.
Regards,
Andrew

(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )