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 X with resolution of 480 × 640 pixels can be represented in the RGB color space1 by a 3D matrix with dimension 480 × 640 × 3.

A video is a sequence X[n] of images (each one called a frame) that are indexed by the integer n. While an image X does not depend on time, the value of n in the video X[n] is interpreted as the time instant. For example, a video X[n] with 500 frames can be represented by a 4D multidimensional array (also called tensor) of dimension 500 × 480 × 640 × 3, in which X = X[3] is the image (frame) with dimension 480 × 640 × 3 corresponding to time n = 3.

Another example of a signal is the electrocardiogram (ECG). Typically, the ECG is recorded with several channels and constitutes a multivariate or multidimensional signal x(t), where t is the time dimension. The information in the ECG corresponds to the amplitudes of each channel, which for a given t can be organized as a vector x. For instance, assuming six channels and a given time t0, the vector x = x(t0) 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 t , the function x(t) is called a continuous-time signal. If the progress over time is represented by an integer index n , the sequence x[n] 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 M of elements in , i. e., the cardinality M = | |, indicates whether the system is binary (M = 2), quaternary (M = 4) or M-ary. A subscript q will be used to denote a quantized signal, such as in xq(t).

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 xq[n] is a discrete-time signal with quantized amplitudes. An analog signal x(t) is a continuous-time signal in which the amplitudes are not quantized (are not restricted to a finite number of M 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.

Table 1.1: Notation used for continuous and discrete-time signals.

Continuous-time, t

Discrete-time, n

Quantized amplitude

xq(t)

xq[n] (digital)

Not quantized

x(t) (analog)

x[n]

PIC

Figure 1.1: Example of analog signal. Note the abscissa is continuous and the amplitude is not quantized, assuming an infinite number of possible values.

PIC

Figure 1.2: Example of digital signal obtained by digitalizing the analog signal in Figure 1.1. Note both the abscissa (dimensionless indices) and amplitude of the digital signal are discrete. In this case, the quantized amplitudes assume M = 10 possible values from = {3,2,,5,6}.

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 x(t). 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 xq(t). It is also possible to find authors calling such continuous-time signal with quantized amplitudes xq(t) 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 x[n] (the same happens for x(t)) is ambiguous in the sense that it is widely used to represent both: a) the complete sequence and b) a sample at time n. In most scenarios both interpretations are valid because if someone provides an equation such as

x[n] = 3n,
(1.1)

which is valid for all n , this equation can be repeatedly used to reconstruct the whole sequence by varying n, or be interpreted as a single sample for a specific value n = n0. In some cases, to disambiguate the two interpretations, a notation such as x[n0] or x(t0) is adopted, where n0 and t0 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 x(t) into a digital signal xq[n], consisting of a sequence of quantized samples. The ADC executes two tasks:

Sampling depends on the adopted sampling frequency Fs, which is the number of samples extracted from the signal per time unit (more specifically, one second).3 For example, Fs = 8000 Hz corresponds to obtaining 8000 samples to represent each signal segment with a duration of 1 second. The higher Fs, the more accurate the representation tends to be.

Quantization depends on the number b of bits used to represent each sample. For example, if b = 2, each sample can be represented by only N = 4 distinct values: 00, 01, 10 and 11. The mapping between these binary values and amplitudes is somehow arbitrary. For example, 00 can represent 10 V while 01 can represent 5 V. In general, an ADC of b bits can output N = 2b distinct quantized values.

ADCs with large values for Fs and b are more expensive. Sometimes the tradeoff is to use a relatively large Fs with small b (e.g., Fs = 2.2 GHz with b = 10 bits) or vice-versa (e.g., Fs = 2.5 MHz with b = 24 bits).

The chip that performs the digital to analog conversion is called DAC. It also operates according to the values of Fs and b.

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 x(t). In this text we will learn how to properly choose Fs and b to control the A/D and D/A processes, in order to recover x(t) 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 x(t) 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.

PIC

Figure 1.3: Example of discrete-time signal x[n]. Note the abscissa is discrete, but the amplitude (ordinate) is not quantized.

Figure 1.3 illustrates a discrete-time signal. Note the abscissa is given in discrete-time n , similar to the notation adopted for digital signals. But for a discrete-time signal x[n], 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 x(t) = 6cos (2π400t) with amplitude 6 volts and a frequency fc = 400 Hz (the subscript c is just to indicate this is a specific and fixed frequency value). The goal is to use Fs = 8000 samples to represent each segment of one second, where Fs is the sampling frequency. The time interval between consecutive samples is Ts = 1Fs, which in this case is Ts = 18000 = 125 μs. Listing 1.1 illustrates one possible implementation.

Listing 1.1: MatlabOctaveCodeSnippets/snip_signals_signal_generation.m. [ Python version]
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
  

PIC

Figure 1.4: Example of a discrete-time cosine generated with Listing 1.1.

Figure 1.4 indicates the result of executing Listing 1.1. This cosine has a period of T = 1fc = 1400 = 2.5 ms. Therefore, each of its period is being represented by TTs = (2.5 × 103)(125 × 106) = 20 samples. Note in Figure 1.4 that, in this specific case, at each sample n = 20,40,60,, the sample x[0] = 6 at n = 0 is repeated, and a new cosine cicle starts.