Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Definition or difference between fixed-point DSP and floating-point DSP
Definition or difference between fixed-point DSP and floating-point DSP
1. Macroscopically, the dynamic range of floating-point dsp is much larger than that of fixed-point dsp. In fixed-point operations, programmers must always pay attention to overflow. In order to prevent overflow, they must be constantly moved, scaled or truncated.

The former consumes a lot of time and space, while the latter brings the loss of accuracy. On the contrary, floating-point dsp greatly reduces the scaling, shifting and overflow checking, expands the dynamic range, improves the accuracy and saves the operation time and storage space.

Fixed-point calculation just treats a data as an integer. Usually AD samples all integers, and this number has a scale factor relative to the real analog signal. As we all know, if a signal is sampled from 0 to 5V with a 16 bit AD, then the integer output by the AD divided by 2 16 and multiplied by 5V is the corresponding voltage.

In the fixed-point DSP, this sampling of 16 bits is directly processed, and it is not converted into a voltage expressed in decimal, because the fixed-point DSP cannot express a decimal with enough precision, and it can only calculate an integer.

The advantage of floating-point DSP is that it can convert the sampled integer into decimal voltage without losing accuracy (this decimal is expressed by scientific notation), because scientific notation can represent a signal with a large dynamic range.

2. Hardware: Aside from these macro features for the time being, from a purely technical point of view, the difference between fixed-point and floating-point is mainly in two aspects, namely hardware and software.

The difference in hardware comes from the fact that the floating-point dsp processor has a floating-point/integer multiplier, an integer/floating-point arithmetic logic operation unit ALU, and a register suitable for storing extended precision floating-point results.

3. Software: Look at the differences in software development, mainly including the characteristics and precautions of floating-point dsp programming; Scaling, shifting and overflow detection when fixed-point dsp performs floating-point operations.

When comparing two floating-point numbers, never use the operator = = to determine whether they are equal. Even if two identical numbers are compared, there may still be slight rounding differences.

Even the precise definition of 0 is not very safe. Although there is a representation of 0 in C language, never write such a code (x==0), but write it as (fabs (x)).

Extended data:

Most signal chain processing is performed in standard decoders, such as MPEG-2, MPEG-4, JPEG-2000 and H.264 These algorithms are designed to be executed by fixed-point operations. Floating-point operations with higher precision and wider dynamic range are not only useless, but also unusable, because these algorithms are usually only accurate in place.

For example, the frequency domain transform used in video codec is actually some form of DCT transform (discrete cosine transform). On the surface, floating-point operation seems to be more suitable for DCT calculation, just like FFT calculation.

Floating-point operations can indeed produce more accurate DCT. Unfortunately, DCT in video codec is designed on a fixed-point processor, and it is only accurate to bits, so it is completely wrong to pursue higher accuracy here.

What's more, most of the workload of video coding and decoding is used for control codes, and floating-point coding is not needed. For example, the entropy encoder used in video coding and decoding accounts for a large part of the whole workload (especially the CABAC encoder used in H.264 algorithm).

According to the fact that Blackfin processor has specially designed instructions to accelerate the performance of video algorithm, the two processors considered here can obviously make the right choice.

In contrast, the SHARC processor has no special video instructions. In addition, power consumption is crucial to the mobile market, which hardly includes floating-point processors. These make the choice easy.

The rest of the application examples need us to do more in-depth analysis in order to make the correct processor selection.

References:

Baidu encyclopedia -DSP technology