Digital Signal Processing Reference
In-Depth Information
Tabelle 16-5 Zahlendarstellung IEEE 754-1985 (normalisiert)
Theoretisch 1
Single Precision
Double Precision
Größte positive
Maschinenzahl
Kleinste (normalisierte)
Maschinenzahl > 0
Kleinste (normalisierte)
Maschinenzahl 2 > 1
Dynamik
Präzision 3
1 Wortlänge des Exponenten w e und Wortlänge der Matisse w M
2 Maschinen-Epsilon
3 Maximaler Quantisierungsfehler bei Runden aufgrund der Wortlängenbeschränkung der
Mantisse (aussteuerungsunabhängig, beachte Exponent)
A16.6
Machen Sie sich mit dem Programmbeispiel 16-2 zur Simulation einer Quantisie-
rung im Zweierkompliment-Format vertraut.
Programmbeispiel 16-2 Quantisierung im Zweierkomplement-Format
% Tow's complement quantizer with range [-1,1[ (saturation)
% function [xq] = quant2c(x,w,TMode)
% x : input signal
% w : word length (# of bits)
% TMode : truncation mode
% 't' - truncation (rounding towards minus infinity)
% 'r' - rounding to nearest quantization level
% xq : quantized signal
% quant2c.m * mw * 06/13/2008
function [xq] = quant2c(x,w,TMode)
LSB = 2^(-w+1);
% least significant bit
xq = min(1-LSB,x);
% clipping (saturation)
xq = max(-1,xq);
% Quantizer
if TMode == 't'
xq = floor(xq/LSB)*LSB;
else
xq = round(xq/LSB)*LSB;
end
Search WWH ::




Custom Search