CIITM, JAIPUR (DEPARTMENT OF ELECTRONICS & COMMUNICATION) Notes Digital Signal Processing (Subject Code: 7EC2) Prepared Class: B. Tech. IV Year, VII Semester
Syllabus UNIT 1: SAMPLING - Discrete time processing of Continuous-time signals, continuoustime processing of discrete-time signals, changing the sampling rate using discrete-time processing. Beyond the Syllabus Practical applications of signal, sampling and its use. Learning Objectives Students will learn the signal, sampling and its use in digital signal processing Technologies
The concepts of signal and system: UNIT-I: SAMPLING Signal: A signal can be broadly defined as any quantity that varies as a function of time and/or space and has the ability to convey information. Signals are ubiquitous in science and engineering. Examples include:- Electrical signals: currents and voltages in AC circuits, radio communications signals, audio and video signals.- Mechanical signals: sound or pressure waves, vibrations in a structure, earthquakes.biomedical signals: electroencephalogram, lung and heart monitoring, X-ray and other typesof images- Finance: time variations of a stock value or a market index. By extension, any series of measurements of a physical quantity can be considered a signal (temperature Measurements for instance). Signal characterization: The most convenient mathematical representation of a signal is via the concept of a function, say x(t). In this notation: - x represents the dependent variable (e.g., voltage, pressure, etc.) - t the represents the independent variable (e.g., time, space, etc.). Depending on the nature of the independent and dependent variables, different types of signals can be Identified:- Analog signal: t R xa(t) R or C When t denotes the time, we also refer to such a signal as a continuous-time signal.- Discrete signal: n ₃Z x[n] R or C Distinctions can also be made at the model level, for example: whether x[n] is considered to be deterministic or random in nature. Speech signal: A speech signal consists of variations in air pressure as a function of time, so that it basically represents a continuous-time signal x(t). It can be recorded via a microphone that translates the local pressure variations into a voltage signal. An example of such a signal is given in Figure 1.1(a), which represent the utterance of the vowel a. If one wants to process this signal with a computer, it needs to be discredited in time in order to accommodate the discrete-time processing capabilities of the computer.and also quantized, in order to accommodate the finite-precision representation in a computer These represent a continuous-time, discrete-time and digital signal respectively. As we know from the
sampling theorem, the continuous-time signal can be reconstructed from its samples taken with a sampling rate at least twice the highest frequency component in the signal. Speech signals exhibit energy up to say, 10 khz. However, most of the intelligibility is conveyed in a bandwidth less than 4 khz. In digital telephony, speech signals are filtered (with an anti-aliasing filter which removes energy above 4 khz), sampled at 8 khz and represented with 256 discrete (non-uniformly spaced) Digital Image: An example of two-dimensional signal is a grayscale image, where t 1 and t2 represent the horizontal and vertical coordinates, and x(t1, t2) represents some measure of the intensity of the image at location (t1, t2). This example can also be considered in discrete-time (or rather in discrete space in this case): digital images are made up of a discrete number of points (or pixels), and the intensity of a pixel can be denoted by x[n1,n2]. Figure 1.2 shows an example of digital image. The rightmost part of the Figure shows a zoom on this image that clearly shows the pixels. This is an 8-bit grayscale image, i.e. each pixel (each signal sample) is represented by an 8-bit number ranging from 0 (black) to 255 (white). System: A physical entity that operates on a set of primary signals (the inputs) to produce a corresponding set of resultant signals (the outputs). System characterization: A system can be represented mathematically as a transformation between two signal sets, as in x[n] S1 y[n] = T{x[n]} S2. This is illustrated in Figure
SAMPLING: The signals we use in the real world, such as our voices, are called "analog" signals. To process these signals in computers, we need to convert the signals to "digital" form. While an analog signal is continuous in both time and amplitude, a digital signal is discrete in both time and amplitude. To convert a signal from continuous time to discrete time, a process called sampling is used. The value of the signal is measured at certain intervals in time. Each measurement is referred to as a sample. (The analog signal is also quantized in amplitude; This is known as the Nyquist rate. The Sampling Theorem states that a signal can be exactly reproduced if it is sampled at a frequency F, where F is greater than twice the maximum What happens if we sample the signal at a frequency that is lower that the Nyquist rate? When the signal is converted back into a continuous time signal, it will exhibit a phenomenon called aliasing. Aliasing is the presence of unwanted components in the reconstructed signal.
Basic Ideas in Sampling Theory sampling a signal: Analog Digital conversion by reading the value at discrete points Digital signal processing (DSP): In its most general form, DSP refers to the processing of analog signals by means of discrete-time operations implemented on digital hardware. From a system viewpoint, DSP is concerned with mixed systems: - the input and output signals are analog - the processing is done on the equivalent digital signals.
Basic components of a DSP system: Generic structure: In its most general form, a DSP system will consist of three main components, as illustrated in Figure. The analog-to-digital (A/D) converter transforms the analog signal xa(t) at the system input into a digital signal xd [n]. An A/D converter can be thought of as consisting of a sampler (creating a discretetime signal), followed by a quantizer (creating discrete levels). The digital system performs the desired operations on the digital signal xd[n] and produces a corresponding output yd [n] also in digital form. The digital-to-analog (D/A) converter transforms the digital output yd[n] into an analog signal ya(t) suitable for interfacing with the outside world. In some applications, the A/D or D/A converters may not be required; we extend the meaning of DSP systems to include such cases. Discrete-time signals are typically written as a function of an index n (for example, x(n) or x n may represent a discretisation of x(t) sampled every T seconds). In contrast to Continuous signal systems, where the behaviour of a system is often described by a set of linear differential equations, discrete-time systems are described in terms of difference equations. Most Monte Carlo simulations utilize a discretetiming method, either because the system cannot be efficiently represented by a set of equations, or because no such set of equations exists. Transform-domain analysis of discrete-time systems often makes use of the Z transform.
Discrete time processing of continuous time signals: Even though this course is primarily about the discrete time signal processing, most signals we encounter in daily life are continuous in time such as speech, music and images. Increasingly discrete-time signals processing algorithms are being used to process such signals. For processing by digital systems, the discrete time signals are represented in digital form with each discrete time sample as binary word. Therefore we need the analog to digital and digital to analog interface circuits to convert the continuous time signals into discrete time digital form and vice versa. As a result it is necessary to develop the relations between continuous time and discrete time representations. 1. Sampling of continuous time signals: Let {x c (t)} be a continuous time signal that is sampled uniformly at t = nt generating the sequence {x[n]} where x[n] = x c (nt ), < n <, T > 0 T is called sampling period, the reciprocal of T is called the sampling fre-quency f s = 1/T. The frequency domain representation of {x c (t)} is given by its Fourier transform. where the frequency-domain representation of {x[n]} is given by its discrete time fourier transform. To establish relationship between the two representation, we use impulse train sampling. This should be understood as mathematically convenient method for understanding sampling. Actual circuits can not produce contin-uous time impulses. A periodic impulse train is given by: x p (t) = x c (t)p(t) using sampling property of the impulse f (t)δ(t t 0 ) = f (t 0 )δ(t t 0 ), we get From multiplication property, we know that: X p (jω) = 2π [X c (jω) ₃ P (jω)] The Fourier transform of a impulse train is given by Where Ω s = 2T Using the property that X (jω) δ(ω Ω 0 ) = X (j(ω Ω 0 )) it follows tha X p (jω) = 1/t X c (jω kω s ) Thus X p (jω) is a periodic function of Ω with period Ω s, consisting of super-position of shifted replicas of
X c (jω) scaled by 1/T. Figure 8.3 illustrates this for two cases. If Ω m < (Ω s Ω m ) or equivalently Ω s > 2Ω m there is no overlap between shifted replicas of X c (jω), whereas with Ω s < 2Ω m, there is overlap. Thus if Ω s > 2Ω m, X c (jω) is faithfully replicated in X p (jω) and can be recovered from x p (t) by means of lowpass filtering with gain T and cut of frequency between Ω m and Ω s Ω m. This result is known as Nyquist sampling theorem. A major application of discrete-time systems is in the processing of continuous-time signals. The overall system is equivalent to a continuous-time system, since it transforms the continuous-time input signal x s (t) into the continuous time signal y r (t). Sampling Theorem: Let xc(t) be a bandlimited signal with Xc(jΩ) = 0, for Ω > Ωm. Then Xc(t) is uniquely determined by its samples x[n] = xc(nt), < n <, if The frequency 2Ωm is called Nyquist rate, while the frequency Ωm is called the Nyquist frequency. The signal xc(t) can be reconstructed by passing xp(t) through a lowpass filter. The effect of underselling: Aliasing We have seen earlier that spectrum Xc(jΩ) is not faithfully copied when Ωs < 2Ωm. The terms in overlap. The signal xc(t) is no longer recoverable From xp(t). This effect, in which individual terms in equation overlap is called aliasing. For the ideal low pass signal
Hence xr(nt) = xc(nt), n = 0,±1,±2... Thus at the sampling instants the signal values of the original and reconstructed Signals are same for any sampling frequency. DTFT of the discrete time signal: Taking continuous time Fourier transform of equation we get Since x[n] = xc(nt), we get the DTFT Comparing them we see that Comparing equation, (we see that X(ejw) is simply a frequency scaled version of Xp(jΩ) with frequency scaling specified by w = ΩT. This can be thought of as a normalization of frequency axis so that frequency Ω = Ωs in Xp(jΩ) is normalized to w = 2π in X(ejw). For the example in the X(ejw)is shown in fig: From equation we see that:
We refer to the system that implements x[n] = xc(nt) as ideal continuousto- discrete time (C/D) convertor and is depicted in figure The ideal system that takes {x[n]} sequence as input and produces xr(t) given equationis called ideal discrete to continuous time (D/C) convertor and is depicted in Discrete time processing of continuous time signal Shows a system for discrete time processing of continuous time System. The over all system has xc(t) as input and yr(t) as output. We have the following relations among the signals. If the discrete time system is LTI then we have combining these equations we get:
If Xc(jΩ) = 0, for Ω π/t and we use ideal lowpass reconstruction filter then only the term for k = 0 is passed by the filter and we get Thus if Xc(jΩ) is bandlimited and sampling rate is above the Nyquist rate, the output is related to the input by That is overall system is equivalent to a linear time invariant system for bandlimited signal. The LTI property of the system depends on two factors. First the discrete time system is LTI and second the input signals are bandlimited to half the Sampling frequency: Continuous time processing of discrete time signals: Consider the system shown in figure: Therefore the overall system behaves as a discrete time system where frequency Response is
Sampling of discrete time Signals: In analogy with continuous time sampling, the sampling of a discrete time signal can be represented as shown in figure: In frequency domain, we get The Fourier transform of {p[n]} sequence is where ws = 2πN. Thus we get If (ws wm) > wm or equivalently ws > 2wm or 2π N > 2wm there will be no aliasing (i.e non zero portions of X(ejw) do not overlap) and the signal {x[n]} can be recovered from xp[n] by passing through an ideal low-pass filter with gain equal to N and cut off equal to ws/2
If ws < 2wm, there will be aliasing, and so {xr[n]} will be different from {x[n]}. However as in continuous time case independently of whether there is aliasing or not. For ideal low pass filter: With wc = π/n we get
Discrete time decimation and interpolation: The sampled signal in equation (8.13) has (N 1) samples out of every N Samples as zeros. We define a new sequence which retains only the non zero Values This is called a decimated sequence, whatever may be the value of N 2.The DTFT of the decimated request is given by Since only for multiples of N, xp[n] has non zero value: If the original signal {x[n]} was obtained by sampling a continuous time Signal, the process of decimation can be viewed as reduction in the sampling Rate by a factor of N. With this interpretation, the process of decimation is often referred as down sampling. There are situations in which it is useful to convert a sequence to a higher Equivalent sampling rate. This process is referred to as upsampling or interpolation. This process is reverse of the downsampling. {x[n]} we obtain an expanded sequence xc[n] by inserting (L 1) zero
The interpolated sequence {xi[n]} is obtained by low pass filtering of {xe[n]} After low pass filtering: For ideal low-pass filter with cutoff π L and gain L we get: We can get a non integer change in rate if it is ratio of two integers by using upsampling and downsampling operations. Continuous time processing of discrete-time signals
Since this is a re-sampling process. Remember that, from continuous-time sampling of x[n]= xc(nt), we have Discrete-time signals and systems: Definition: A DT signal is a sequence of real or complex numbers, that is, a mapping from the set of integers Z into either R or C, as in: Description: There are several alternative ways of describing the sample values of a DT signal. Some of the most common are: Sequence notation: where the bar on top of symbol 1 indicates origin of time (i.e. n = 0) Graphical: Explicit mathematical expression:
Recursive approach: Depending on the specific sequence x[n], some approaches may lead to more compact representation than others. Uniform sampling: In DSP applications, a common way of generating DT signals is via uniform (or periodic) sampling of an analog signal xa(t), t 2 R, as in: where Ts > 0 is called the sampling period. For example, consider an analog complex exponential signal given by xa(t) = e j2pft, where F denotes the analog frequency (in units of 1/time). Uniform sampling of xa(t) results in the discrete-time CES where w = 2pFTs is the angular frequency (dimensionless).. Thecontinuous and dashed-dotted lines respectively show the real part of the analog complex exponential signals e jwt and e j(w+2p)t. Upon uniform sampling at integer values of t (i.e. using Ts = 1 in (2.9)), the same sample values are obtained for both analog exponentials, as shown by the solid bullets in the figure. That is, the DT CES e jwn and e j(w+2p)n are indistinguishable, even tough the original analog signals are different. This is a simplified illustration of an important phenomenon known as frequency aliasing. As we saw in the example, for sampled data signals (discrete-time signals formed by sampling continuoustime signals), there are several frequency variables: F the frequency variable (units Hz) for the frequency response of the continuous-time signal, and w the (normalized) radian frequency of the frequency response of the discrete-time signal. These are related by
Beyond the Syllabus: Pros and cons of DSP Advantages: Robustness: - Signal levels can be regenerated. For binary signals, the zeros and ones can be easily distinguished even in the presence of noise as long as the noise is small enough. The process of Regeneration make a hard decision between a zero and a one, effectively stripping off the noise. - Precision not affected by external factors. This means that one gets the results are reproducible. Storage capability: - DSP system can be interfaced to low-cost devices for storage. The retrieving stored digital signals (often in binary form) results in the regeneration of clean signals. - allows for off-line computations Flexibility: - Easy control of system accuracy via changes in sampling rate and number of representation bits. - Software programmable implementation and fast modification of complex processing functions (e.g. self-tunable digital filter) Structure: - Easy interconnection of DSP blocks (no loading problem) - Possibility of sharing a processor between several tasks Disadvantages: Cost/complexity added by A/D and D/A conversion. Input signal bandwidth is technology limited. Quantization effects. Discretization of the levels adds quantization noise to the signal. Simple conversion of a continuous-time signal to a binary stream of data involves an increase in the bandwidth required for transmission of the data. This however can be mitigated by using compression Techniques. For instance, coding an audio signal using MP3 techniques results in a signal which uses Much less bandwidth for transmission than a WAVE file. D/A converter: This operation can also be viewed as a two-step process, as illustrated in Figure 1.6. Pulse train Generator Interpolator y (t) a y [n] d yˆ (t) a Fig:D/A Conversion
Pulse train generator: in which the digital signal yd[n] is transformed into a sequence of scaled, analog Pulses. Interpolator: in which the high frequency components of ˆ ya(t) are removed via low-pass filtering to Produce a smooth analog output ya(t). This two-step representation is a convenient mathematical model of the actual D/A conversion, though, in Practice, one device takes care of both steps. Applications of DSP: Typical applications: Signal enhancement via frequency selective filtering Echo cancellation in telephony: - Electric echoes resulting from impedance mismatch and imperfect hybrids. - Acoustic echoes due to coupling between loudspeaker and microphone. Compression and coding of speech, audio, image, and video signals: - Low bit-rate codecs (coder/decoder) for digital speech transmission. - Digital music: CD, DAT, DCC, MD,...and now MP3 - Image and video compression algorithms such as JPEG and MPEG Digital simulation of physical processes: - Sound wave propagation in a room - Baseband simulation of radio signal transmission in mobile communications Image processing: - Edge and shape detection - Image enhancement