DSPRelated.com
Forums

FIXED POINT TO FLOATING POINT

Started by mukeshp11 April 17, 2010
Dear All,

I am currently using fixed point DSP F2810.

Now what advantage i will get if i get shifted to floating point.

I mean i use IQ math library in fixed pt. DSP so virtually its floating
point DSP.

So is there any diffrence or there will be speed difference as there will
be no conversion of IQ math is required in floating point DSP. so more
speed.

I guess if i use IQ math library in fixed pt. DSP the accuracy will be
almost same as floating point.

Pls.
Comment.

Rgds
Mukesh


mukeshp11 wrote:
> Dear All, > > I am currently using fixed point DSP F2810. > > Now what advantage i will get if i get shifted to floating point.
Mostly you'll be able to think less about the range of the individual variables; with floating point you'll retain what precision you have for almost any reasonable value.
> I mean i use IQ math library in fixed pt. DSP so virtually its floating > point DSP.
On the contrary, it is fixed point. 1e-6 in 1r31 fixed-point only has 12 bits of precision left to distinguish it from its neighbor. 1e-6 in IEEE 32-bit floating point has 25.
> So is there any diffrence or there will be speed difference as there will > be no conversion of IQ math is required in floating point DSP. so more > speed.
Depending on the problem, you may never need to convert. Speed differences depend on the processor. Two processors, each offering a single-cycle MAC at the same clock rate, are going to be about the same speed. But implementing a single-cycle floating point MAC takes a lot more hardware than doing the same thing with fixed-point. So -- all else being equal -- you can expect the floating point processor to be bigger, more costly, and more power-hungry.
> I guess if i use IQ math library in fixed pt. DSP the accuracy will be > almost same as floating point.
Floating point representation takes bits away from the mantissa for the exponent, reducing the precision available in the number in return for a gain in range. For IEEE 32-bit floating point you end up with 24 bits of storage for the mantissa, with an implied leading 1, giving you 25 bits of effective precision. If you use 32-bit fixed point vs. 32-bit floating point and design well, for most DSP problems the accuracy will be better with fixed point, because you're not using up 7 bits worth of precision for the exponent. For many of the closed-loop control systems I design, 32 bits of precision is perfectly adequate, yet 25 is not -- so I either have to allow a tremendous speed hit by going to 64-bit floating point or I have to use 32 bit fixed point. Fixed point often wins, unless the control loop is a slow and/or minor part of the system and as such doesn't get a chance to drive cost. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
mukeshp11 <mukeshkumar.chaudhary@n_o_s_p_a_m.cgl.co.in> wrote:
 
> I am currently using fixed point DSP F2810.
> Now what advantage i will get if i get shifted to floating point.
> I mean i use IQ math library in fixed pt. DSP so virtually its floating > point DSP.
> So is there any diffrence or there will be speed difference as there will > be no conversion of IQ math is required in floating point DSP. so more > speed.
I believe that most DSP algorithms are best implemented in fixed point. In some cases, keeping more bits for intermediate values then needed for the result is useful. Much of the time, you will need fewer extra bits than you would for an exponent in a floating point value.
> I guess if i use IQ math library in fixed pt. DSP the accuracy will be > almost same as floating point.
-- glen
>mukeshp11 <mukeshkumar.chaudhary@n_o_s_p_a_m.cgl.co.in> wrote: > >> I am currently using fixed point DSP F2810. > >> Now what advantage i will get if i get shifted to floating point. > >> I mean i use IQ math library in fixed pt. DSP so virtually its floating >> point DSP. > >> So is there any diffrence or there will be speed difference as there
will
>> be no conversion of IQ math is required in floating point DSP. so more >> speed. > >I believe that most DSP algorithms are best implemented in fixed point. >In some cases, keeping more bits for intermediate values then needed >for the result is useful. Much of the time, you will need fewer >extra bits than you would for an exponent in a floating point value.
Some things only work in fixed point. Various sliding algorithms only work if you extract from one end of the window exactly what you injected into the other. In general, floating pointing arithmetic causes these algorithms to drift off.
>> I guess if i use IQ math library in fixed pt. DSP the accuracy will be >> almost same as floating point.
Steve
glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote in news:hqdko4$3dh$4
@naig.caltech.edu:

