Matlab Program For Uniform Quantization Encoding Video
Uniform quantization is not optimum, but is commonly used in practice. This type of quantization is basically a simple rounding process, in which each sample value is rounded to the nearest value from a finite set of possible quantization levels. We assume that the signal amplitude at the input of the quantizer ranges between the maximum value V 0 and the minimum value − V, and that the amplitude of the unquantized signal either below − V or above V is simply chopped off. The amplitude range − V, V is a limit set by the quantizer, not by the original signal produced by the analog source. The error introduced by this clipping is referred to as overload distortion or clipping distortion.
The amplitude range − V, V is divided into L quantization levels. The spacing between two adjacent quantization levels is called the step size Δ. In a uniform quantizer, the step size is the same between any two adjacent levels. The uniform quantizer has the simplest structure and its target level lies in the middle of the interval. With L as the number of the quantization levels, the step size of a uniform quantizer for a signal with an amplitude range of 2 V is thus given.
(5.11) Δ = 2 V LWithin the supported amplitude range, the spacing between the continuous-value and the discrete-value is referred to as its granularity. The error introduced by this spacing is referred to as quantization noise or granular distortion or rounding error. In the context of quantization, the terms of noise and distortion are usually used interchangeably. The quantization error is bounded in magnitude and has generally a saw-tooth shape, but overload distortion is unbounded. The quantization noise and overload distortion are functions of the particular quantization process and statistics of the input signal.
It is important to have the proper balance between the quantization noise and the overload distortion. For a given number of possible output values, reducing the average quantization noise may involve increasing the average overload distortion, and vice versa. Assuming that the input to the quantizer is zero mean and the quantizer is symmetric, the quantizer output and the quantization error will also have zero mean. For a uniform quantizer, the quantization error e is a random variable, which is bounded by − Δ 2 ≤ e ≤ Δ 2. With sufficiently small step size, the quantization error can be assumed to be uniformly distributed and uncorrelated with the quantizer input.
Using (5.12) and noting that the quantization error e is zero mean, its variance is the same as the average power and is thus given as follows. 10 log S N R o = 20 log V / 2 + 6 R − 20 log V + 4.77 = 1.8 + 6 R dB.We now set 1.8 + 6 R equal to 49.8, and thus obtain R = 8 bits.
By using (5.12), we then get L = 2 8 = 256 levels, and by using (5.11), we get Δ = 2 V 256 = V 128.The uniform quantizer yields the highest (optimal) SNR o at the output if the signal amplitude has a uniform distribution in the dynamic range − V, V. However, for a source that does not have a uniform distribution, the optimal quantizer may not be a uniform one.
The optimal quantization level in each quantization region must be chosen to be the centroid (conditional expected value) of that region. Since the optimal quantizer requires advance knowledge of both the signal statistics and changes in signal’s power level, they do not have many practical applications. For some analog signals, such as speech and music, the loading factor α is large, and, as reflected in (5.17), can significantly reduce the value of SNR o. To quantize such signals, it is advantageous to have nonuniform spacing, more specifically, smaller spacing near zero and larger spacing at the extremes. Assuming a signal with nonuniform distribution, for a given number of quantization levels, nonuniform quantizers can then outperform uniform quantizers. Example 8-1: ADC Requirements for IF Sampling ReceiverConsider a WiMAX IF sampling receiver operating at an IF frequency of 175 MHz. After analysis of this particular receiver, it was found that the required ADC SQNR is 35 dB with a maximum channel equivalent bandwidth of 26 MHz (for the 20-MHz occupied signal bandwidth case).
Assume that the PAR is 14 dB. What is the required effective number of bits for the ADC? Assume that any reasonable clock rate can be generated and that the modem designers expect normal spectral placing. Realistically, a filter with such narrow band at this IF frequency is very difficult to build. Furthermore, the effect of blockers, spurs, and other degradations may force the SQNR of the ADC to be higher than 35 dB. For the sake of comparison, repeat the example for a channel bandwidth (noise equivalent bandwidth) of 70 MHz.
Compare the results.The first step is to estimate the minimum sampling rate required at 175 MHz. First let's determine the range of n. J E Flood Professor, OBE, DSc, FInstP, CEng, FIEE, in, 1993 19.6.2 Adaptive delta modulationSimple DM is susceptible to slope overload. Moreover, since it provides uniform quantisation, the SQNR decreases when the level of the input signal is reduced. Several schemes of adaptive delta modulation (ADM) have been introduced to minimise these disadvantages by adapting the step size under changing signal conditions ( Steele, 1975; Peebles, 1976; Taub and Schilling, 1986).In a basic DM system, a rapidly changing input signal results in a long sequence of 1′s or 0′s being transmitted. In continuously variable slope delta modulation (CVSDM), the rate of change of the integrator output is increased if there is a sequence of several 1′s or 0′s.
Thus, the CVSDM coder can follow a rapidly changing signal more accurately (Taub and Schilling, 1976). Demler, in, 1991 Oversampling for Increased Effective ResolutionThe analyses of quantization noise effects that have been described up to this point have been based on the effective RMS voltage of the characteristic sawtooth error signal in the time domain. A uniform quantization step which is equivalent to the sawtooth amplitude is assumed for the ideal A/D. This results in a uniform probability distribution function for RMS noise versus input voltage. Similar assumptions are also used for the idealized model in the frequency domain, resulting in a constant power spectrum versus input frequency.The RMS power in the noise signal will be constant regardless of the sampling rate and Nyquist limits. This fact can be exploited in oversampling A/D converters. A brief review of some of the background concepts will aid in the explanation.
The analysis of A/D signal-to-noise ratio in Chapter 3 showed that the average power of the quantization noise is q 2/12. Due to the limits of sampling theory, in the frequency domain the spectrum is constrained to the frequencies between ± F s/2. This characteristic is represented in Figure 5-8. By definition, in an oversampling A/D the bandwidth of the input signal is constrained to be much less than the Nyquist limit. In such cases the quantization noise spectrum will extend beyond the spectrum of the input signal. The ramification of this is that the total quantization noise power in the bandwidth of interest is smaller; in fact, it will be inversely proportional to the oversampling ratio. Edmund Lai PhD, BEng, in, 2003 2.3.3 Non-uniform quantizationOne of the assumptions we have made in analyzing the quantization error is that the sampled signal amplitude is uniformly distributed over the full-scale range.
This assumption may not hold for certain applications. For instance, speech signals are known to have a wide dynamic range. Voiced speech (e.g. Vowel sounds) may have amplitudes that span the entire full-scale range, while softer unvoiced speech (e.g. Consonants such as fricatives) usually have much smaller amplitudes. In addition, an average person only speaks 60% of the time while she/he is talking. The remaining 40% are silence with negligible signal amplitude.If uniform quantization is used, the louder voiced sounds will be adequately represented.
3 Bit Quantization Matlab
However, the softer sounds will probably occupy only a small number of quantization levels with similar binary values. This means that we would not be able to distinguish between the softer sounds. As a result, the reconstructed analog speech from these digital samples will not nearly be as intelligible as the original. Μ-law compression characteristicsThe higher amplitudes of the input signal are compressed, effectively reducing the number of levels assigned to it. The lower amplitude signals are expanded (or non-uniformly amplified), effectively making it occupy a large number of quantization levels. After processing, an inverse operation is applied to the output signal (expanding it).
The system that expands the signal has an input-output relationship that is the inverse of the compressor. The expander expands the high amplitudes and compresses the low amplitudes. The whole process is called companding (COMpressing and exPANDING).Companding is widely used in public telephone systems. There are two distinct companding schemes. In Europe, A-law companding is used and in the United States, μ-law companding is used.μ-law compression characteristic is given by the formula. Garg, Yih-Chen Wang, in, 2005 2.8 Voice CommunicationFor most voice communication, very low speech volumes predominate; about 50% of the time, the voltage characterizing detected speech energy is less than 1/4 of the root-mean-square (rms) value.
Matlab Code For Pcm With Output
Large amplitude values are relatively rare; only 15% of the time does the voltage exceed the rms value. The quantization noise depends on the step size. When the steps are uniform in size, the quantization is called the uniform quantization. Such a system would be wasteful for speech signals; many of the quantizing steps would rarely be used.
In a system that uses equally spaced quantization levels, the quantization noise is same for all signal magnitudes. Thus, with uniform quantization, the signal-to-noise ratio (SNR) is worse for low-level signals than for high-level signals. Non uniform quantization can provide fine quantization of the weak signals and coarse quantization of the strong signals. Thus, in the case of nonuniform quantization, quantization noise can be made proportional to signal size.
Improving the overall SNR by reducing the noise for predominant weak signals, at the expense of an increase in noise, can be done for rarely occurring signals. The nonuniform quantization can be used to make the SNR a constant for all signals within the input range. For voice, the signal dynamic range is 40 dB. Nonuniform quantization is achieved by first distorting the original signal with logarithmic compression characteristics and then using a uniform quantizer. For small magnitude signals, the compression characteristics have a much steeper slope than the slope for large magnitude signals. Thus, a given signal change at small magnitudes will carry the uniform quantizer through more steps than the same change at large magnitudes. The compression characteristic effectively changes the distribution of the input signal magnitude so there is no preponderance of low-magnitude signals at the output of the compressor.
After compression, the distorted signal is used as an input to a uniform quantizer. At the receiver, an inverse compression characteristic, called expansion, is used so that the overall transmission is not distorted. The whole process (compression and expansion) is called companding.The μ-Law, used in North America, is as follows. Remark 2.2The implementation of zoom-in and zoom-out stages was initially discussed in 21,22. It was used to obtain a sufficient condition for the asymptotic stability for linear and nonlinear systems.As a result of the quantization, information loss will be introduced in the system. Therefore, a model of NCS has to take this into account. The quantization error is inversely proportional to the number of bits used for quantization, i.e., the small number of bits leads to a higher quantization error.
Matlab Adc Quantization
Due to this fact, a significant research was directed to determine the minimum number of bits required to achieve the stability of the system, some examples could be found in 21–25.Some researchers focused on controlling the quantization and its effects on the system. The authors of 26 proposed a sector bounded approach for dealing with the quantization errors, so their effects on NCS could be investigated using the procedures of robust analysis.
Quantization and stochastic packet dropouts were considered in the study of the quadratic stability of NCS, and finite quantization was used for implementing the controller in 27. The quantizer step size influence on NCS considering packet dropouts and finite-level quantization were studied in 28.
In 29 and 30, adaptable “center” and “zoom” parameters of the quantizers with finite values were considered, the input-to-state stability was obtained by applying a strategy of switching the controller continuously between “zoom-out” and “zoom-in”. The same strategy of “zoom-out” and “zoom-in” was used to obtain parametrized input-to-state stability of NCS subjected to packet dropout and unknown disturbances but with random lengths of quantization regions based on the packet dropout process 31.
The authors of 32 have used a sector bound and convex combination property of quantizer to determine sufficient conditions needed to achieve the desired control of NCS subjected to several categories of asynchronous sampling and quantization. Some literature discussed quantization with the implementation of event triggering control, see, e.g., 33–37. Remark 2.3There are two phenomena caused by quantization 7: 1.Saturation, which occurs when the signal is larger than the quantization range, leading to a higher quantization error and causing instability in the closed-loop system. 2.Deterioration of the performance around the original point, which occurs near the origin when the signal is not exactly quantized due to the limitation of the accuracy of the quantizers, and this will prevent approaching the asymptotic stability of the closed-loop system.