[time-nuts] Re: pulling some crystals
Jim Lux
jim at luxfamily.com
Sat Dec 30 19:09:16 UTC 2023
Generically, this is known as the Cordic method.Â
There are some techniques for managing the truncation error and magnitude that Detlef mentions, but I canât remember them off the top of my head. Iâm sure theyâre in the literature. The trick is in making them simple and deterministic in time.
On Fri, 29 Dec 2023 12:28:20 +0100, dschuecker via time-nuts <time-nuts at lists.febo.com> wrote:
Hi,
I generate Sin/Cos without a table by rotating complex numbers
(a+i*b)*(u+i*v)
a,b,u,v may be 16Bit integers, for most appplications this prooved
sufficient for me. a is the cos-component, b is the sine component.
(a+i*b) is rotated by the angle of (u+i*v). For integer calculation
|u+i*v| = sqrt(u*u+v*v) is normalized to ,say 2^16 and followed by a
rightshift of 16Bit. It is necessary to watch |a+i*b|=sqrt(a*a+b*b)
because vectorlength is shrinking or expanding due to calculation noise.
Cheers Detlef
_______________________________________________
> time-nuts mailing list -- time-nuts at lists.febo.com
> To unsubscribe send an email to time-nuts-leave at lists.febo.com
>
_______________________________________________
time-nuts mailing list -- time-nuts at lists.febo.com
To unsubscribe send an email to time-nuts-leave at lists.febo.com
Â
More information about the Time-nuts_lists.febo.com
mailing list