1.2 Analog, Digital and Discrete-Time Signals
In general, a signal is anything that can be transmitted or stored, and represents useful information.
Few examples can illustrate what information means in this context. For example, monochromatic and color images are two-dimensional (2D) and 3D signals, respectively, in which the information are the pixel values. For instance, a color image with resolution of pixels can be represented in the RGB color space1 by a 3D matrix with dimension .
A video is a sequence of images (each one called a frame) that are indexed by the integer . While an image does not depend on time, the value of in the video is interpreted as the time instant. For example, a video with 500 frames can be represented by a 4D multidimensional array (also called tensor) of dimension , in which is the image (frame) with dimension corresponding to time .
Another example of a signal is the electrocardiogram (ECG). Typically, the ECG is recorded with several channels and constitutes a multivariate or multidimensional signal , where is the time dimension. The information in the ECG corresponds to the amplitudes of each channel, which for a given can be organized as a vector . For instance, assuming six channels and a given time , the vector contains the six amplitude values.
The provided examples illustrate that there are signals with very different characteristics. To simplify the initial discussion, unless otherwise stated, it is assumed hereafter a one-dimensional real-valued signal that describes how a single amplitude varies over time.
It is useful to classify signals according to the behavior of these two variables: the independent variable representing progress in time and the amplitude, which is the dependent variable. If time evolution is represented by a real-valued variable , the function is called a continuous-time signal. If the progress over time is represented by an integer index , the sequence is called a discrete-time signal.
Similarly, the amplitude can freely assume any real value or be restricted to only pre-specified values from a finite set . In the latter case, the amplitude is said to be quantized. The quantized amplitudes can be eventually non-integer numbers. The number of elements in , i. e., the cardinality , indicates whether the system is binary (), quaternary () or -ary. A subscript will be used to denote a quantized signal, such as in .
Based on the previous definitions, it is possible to define analog and digital signals, which are the most common signals in practice. A digital signal is a discrete-time signal with quantized amplitudes. An analog signal is a continuous-time signal in which the amplitudes are not quantized (are not restricted to a finite number of distinct values). Table 1.1 summarizes a useful taxonomy of signals. Figure 1.1 and Figure 1.2 provide examples of analog and digital signals, respectively.
Continuous-time, | Discrete-time, |
|
Quantized amplitude |
| (digital) |
Not quantized | (analog) |
|
Signals that exist in the real-world are inherently analog. Even a DC power supply regulated to output 0 or 5 volts will present a small random amplitude fluctuation due to circuit imperfections and noise. It could then be (strictly) classified as an analog signal . But the circuits of a traditional digital system (e. g., a computer) can tolerate amplitude variations within a given range and, consequently, one may want to model such signal as continuous in time and with quantized amplitudes, denoting it as . It is also possible to find authors calling such continuous-time signal with quantized amplitudes a “digital” signal, but this nomenclature will be avoided in this text.
The interfaces between digital systems and the analog world require analog to digital (A/D) and digital to analog (D/A) conversions, which will be discussed in Section 1.7.
1.2.1 Advanced: Ambiguous notation: whole signal or single sample
It should be noted that the notation (the same happens for ) is ambiguous in the sense that it is widely used to represent both: a) the complete sequence and b) a sample at time . In most scenarios both interpretations are valid because if someone provides an equation such as
| (1.1) |
which is valid for all , this equation can be repeatedly used to reconstruct the whole sequence by varying , or be interpreted as a single sample for a specific value . In some cases, to disambiguate the two interpretations, a notation such as or is adopted, where and denote specific time instants instead of a generic variable that can be iteratively used to represent the complete sequence.2
1.2.2 Digitizing Signals
In many digital signal processing applications, it is required to convert a real-world analog signal into a digital format, and then process it with a computer, microcontroller, FPGA (field programmable gate array) or digital signal processor (DSP) chip, for example. Therefore, a brief review of the A/D process is discussed in the sequel.
The A/D converter (or ADC chip) transforms the input analog signal into a digital signal , consisting of a sequence of quantized samples. The ADC executes two tasks:
- sampling: periodically extract samples to accurately describe the signal;
- quantization: represent each of these samples with a reasonable accuracy.
Sampling depends on the adopted sampling frequency , which is the number of samples extracted from the signal per time unit (more specifically, one second).3 For example, Hz corresponds to obtaining 8000 samples to represent each signal segment with a duration of 1 second. The higher , the more accurate the representation tends to be.
Quantization depends on the number of bits used to represent each sample. For example, if , each sample can be represented by only distinct values: 00, 01, 10 and 11. The mapping between these binary values and amplitudes is somehow arbitrary. For example, 00 can represent V while 01 can represent V. In general, an ADC of bits can output distinct quantized values.
ADCs with large values for and are more expensive. Sometimes the tradeoff is to use a relatively large with small (e.g., GHz with bits) or vice-versa (e.g., MHz with bits).
The chip that performs the digital to analog conversion is called DAC. It also operates according to the values of and .
Note that the operation performed by an ADC chip is in general lossy and, consequently, non-invertible.4 Therefore, cascading an ADC and a DAC chips recovers only an approximation of the original signal . In this text we will learn how to properly choose and to control the A/D and D/A processes, in order to recover with the accuracy that the given application demands. These two parameters are the most relevant in the A/D and D/A processes, but when choosing commercial chips, there are many others (see exercises in Section 1.16). One important figure of merit to estimate this accuracy is the signal-to-noise ratio (SNR), which is the ratio between the power of the input and the power of the “noise” signal, which in this case is the total error caused by the sampling and quantization processing stages. When this error is solely caused by quantization, the SNR is called signal-to-quantization-noise ratio (SQNR).
1.2.3 Discrete-time signals
In practice, the A/D conversion is typically performed by a monolithic ADC chip. But for theoretical studies, it is convenient to mathematically model this A/D conversion by splitting it in the two mentioned stages: sampling and quantization. One important reason for adopting these two stages when modeling the A/D conversion is that, while sampling is a linear operation, the input-output relation of quantizers is nonlinear (you may want to take a peek at Figure 1.47 and note that the relation corresponds to a non-linear stairs function). There are several tools, such as the Laplace and Fourier transforms discussed in Chapter 2 for dealing with linear operations. On the other hand, working with nonlinear systems is more evolved. Because of that, most “digital” signal processing theory does not assume the amplitude is quantized to enable the usage of tools restricted to linear operations. Hence, more strictly, most of the DSP theory could be called “discrete-time” signal processing. However, the name “digital signal processing” is more popular.
Figure 1.3 illustrates a discrete-time signal. Note the abscissa is given in discrete-time , similar to the notation adopted for digital signals. But for a discrete-time signal , the amplitude is not quantized and can assume any value. Figure 1.3 should be compared with Figure 1.1 and Figure 1.2, observing each axis.
Example 1.1. Example of creating a discrete-time signal from a continuous-time sinusoid. Consider extracting samples from the analog signal with amplitude 6 volts and a frequency Hz (the subscript is just to indicate this is a specific and fixed frequency value). The goal is to use samples to represent each segment of one second, where is the sampling frequency. The time interval between consecutive samples is , which in this case is s. Listing 1.1 illustrates one possible implementation.
1Fs=8000; %sampling frequency (Hz) 2Ts=1/Fs; %sampling interval (seconds) 3f0=400; %cosine frequency (Hz) 4N=100; %number of desired samples 5n=0:N-1; %generate discrete-time abscissa 6t=n*Ts; %discretized continuous-time axis (sec.) 7x=6*cos(2*pi*f0*t); %amplitude=6 V and frequency = f0 Hz 8stem(n,x); %plot discrete-time signal
Figure 1.4 indicates the result of executing Listing 1.1. This cosine has a period of ms. Therefore, each of its period is being represented by samples. Note in Figure 1.4 that, in this specific case, at each sample , the sample at is repeated, and a new cosine cicle starts.