Digital Signal Processing Applications of DSP � Speech processing � Enhancement – noise filtering � Coding � Text-to-speech (synthesis) � Recognition � Image processing � Enhancement, coding, pattern recognition (e.g. OCR) � Multimedia processing � Media transmission, digital TV, video conferencing � Communications � Biomedical engineering � Navigation, radar, GPS � Control, robotics, machine vision What is a signal? A signal is defined as any physical quantity that varies with time, space, or any other independent variable or variables. Mathematically, we describe a signal as a function of one or more independent variables. For example, the functions Describe two signals, one that varies linearly with the independent variable t (time) and a second that varies quadratically with t . As another example, consider the This function describes a signal of two independent variables x and y that could represent the two spatial coordinates in a plane. The signals described above belong to a class of signals that are precisely defined by specifying the functional dependence on the independent variable. However, there are cases where such a functional relationship is unknown or too highly complicated to be of any practical use. 1 For example, a speech signal (see Fig. 1.1) cannot be described functionally by expressions such as (1.1.1). In general, a segment of speech may be represented to a high degree of accuracy as a sum of several sinusoids of different amplitudes and frequencies, that is, as Where (Ai(t), Fi(t), and (Oi(t)) are the sets of (possibly time-varying) amplitudes, frequencies, and phases, respectively, of the sinusoids. In fact, one way to interpret the information content or message conveyed by any short time segment of the speech signal is to measure the amplitudes, frequencies, and phases contained in the short time segment of the signal. Speech, electrocardiogram. and electroencephalogram signals are examples of information-bearing signals that evolve as functions of a single independent variable. Namely. time. An example of a signal that is a function of two independent variables is an image signal. The independent variables in this case are the spatial coordinates. These are but a few examples of the countless number of natural signals encountered in practice. Associated with natural signals are the means by which such signals are generated. For example, speech signals are generated by forcing air through the vocal cords. Images are obtained by exposing a photographic film to a scene or an object. Thus signal generation is usually associated with a system that responds to a stimulus or force. In speech signal, the system consists of the vocal cords and the vocal tract, also called the vocal cavity. The stimulus in combination with the system is called a signal source. Thus, we have speech sources, images sources, and various other types of signal sources. Figure 1.1 Example of a speech signal. Multichannel and Multidimensional Signals 2 A signal is described by a function of one or more independent variables. The value of the function (i.e.. the dependent variable) can be a real-valued scalar quantity, a complex-valued quantity. or perhaps a vector. For example, the signal is a real-valued signal. However, the signal is complex valued. In some applications, signals are generated by multiple sources or multiple sensors. Such signals. in turn. can be represented in vector form. We refer to such a vector of signals as a miilrichannel signal. In electrocardiography, for example, 3-lead and 12-lead electrocardiograms (ECG) are often used in practice, which result in 3-channel and 12channel signals. If the signal is a function of a single independent variable. the signal is called a one-dimensional signal. On the other hand. a signal is called M-dimensional if its value is a function of M independent variables. The picture is an example of a two-dimensional signal. Since the intensity or brightness I ( x , y) at each point is a function of two independent variables. On the other hand. a black-and-white television picture may be represented as I ( x , y, t ) since the brightness is a function of time. Hence the TV picture may be treated as a threedimensional signal. In contrast. a color TV picture may be described by three intensity functions of the form Ir ( x , y, t). Ig(x, y, t ), and Ib ( x, y, t ) , corresponding to the brightness of the three principal colors (red,green, blue) as functions of time. Hence the color TV picture is a three-channel. three-dimensional signal, which can be represented by the vector What is a System? A system may also be defined as a physical device that performs an operation on a signal. For example, a filter used to reduce the noise and interference corrupting a desired information-bearing signal is called a system. In this case the filter performs some operation(s) on the signal, 3 which has the effect of reducing (filtering) the noise and interference from the desired information-bearing signal. When we pass a signal through a system, as in filtering. we say that we have processed the signal. In this case the processing of the signal involves filtering the noise and interference from the desired signal. In general, the system is characterized by the type of operation that it performs on the signal. For example, if the operation is linear, the system is called linear. If the operation on the signal is nonlinear, the system is said to be nonlinear, and so forth. Such operations are usually referred to as signal processing. It is convenient to broaden the definition of a system to include not only physical devices, but also software realizations of operations on a signal. In digital processing of signals on a digital computer, the operations performed on a signal consist of a number of mathematical operations as specified by a software program. In this case, the program represents an implementation of the system in software, thus we have a system that is realized on a digital computer by means of a sequence of mathematical operations: that is, we have a digital signal processing system realized in software. For example. a digital computer can be programmed to perform digital filtering. Alternatively, the digital processing on the signal map be performed by digital hardware (logic circuits) configured to perform the desired specified operations. In such a realization, we have a physical device that performs the specified operations. In a broader sense, a digital system can be implemented as a combination of digital hardware and software, each of which performs its own set of specified operations. Types of signals The independent variable may be either continuous or discrete. 1-Continuous-time signals Continuous-time signals or analog signals are defined for every value of time and they take on values in the continuous interval (a. b), where a can be -∞ and b can be ∞. Mathematically, these signals can be described by functions of a continuous variable. The speech waveform in Fig. 1.1 and the signal x1( t ) = cost are examples of analog signals. (i) Periodic functions (ii) Nonperiodic functions (iii) Random functions PERIODIC FUNCTIONS A signal v(t) is periodic with period T if 4 Four types of periodic functions which are specified for one period T and corresponding graphs are as follows: (a) Sine wave: (b) Periodic pulse: (c) Periodic tone burst: where T = KA and K is an integer. 5 Periodic signals may be very complex. They may be represented by a sum of sinusoids. This type of function will be developed in the following sections. SINUSOIDAL FUNCTIONS A sinusoidal signal v(t) is given by where V0 is the amplitude, is the angular velocity, or angular frequency, and is the phase angle. The angular velocity may be expressed in terms of the period T or the frequency f, where f = 1/T. The frequency is given in hertz, Hz, or cycles/s. Since cost = cos (t +2), and T are related by T = 2. And since it takes T seconds for v(t) to return to its original value, it goes through 1/T cycles in one second. In summary, for sinusoidal functions we have EXAMPLE: Graph each of the following functions and specify period and frequency. 6 7 TIME SHIFT AND PHASE SHIFT If the function v(t) = cos t is delayed by seconds, we get v(t-) = cos (t-) = cos (t-) where = . The delay shifts the graph of v(t) to the right by an amount of seconds, which corresponds to a phase lag of = =2. A time shift of seconds to the left on the graph produces v(t+) , resulting in a leading phase angle called an advance. Conversely, a phase shift of corresponds to a time shift of . Therefore, for a given phase shift the higher is the frequency, the smaller is the required time shift. EXAMPLE: Plot This is a cosine function with period of 12s, which is advanced in time by 1s. In other words, the graph is shifted to the left by 1 s or 30 as shown below. 8 COMBINATIONS OF PERIODIC FUNCTIONS The sum of two periodic functions with respective periods T1 and T2 is a periodic function if a common period T = n1T1 = n2T2, where n1 and n2 are integers, can be found. This requires T1/T2 = n2/n1 to be a rational number. Otherwise, the sum is not a periodic function. EXAMPLE: Find the period of v(t) = cos5t +3 sin(3t + 45). The period of cos5t is T1 =2/5 and the period of 3sin(3t + 45), is T2 = 2/3. Take T = 2 = 5T1 = 3T2 which is the smallest common integral multiple of T1 and T2. Observe that v(t+ T) = v(t) since Therefore, the period of v(t) is 2. QUESTION1 : Is v(t) = cost + cos2t periodic? Discuss. QUESTION2: Given p = 3.14, find the period of V(t) = cos t + cos2pt. NONPERIODIC FUNCTIONS A nonperiodic function cannot be specified for all times by simply knowing a finite segment. Examples of nonperiodic functions are 9 Several of these functions are used as mathematical models and building blocks for actual signals in analysis and design of sytems. Examples are discussed in the following sections. THE UNIT STEP FUNCTION The dimensionless unit step function, is defined by THE UNIT IMPULSE FUNCTION Consider the function sT(t) of Fig. below(a), which is zero for t < 0 and increases uniformly from 0 to 1 in T seconds. Its derivative dT(t) is a pulse of duration T and height 1/T, as seen in Fig. (b). 10 If the transition time T is reduced, the pulse in Fig. (b) becomes narrower and taller, but the area under the pulse remains equal to 1. If we let T approach zero, in the limit function sT(t) become a unit step u(t) and its derivative dT(t) becomes a unit pulse (t) with zero width and infinite height. The unit impulse (t) is shown in Fig. (c). The unit impulse or unit delta function is defined by 11 THE EXPONENTIAL FUNCTION The function f(t) = est with s a complex constant is called exponential. It decays with time if the real part of s is negative and grows if the real part of s is positive. We will discuss exponential sat in which the constant a is a real number. The inverse of the constant a has the dimension of time and is called the time constant = 1/a. A decaying exponential e-t/ is plotted versus t as shown below. The function decays from one at t= 0 to zero at t=. After seconds the function e-t/ is reduced to e-1= 0.368. For =1, the function e-t is called a normalized exponential . DAMPED SINUSOIDS A damped sinusoid, with its amplitude decaying exponentially has the form 12 RANDOM SIGNALS So far we have dealt with signals which are completely specified. For example, the values of a sinusoidal waveform, such as the line voltage, can be determined for all times if its amplitude, frequency, and phase are known. Such signals are called deterministic. There exists another class of signals which can be specified only partly through their time averages, such as their mean, rms value, and frequency range. These are called random signals. Random signals can carry information and should not be mistaken with noise, which normally corrupts the information contents of the signal. EXAMPLE : Samples from a random signal x(t) are recorded every 1 ms and designated by x(n). Approximate the mean and rms values of x(t) from samples given in Table below. 13 EXAMPLE : A binary signal v(t) is either at 0.5 or -0.5 V. It can change its sign at 1-ms intervals. The sign change is not known a priori, but it has an equal chance for positive or negative values. Therefore, if measured for a long time, it spends an equal amount of time at the 0.5-V and -0.5-V levels. Determine its average and effective values over a period of 10 s. During the 10-s period, there are 10,000 intervals, each of 1-ms duration, which on average are equally divided between the 0.5-V and -0.5-V levels. Therefore, the average of v(t) can be approximated as The effective value of v(t) is 14