《数字信号处理a(双语)补充课件lectu.ppt》由会员分享,可在线阅读,更多相关《数字信号处理a(双语)补充课件lectu.ppt(45页珍藏版)》请在三一办公上搜索。
1、Chapter 12,Analysis of Finite Wordlength Effects,Introduction,Ideally,the system parameters along with the signal variables have infinite precision taking any value between-and In practice,they can take only discrete values within a specified range since the registers of the digital machine where th
2、ey are stored are of finite lengthThe discretization process results in nonlinear difference equations characterizing the discrete-time systems,Introduction,These nonlinear equations,in principle,are almost impossible to analyze and deal with exactlyHowever,if the quantization amounts are small comp
3、ared to the values of signal variables and filter parameters,a simpler approximate theory based on a statistical model can be applied,Introduction,Using the statistical model,it is possible to derive the effects of discretization and develop results that can be verified experimentallySources of erro
4、rs-(1)A/D conversion(2)Filter coefficient quantization(3)Quantization of arithmetic operations,Introduction,A/D Conversion Error-generated by the filter input quantization processIf the input sequence xn has been obtained by sampling an analog signal xa(t),then the actual input to the digital filter
5、 is,where en is the A/D conversion error,Introduction,Filter coefficient quantizationConsider the first-order IIR digital filter yn=yn-1+xnwhere yn is the output signal and xn is the input signal,Introduction,The desired transfer function is,which may be much different from the desired transfer func
6、tion H(z),The actual transfer function implemented is,Introduction,Thus,the actual frequency response may be quite different from the desired frequency responseCoefficient quantization problem is similar to the sensitivity problem encountered in analog filter implementation,Introduction,Arithmetic Q
7、uantization Error-For the first-order digital filter,the desired output of the multiplier is,where en is the product roundoff error,Due to product quantization,the actual output of the multiplier of the implemented filter is,Two basic types of binary representations of data:(1)Fixed-point,(2)Floatin
8、g-point formatsArithmetic operations involving the binary dataFinite wordlength limitations of the registers storing the data and the results of arithmetic operations,12.1Quantization Process and Error,For example in fixed-point arithmetic,product of two b-bit numbers is 2b bits long,which has to be
9、 quantized to b bits to fit the prescribed wordlength of the registersIn fixed-point arithmetic,addition operation can result in a sum exceeding the register wordlength,causing an overflowIn floating-point arithmetic,there is no overflow,but results of both addition and multiplication may have to be
10、 quantized,12.1Quantization Process and Error,定点数的表示分为三种(原码、反码、补码):设有一个(b+1)位码定点数:0 1 2 b,则 原码表示为 例:1.111-0.875,0.0100.25,反码表示:(正数同原码,负数则将原码中的尾数按位求反)例:-0.875 1.000,0.25 0.010,补码表示(正数同原码,负数则将原码中的尾数求反加1)例:-0.875 1.001,0.25 0.010,12.1Quantization Process and Error,Analysis of various quantization effec
11、ts on the performance of a digital filter depends on(1)Data format(fixed-or floating-point),(2)Type of representation numbers(3)Type of quantization,and(4)Digital filter structure implementing the transfer function,Since the number of all possible combinations of the type of arithmetic,type of quant
12、ization method,and digital filter structure is very large,quantization effects in some selected practical cases are discussedAnalysis presented can be extended easily to other cases,12.1Quantization Process and Error,In DSP applications,it is a common practice to represent the data either as a fixed
13、-point fraction or as a floating-point binary number with the mantissa as a binary fractionAssume the available word length is(b+1)bits with the most significant bit(MSB)representing the signConsider the data to be a(b+1)-bit fixed-point fraction,12.1Quantization Process and Error,Representation of
14、a general(b+1)-bit fixed-point fraction is shown below,Smallest positive number that can be represented in this format will have a least significant bit(LSB)of 1 with remaining bits being all 0s,12.1Quantization Process and Error,Decimal equivalent of smallest positive number is=2-bNumbers represent
15、ed with(b+1)bits are thus quantized in steps of 2-b,called quantization stepAn original data x is converted into a(b+1)-bit fraction Q(x)either by truncation or rounding,12.1Quantization Process and Error,The quantization process for truncation or rounding can be modeled as shown below,12.1Quantizat
16、ion Process and Error,t xT-x=Q(x)-x,Since representation of a positive binary fraction is the same independent of format being used to represent the negative binary fraction,effect of quantization of a positive fraction remains unchangedThe effect of quantization on negative fractions is different f
17、or the three different representations,12.1Quantization Process and Error,12.2 Quantization of Fixed-Point Numbers,Truncation of a(b+1)-bit fixed-point number to(b+1)bits is achieved by simply discarding the least significant bits as shown below,12.2 Quantization of Fixed-Point Numbers,21,-t 0,1、Tru
18、ncation,结论:补码的截尾误差均是负值,原码、反码的截尾误差取决于数的正负,正数时为负,负数时为正。,-t 0,0 t,(=2-b),12.2 Quantization of Fixed-Point Numbers,2.Rounding,-/2 t/2,舍入处理的误差比截尾处理的误差小,所以对信号进行量化时多用舍入处理。,结论:原码,反码,补码的舍入误差均是:,12.5 A/D Conversion Noise Analysis,若编码采用的字长为(b+1)位补码,1指符号位量化误差e(n)为:量化的最小误差为:,上式给出了量化误差的范围,要精确知道误差的大小很困难。一般,我们总是通过分
19、析量化噪声的统计特性来描述量化误差。可以用一统计模型来表示A/D的量化过程。,舍入,截尾,12.5 A/D Conversion Noise Analysis,Now,the input-output characteristic of an A/D converter is nonlinear,and the analog input signal is not known a priori in most casesIt is thus reasonable to assume for analysis purposes that the error en is a random sign
20、al with a statistical model as shown below,12.5 A/D Conversion Noise Analysis,For simplified analysis,the following assumptions are made:(1)The error sequence en is a sample sequence of a wide-sense stationary(WSS)white noise process,with each sample en being uniformly distributed over the range of
21、the quantization error(2)The error sequence is uncorrelated with its corresponding input sequence xn(3)The input sequence is a sample sequence of a stationary random process,12.5 A/D Conversion Noise Analysis,These assumptions hold in most practical situations for input signals whose samples are lar
22、ge and change in amplitude very rapidly in time relative to the quantization step in a somewhat random fashionThese assumptions have also been verified experimentally and by computer simulations,12.5 A/D Conversion Noise Analysis,Mean and variance of the error sample en:Rounding-,Twos-complement tru
23、ncation-,12.5 A/D Conversion Noise Analysis,Mean and variance of the error For Rounding Error:,For Truncation Error:可见,量化噪声的方差与A/D变换的字长直接有关,字长越长,量化噪声越小。,12.8 Signal-to-Quantization Noise Ratio,The effect of the additive quantization noise en on the input signal xn is given by the signal-to-quantizat
24、ion noise ratio given by,where x2 is the input signal variance representing the signal power and e2 is the noise variance representing the quantization noise power,12.8 Signal-to-Quantization Noise Ratio,This expression can be used to determine the minimum word length of an A/D converter needed to m
25、eet a specified SNRA/DNote:SNRA/D increases by 6 dB for each bit added to the word length,Therefore,12.8 Signal-to-Quantization Noise Ratio,For a given word length,the actual SNR depends on x,the rms value of the input signal amplitude and the full-scale range RFS of the A/D converterExample-Determi
26、ne the SNR in the digital equivalent of an analog sample xn with a zero-mean Gaussian distribution using a(b+1)-bit A/D converter having RFS=Kx,12.8 Signal-to-Quantization Noise Ratio,Here,Computed values of the SNR for various values of K are as given below:,12.5.4 Propagation of input Quantization
27、 Noise to Digital Filter Output,To determine the propagation of input quantization noise to the digital filter output,we assume that the digital filter is implemented using infinite precisionIn practice,the quantization of arithmetic operations generates errors inside the digital filter structure,wh
28、ich also propagate to the output and appear as noise,12.5.4 Propagation of input Quantization Noise to Digital Filter Output,The internal noise sources are assumed to be independent of the input quantization noise and their effects can be analyzed separately and added to that due to the input noiseM
29、odel for the analysis of input quantization noise:,Because of the linearity property of the digital filter and the assumption that xn and en are uncorrelated,the output n of the LTI system can thus expressed as n=yn+vnwhere yn is the output generated by the unquantized input xn and vn is the output
30、generated by the error sequence en,12.5.4 Propagation of input Quantization Noise to Digital Filter Output,ThereforeThe mean of the output noise vn is given by,12.5.4 Propagation of input Quantization Noise to Digital Filter Output,and its variance v is given byBecause the error sequence is white pr
31、ocessTherefore,12.5.4 Propagation of input Quantization Noise to Digital Filter Output,From Parseval theorem:We can use Residue to solve RHS above,12.5.4 Propagation of input Quantization Noise to Digital Filter Output,12.5.4 Propagation of input Quantization Noise to Digital Filter Output,结论:极点将放大输
32、入噪声 零点将缩小输入噪声,12.4 Analysis of Coefficient Quantization Effects,The transfer function of the digital filter implemented with quantized coefficients is different from the desired transfer function H(z),Main effect of coefficient quantization is to move the poles and zeros to different locations from
33、the original desired locations,12.4 Analysis of Coefficient Quantization Effects,The actual frequency response is thus different from the desired frequency response H(ej),In some cases,the poles may move outside the unit circle causing the implemented digital filter to become unstable even though th
34、e original transfer function H(z)is stable,12.6 Analysis of Arithmetic Round-off Errors,42,DF的定点制实现中,每一次乘法运算之后都要作一次舍入(截尾)处理,因此引入了非线性,采用统计分析的方法,将舍入误差作为独立噪声e(n)迭加在信号上,因而仍可用线性流图表示定点相乘。,定点相乘运算统计分析的流图表示,12.6 Analysis of Arithmetic Round-off Errors,以一阶IIR滤波器为例,其输入与输出关系可用差分方程表示为:乘积项将引入一个舍入噪声,如图上述一阶系统的单位脉冲响应为 h(n)=nu(n)系统函数为 由于 是迭加在输入端的,故由 造成的输出误差为:,12.6 Analysis of Arithmetic Round-off Errors,图 一阶IIR滤波器的舍入噪声,12.6 Analysis of Arithmetic Round-off Errors,45,输出噪声方差 或 由上两式均可求得 可见字长 越大,输出噪声越小,同样的方法可分析其它高阶DF的输出噪声。,