Re: How do you keep track of what all the numbers mean?



Rune Allnor wrote:
Wilson wrote:
I am looking for suggestions on tricks people use to keep track of what
all the fixed-point data values mean in their system. By this, I mean
that if you develop a floating point representation of a system, how do
you line up the signals and other values when you go to a fixed point
(i.e. hardware) representation of the model?

I haven't done any fixed-point programming myself, but the impression
I get from people who do, is that the main issue is to avoid overflow
and underflow. I can only guess as to how they achieve this,
but I would suspect that scaling constants is a main part of it.

For example, if I have a floating point simulation of a FIR filter,
when I implement this in hardware, it is done with integer data paths
and integer coefficients. The integer data will have a certain number
of data bits, and the coefficients may have different numbers of data
bits. There will be an assumed scaling between the floating point
representation and the fixed point representation. Are there a
procedures that you would suggest for how to keep track of these two
realms so that a meaningful relationship is maintained?

As another example, at the input of an ADC, you may have an arrangement
where the peak input of the ADC in 1 Volt. Does it make sense to
somehow keep track of this voltage scaling as you go through your
digital signal processing (in fixed point) so that you can line-up
different representations of the system in a meaningful way?

It depends on the application. There key term is "calibrated systems".
A "calibrated" system is one where you are supposed to measure
a physical quantity. A good example is the sound dB meter, where
absolute physical sound pressure is the key output. In this application

you need to keep track of all conversion constants, scalings etc.
In practice, the instrument must be calibrated every now and then.

A CD player, on the other hand, only needs to replicate the waveform
of the sound that was once recorded. Absolute sound pressure is
of less concern; the user adjusts the reproduced sound intensity
with the Volume knob anyway.

This is important because when you implement the system in hardware,
you want to make sure that the filter cutoff, loop bandwidths, etc. are
maintained amongst the theoretical / floating-point / hardware models.

All these factors are independent of scale, provided you stay inside
the dynamic range of the fixed point system.

I have tried to do things like this in the past, by keeping track of
the resolution of an LSB (as a voltage) but never been completely happy
with the usefulness of the effort.

In general, I'd say that there *are* applications where calibration is
needed. However, they are relatively rare so by and large, the
generalist DSP practisioner does not need to consider calibration
issues.

Rune

Rune,

Thanks for your comments. The issues I have stuggled with in the
past are in systems which have a feedback loops (e.g. LMS equalizers,
PLLs, etc.) In an LMS equalizer, for example, the convergence speed
will depend upon the input signal power. So the stepsize of the LMS
algorithm that you arrive at in the floating point simulation will have
to somehow be related to the corresponding value in the fixed point
model. It's a little bit tricky to work through the different data and
coefficient scaling to ensure that the hardware stepsize matches the
floating point stepsize.

I know there are different ways to interpret the data values (e.g.
fractional format vs. integer format). What I am looking for is some
way to represent the fixed point numbers in a way that makes it easy to
account for these different scaling values.

It has always seemed to me that the numbers we used in DSP are, in some
applications, less meaningful without the associated units that go with
them.

So, in my LMS equalizer example, if my floating point equalizer input
has units of 'Volt' , but my fixed point equalizer input LSB
represents 1/1024 'Volt' then I know a data scaling relationship
between these two systems.

I am wondering if anyone has some suggestions for how to keep track of
the different data scales in systems like these.

Wilson

.



Relevant Pages

  • Re: How do you keep track of what all the numbers mean?
    ... that if you develop a floating point representation of a system, ... but I would suspect that scaling constants is a main part of it. ... There will be an assumed scaling between the floating point ... will depend upon the input signal power. ...
    (comp.dsp)
  • Re: Rounding of the double
    ... John von Neumann suggested that only fixed-point integers should be used because floating ... If you choose your representation as double, then you have to live with the consequences. ... you can never get precision in any computation on a computer than involves ... MVP Tips:http://www.flounder.com/mvp_tips.htm- Hide quoted text - ...
    (microsoft.public.vc.mfc)
  • Re: This calculation is just wrong / computer cant count!
    ... we have is the binary representation of the computer. ... your delusional system of mathematics, one based on a decimal arithmetic model, is ... "ignore" any aspect of floating point precision. ... "I do not wish to deal with the inherent inaccuracy of double precision floating point. ...
    (microsoft.public.vc.mfc)
  • Re: Gentler Decimal Floating-Point
    ... effectively change the radix of a decimal floating point ... under the heading "Logarithms all the time", ... logarithmic representation of numbers to be made workable for all the ... The middle digits are shifted only when the exponent, ...
    (comp.arch.arithmetic)
  • Re: WTF?
    ... The scaling factor that is part of the internal representation of a decimal number preserves the trailing zeroes. ... Using the .parse method has set the scaling factor for x2 to a different value than for x1, so the ToString processes them slightly differently, and their string representations are not equal.. ... dim x2 as decimal = decimal.parse) ...
    (microsoft.public.dotnet.languages.vb)