c - Complex division using Fixed Point -
i'm working on writing c programme perform partition of 2 complex numbers in fixed point. i'm not able fractional part it. below more details on it.
i have 2 complex numbers:
n = + ib m = c + jd
i need n/m
in fixed point (not using floating point)
example values above complex numbers can be:
a = 1.55, b = 1.44, c = 1.24, d = 0.55 n = 1.55 + i(1.44) m = 1.24 + j(0.55)
for converting fixed point, multiply these a, b, c , d 2^14
. after become:
a = 0x6333, b = 0x5c28, c = 0x4f5c , d = 0x2333
then perform n/m
operation do:
n/m = (a + ib)/(c + jd) = ((a + ib) * (c - jd)) / ((c + jd) * (c - jd))
then real part alone:
(ac + bd) / (c^2 + d^2)
and on..
the issue i'm facing i'm not understanding how fractional part division. i'm getting decimal part either 1 or 0.
what right way fractional part? in above example, real part should 1.47490. i'm able 1.
can please help me right way in doing complex partition fixed point?
thank much.
in fixed point partition , multiplication 1 must notice result value must have scaling factor k.
in add-on / subtraction: * k + b * k = k * ( + b) in multiplication: (a * k) * (b * k) = k^2 * (a * b) --> must compensate 1/k proper form: (ak * bk) / k in division: (a * k) / (b * k) = / b --> must pre-multiply k proper form: (ak * k) / (bk)
c division complex-numbers fixed-point
No comments:
Post a Comment