Hello.
The first thing I found in your description was that convertig G as a
weighting factor to fixed point is wrong. Your conversion by using the
scheme
fixed = float /0x0100000 *0x7FFFFFFF
would result for G*value in
(fixed)G*value = (float)G * (float)value /0x100000^2 *0x7FFFFFFF^2.
That's where your multiplication error comes from.
I have a question concerning your task: why fixed point? Do you have
to port the task on a fixed point CPU? If so, there are floating point
libraries for some fixed point processors available in the internet. I
know of projects using open libraries for the PIC processors. But be
careful, these are using a large amount of programming memory. The
other way could be to develop your own floating point format, either
by using the float-format with exponent and mantissa or by putting a
virtual comma into your 32Bit-word. The bits left from the comma are
the integer part of your number, the right hand part is the fraction.
There are a lot of methods to be found describing this.
Hope this helps.
--------------
Heiko Marx
DSP Engineer
www.sinusmess.de