بسم الله الرحمن الرحيم Digital Signal Processing Lecture 2 Analog to Digital Conversion University of Khartoum Department of Electrical and Electronic Engineering Fourth Year
Content 1.Introduction 2.Analog to Digital conversion 3.Sampling of Analog Signal 4.Quantization Dr Iman AbuelMaaly2
Introduction 1. Continuous time Signals (notations) A simple harmonic oscillation: Signal parameters: A : Amplitude Ω : Frequency in radians/sec θ : phase in radians Ω = 2π F F : frequency in cycles/sec or Hz. T=1/F is the period of the signal Dr Iman AbuelMaaly
Introduction Dr Iman AbuelMaaly 1. Continuous time Signals (notations)
Introduction Signal parameters: n : integer variable A : Amplitude ω : Frequency in radians/sample (ω = 2π f) θ : phase in radians f : frequency in cycles/sample.(f=1/N) N : is the period Dr Iman AbuelMaaly 2. Discrete –time Signals (notations)
Example of a discrete-time sinusoidal signal: (ω =π/6 radians per sample (f =1/12 cycles per sample) and θ = π/3 ) n x(n) Dr Iman AbuelMaaly 1. Introduction
Dr Iman AbuelMaaly 7 Sampler Quantizer coder xa(t)xa(t) xq(n)xq(n) x(n)x(n) Analog signal Discrete signal Quantizedsignal Digital signal Discrete signal Quantizedsignal x(n)x(n) xq(n)xq(n) 2. Analog to Digital conversion
We view the A/D conversion as three steps process. Basic parts of an A/D conversion Dr Iman AbuelMaaly 8 SamplerQuantizercoder xa(t)xa(t)xq(n)xq(n)x(n)x(n) Analog signal Discrete signal Quantized signal Digital signal
2. Analog to Digital conversion Sampling: Conversion of a continuous time signal into a discrete time signal. Quantization: Conversion of a discrete time continuous valued signal into a discrete time discrete valued signal. Coding: Each discrete valued signal is represented by b-bits (binary sequence) Dr Iman AbuelMaaly 9
Distortion and Noise Sampling does not result in a loss of information, nor does it introduce distortion in the signal if the signal is band limited (according to the sampling theory) Quantization is a non invertible process that results in signal distortion. This quantization distortion decreases when the the accuracy (number of bits) increases Dr Iman AbuelMaaly 10
Analog to digital conversion cost is proportional to the sampling rate and accuracy Dr Iman AbuelMaaly 11
3. Sampling of analog signals Uniform sampling Sampling of a continuous-time signal x a (t) can be done by obtaining its values at periodic times to get x a (nT) where T is the sampling period. This is described by the relation: Dr Iman AbuelMaaly 12
Uniform Sampling Dr Iman AbuelMaaly 13
Uniform Sampling Sampling Dr Iman AbuelMaaly 14
Uniform Sampling T= Sampling period (secs). = sampling rate ( samples/sec) or sampling frequency in Hz Dr Iman AbuelMaaly 15
Uniform Sampling Notice For continuous time signals we use F and Ω For discrete time signals we use f and ω Dr Iman AbuelMaaly 16
Uniform Sampling Example For the analog sinusoid When sampled periodically at rate We get Dr Iman AbuelMaaly 17
Frequency variables : F and f From the above example we get the following: (1) Relative or normalized frequency (2) x(n) Dr Iman AbuelMaaly 18
For continuous-time sinusoids: (3) For discrete-time sinusoids: (4) Dr Iman AbuelMaaly 19 Frequency variables : F and f
By substituting (1) and (2) into (4), the frequency of a continuous time sinusoid when sampled at a rate must fall in the range: Or equivalently: 20 (1) (2) (4) Dr Iman AbuelMaaly
Periodic sampling of a continuous signal implies a mapping of the infinite frequency range for the variable F or Ω into a finite frequency range for the variable f or ω. The highest frequency in a discrete time signal is ω = π or f= 1/2. It follows that with a sampling rate F s, the corresponding highest values F and Ω are: and Dr Iman AbuelMaaly 21
Quantization and Continuous-amplitude Signals: Quantization is the process of converting a discrete–time continuous amplitude signal into a digital signal by expressing each sample value as a finite ( instead of infinite) number of digits. Q[x(n)] is the quantization of x(n)
The Quantization Error e q (n) e q (n) is the difference between the quantized value and the actual value of samples. Quantization process is done by either truncation or rounding
Example: x (1) = 3.8 and x (2) =3.2 Truncationx q (1) = 3x q (2) = 3 Roundingx q (1) = 4x q (2) = The Quantization Error e q (n)
Example 2: Consider a discrete time signal Obtained by sampling the analog signal with a sampling frequency 1 Hz
Example 2: Sampling
Ilustration of Quantization
Rounding =0.7
Quantization Error
∆ is the distance allowed between two successive quantization levels and is called quantization step size or resolutions. The rounding quantizer assigns each sample of x(n) to the nearest quantization level. The quantization error can not exceed half of the quantization step, i.e.,
L is the number of quantization levels. If x max and x min are the maximum and minimum values of x(n) then, x max – x min is the dynamic range of the signal
In the previous example: x max = 1.0 x min = 0 L= 11 Then ∆ =0.1 Increasing the number of quantization level results in a decrease of the quantization step size and thus e q (n) decreases
Why is quantization a non-invertible proces? Because it is a many to one mapping. i.e., all samples in a distance ∆/2 about a certain quantization level are assigned the same value. 8.02, 8.1, 8.1, 8.2, 8.2, 8.3, 8.3, are all quantized to be
Quantization of Sinusoidal Signals The following figure shows the sampling and quantization of an analog sinusoidal signal
By quantizing the analog signal instead of the discrete signal, we get the following quantization error: x a (t) denotes the time that x a (t) stays within the quantization levels Quantization of Sinusoidal Signals
xa(t) Signal xa(t) is almost linear between quantization levels. eq(t) The corresponding quantization error eq(t) is eq(t)= xa(t)- xq(t)
The Mean Square Error Power p q The mean square error power p q is: Since, We have
The Mean Square Error Power b If the quantizer has b bits of accuracy and the quantizer covers the entire range 2A, the quantization step is Hence The average power of the signal x a (t) is
Signal To Quantization Noise Ratio SQNR The quality of the output of the A/D converter is usually measured by the signal to quantization noise ratio SQNR, Expressed in dB, SQNR is, SQNR increases 6dB for every bit added to the word length
Next Lecture Dr Iman AbuelMaaly41