> mukeshp11 <mukeshkumar.chaudhary@n_o_s_p_a_m.cgl.co.in> wrote: > >> I am currently using fixed point DSP F2810. > >> Now what advantage i will get if i get shifted to floating point. > >> I mean i use IQ math library in fixed pt. DSP so virtually its floating >> point DSP. > >> So is there any diffrence or there will be speed difference as there
will
>> be no conversion of IQ math is required in floating point DSP. so more >> speed. > > I believe that most DSP algorithms are best implemented in fixed point. > In some cases, keeping more bits for intermediate values then needed > for the result is useful. Much of the time, you will need fewer > extra bits than you would for an exponent in a floating point value. > >> I guess if i use IQ math library in fixed pt. DSP the accuracy will be >> almost same as floating point. > > -- glen
Some algorithms are much easier in floating point. For example FFTs allow you to avoid scaling between butterflys. In general with fixed you gain precision, in float, dynamic range. I probably split 50 - 50. Floating point DSPs usually are also fixed point processors with similar computation speed. For example SHARC is 32 fixed and 32/40 bit float. Both types do a SISD MAC in 1 instruction. You choose whatever makes sense for the situation. Floating emulation wth a fixed pont DSP is usually very computationally expensive. Often fixed point DSPs are limited to 16 bit precision. This means that you are likely to need double precision (from a 16 bit word perspective). This may also be true with the 24 bit 56K stuff. Double precision increases computation requirements by 4x. Floating point DSPs usually consume much more power, however ADI's latest SHARC, the ADSP-21478 or ADSP-21479 are interesting exceptions. Al Clark www.danvillesignal.com
Al Clark wrote:
> glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote in news:hqdko4$3dh$4 > @naig.caltech.edu: > >> mukeshp11 <mukeshkumar.chaudhary@n_o_s_p_a_m.cgl.co.in> wrote: >> >>> I am currently using fixed point DSP F2810. >> >>> Now what advantage i will get if i get shifted to floating point. >> >>> I mean i use IQ math library in fixed pt. DSP so virtually its floating >>> point DSP. >> >>> So is there any diffrence or there will be speed difference as there > will >>> be no conversion of IQ math is required in floating point DSP. so more >>> speed. >> I believe that most DSP algorithms are best implemented in fixed point. >> In some cases, keeping more bits for intermediate values then needed >> for the result is useful. Much of the time, you will need fewer >> extra bits than you would for an exponent in a floating point value. >> >>> I guess if i use IQ math library in fixed pt. DSP the accuracy will be >>> almost same as floating point. >> -- glen > > Some algorithms are much easier in floating point. For example FFTs allow > you to avoid scaling between butterflys.
Something like a Kalman filter would also be possible in fixed point, but far, far easier to implement using floating.
> In general with fixed you gain precision, in float, dynamic range. > I probably split 50 - 50. > > Floating point DSPs usually are also fixed point processors with similar > computation speed. For example SHARC is 32 fixed and 32/40 bit float. Both > types do a SISD MAC in 1 instruction. You choose whatever makes sense for > the situation. Floating emulation wth a fixed pont DSP is usually very > computationally expensive. > > Often fixed point DSPs are limited to 16 bit precision. This means that you > are likely to need double precision (from a 16 bit word perspective). This > may also be true with the 24 bit 56K stuff. Double precision increases > computation requirements by 4x.
If the problem is right you can go double precision in the data and single in the coefficients -- this only increases computation requirements by 2x, but pretty much assumes that you're coding in assembly.
> Floating point DSPs usually consume much more power, however ADI's latest > SHARC, the ADSP-21478 or ADSP-21479 are interesting exceptions. > > Al Clark > www.danvillesignal.com >
-- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
On Apr 17, 9:35&#4294967295;am, "mukeshp11"
<mukeshkumar.chaudhary@n_o_s_p_a_m.cgl.co.in> wrote:
> Dear All, > > I am currently using fixed point DSP F2810. > > Now what advantage i will get if i get shifted to floating point. > > I mean i use IQ math library in fixed pt. DSP so virtually its floating > point DSP. > > So is there any diffrence or there will be speed difference as there will > be no conversion of IQ math is required in floating point DSP. so more > speed. > > I guess if i use IQ math library in fixed pt. DSP the accuracy will be > almost same as floating point. > > Pls. > Comment. > > Rgds > Mukesh
Floating point reduces our software development by 1-2 man months, that is the time we would need to make sure our fixed point scaling was adequate for the entire range of inputs. With high volume productions the 1-2 months spent will be more than offset by the lower fixed point DSP costs, with low volume productions, the float is the way to go.
Al Clark <aclark@danvillesignal.com> wrote:
(snip, I wrote)
 
>> I believe that most DSP algorithms are best implemented in fixed point. >> In some cases, keeping more bits for intermediate values then needed >> for the result is useful. Much of the time, you will need fewer >> extra bits than you would for an exponent in a floating point value.
(snip)
> Some algorithms are much easier in floating point. For example > FFTs allow you to avoid scaling between butterflys.
Well, you can also avoid scaling by using a large enough fixed point type...
> In general with fixed you gain precision, in float, > dynamic range. I probably split 50 - 50.
> Floating point DSPs usually are also fixed point processors with similar > computation speed. For example SHARC is 32 fixed and 32/40 bit float. Both > types do a SISD MAC in 1 instruction. You choose whatever makes sense for > the situation. Floating emulation wth a fixed pont DSP is usually very > computationally expensive.
> Often fixed point DSPs are limited to 16 bit precision. This means that you > are likely to need double precision (from a 16 bit word perspective). This > may also be true with the 24 bit 56K stuff. Double precision increases > computation requirements by 4x.
Yes, but even worse if you only have 16 bits for floating point. Now, if you have 32 bits available, say for an FFT on 16 bit source, is 32 bit float better than 32 bit fixed?
> Floating point DSPs usually consume much more power, however ADI's latest > SHARC, the ADSP-21478 or ADSP-21479 are interesting exceptions.
-- glen
glen herrmannsfeldt  <gah@ugcs.caltech.edu> wrote:

>> Some algorithms are much easier in floating point. For example >> FFTs allow you to avoid scaling between butterflys.
>Well, you can also avoid scaling by using a large enough fixed >point type...
>> In general with fixed you gain precision, in float, >> dynamic range. I probably split 50 - 50.
One frequent (and interesting) (and often ignored) tradeoff is between doing fixed point in the log domain, or floating point. I have often seen designers doing lengthy implementation in a log domain without bothering to think whether floating point would do better. Steve

steveu wrote:


> Some things only work in fixed point. Various sliding algorithms only work > if you extract from one end of the window exactly what you injected into > the other. In general, floating pointing arithmetic causes these algorithms > to drift off.
Noise shaping in a floating point is tricky, and the quantization errors in floating point are not very trivial, as they are also floating point. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com