Spectrum Cannot Be Displayed for Continuous or Infinite Sample Times
Original Signal Spectrum
To extract the original signal spectrum, an ideal low-pass filter (LPF) could be employed, which eliminates signal components outside its bandwidth, and this extraction operation equivalently leads to convolution operation in the time domain by a sinc function (note that inverse Fourier Transform of a rectangular function is a sinc function) thereby providing an interpolation of the discretely sampled time-domain values with an analog reconstruction.
From: Biomedical Signal Analysis for Connected Healthcare , 2021
Signal Sampling and Quantization
Li Tan , Jean Jiang , in Digital Signal Processing (Second Edition), 2013
2.1 Sampling of Continuous Signal
As discussed in Chapter 1, Figure 2.1 describes a simplified block diagram of a digital signal processing (DSP) system. The analog filter processes the analog input to obtain the band-limited signal, which is sent to the analog-to-digital conversion (ADC) unit. The ADC unit samples the analog signal, quantizes the sampled signal, and encodes the quantized signal level to the digital signal.
Here we first develop concepts of sampling processing in the time domain. Figure 2.2 shows an analog (continuous-time) signal (solid line) defined at every point over the time axis (horizontal line) and amplitude axis (vertical line). Hence, the analog signal contains an infinite number of points.
It is impossible to digitize an infinite number of points. The infinite points cannot be processed by the digital signal (DS) processor or computer, since they require an infinite amount of memory and infinite amount of processing power for computations. Sampling can solve such a problem by taking samples at a fixed time interval as shown in Figure 2.2 and Figure 2.3, where the time represents the sampling interval or sampling period in seconds.
As shown in Figure 2.3, each sample maintains its voltage level during the sampling interval to give the ADC enough time to convert it. This process is called sample and hold. Since there exits one amplitude level for each sampling interval, we can sketch each sample amplitude level at its corresponding sampling time instant shown in Figure 2.2, where 14 samples at their sampling time instants are plotted, each using a vertical bar with a solid circle at its top.
For a given sampling interval , which is defined as the time span between two sample points, the sampling rate is therefore given by
For example, if a sampling period is microseconds, the sampling rate is samples per second (Hz).
After obtaining the sampled signal whose amplitude values are taken at the sampling instants, the processor is able to process the sample points. Next, we have to ensure that samples are collected at a rate high enough that the original analog signal can be reconstructed or recovered later. In other words, we are looking for a minimum sampling rate to acquire a complete reconstruction of the analog signal from its sampled version. If an analog signal is not appropriately sampled, aliasing will occur, which causes unwanted signals in the desired frequency band.
The sampling theorem guarantees that an analog signal can be in theory perfectly recovered as long as the sampling rate is at least twice as large as the highest-frequency component of the analog signal to be sampled. The condition is described as
where is the maximum-frequency component of the analog signal to be sampled. For example, to sample a speech signal containing frequencies up to 4 kHz, the minimum sampling rate is chosen to be at least 8 kHz, or 8,000 samples per second; to sample an audio signal possessing frequencies up to 20 kHz, at least 40,000 samples per second, or 40 kHz, of the audio signal are required.
Figure 2.4 illustrates sampling of two sinusoids, where the sampling interval between sample points is seconds, and the sampling rate is thus Hz. The first plot in the figure displays a sine wave with a frequency of 40 Hz and its sampled amplitudes. The sampling theorem condition is satisfied since . The sampled amplitudes are labeled using the circles shown in the first plot. We notice that the 40-Hz signal is adequately sampled, since the sampled values clearly come from the analog version of the 40-Hz sine wave. However, as shown in the second plot, the sine wave with a frequency of 90 Hz is sampled at 100 Hz. Since the sampling rate of 100 Hz is relatively low compared with the 90-Hz sine wave, the signal is undersampled due to . Hence, the condition of the sampling theorem is not satisfied. Based on the sample amplitudes labeled with the circles in the second plot, we cannot tell whether the sampled signal comes from sampling a 90-Hz sine wave (plotted using the solid line) or from sampling a 10-Hz sine wave (plotted using the dot-dash line). They are not distinguishable. Thus they are aliases of each other. We call the 10-Hz sine wave the aliasing noise in this case, since the sampled amplitudes actually come from sampling the 90-Hz sine wave.
Now let us develop the sampling theorem in frequency domain, that is, the minimum sampling rate requirement for sampling an analog signal. As we shall see, in practice this can help us design the anti-aliasing filter (a lowpass filter that will reject high frequencies that cause aliasing) that will be applied before sampling, and the anti-image filter (a reconstruction lowpass filter that will smooth the recovered sample-and-hold voltage levels to an analog signal) that will be applied after the digital-to-analog conversion (DAC).
Figure 2.5 depicts the sampled signal obtained by sampling the continuous signal at a sampling rate of samples per second.
Mathematically, this process can be written as the product of the continuous signal and the sampling pulses (pulse train):
(2.1)
where is the pulse train with a period . From spectral analysis, the original spectrum (frequency components) and the sampled signal spectrum in terms of Hz are related as
(2.2)
where is assumed to be the original baseband spectrum while is its sampled signal spectrum, consisting of the original baseband spectrum and its replicas . Since Equation (2.2) is a well-known formula, the derivation is omitted here and can be found in well-known texts (Ahmed and Nataranjan, 1983; Ambardar, 1999; Alkin, 1993; Oppenheim and Schafer, 1975; Proakis and Manolakis, 1996).
Expanding Equation (2.2) leads to the sampled signal spectrum in Equation (2.3):
(2.3)
Equation (2.3) indicates that the sampled signal spectrum is the sum of the scaled original spectrum and copies of its shifted versions, called replicas. Three possible sketches based on Equation (2.3) can be obtained. Given the original signal spectrum plotted in Figure 2.6(a), the sampled signal spectrum according to Equation (2.3) is plotted in Figure 2.6(b), where the replicas , , , …, have separations between them. Figure 2.6(c) shows that the baseband spectrum and its replicas, , , , …, are just connected, and finally, in Figure 2.6(d), the original spectrum and its replicas , , …, are overlapped; that is, there are many overlapping portions in the sampled signal spectrum.
From Figure 2.6, it is clear that the sampled signal spectrum consists of the scaled baseband spectrum centered at the origin, and its replicas centered at the frequencies of (multiples of the sampling rate) for each of .
If applying a lowpass reconstruction filter to obtain exact reconstruction of the original signal spectrum, the following condition must be satisfied:
(2.4)
Solving Equation (2.4) gives
(2.5)
In terms of frequency in radians per second, Equation (2.5) is equivalent to
(2.6)
This fundamental conclusion is well known as the Shannon sampling theorem, which is formally described below:
For a uniformly sampled DSP system, an analog signal can be perfectly recovered as long as the sampling rate is at least twice as large as the highest-frequency component of the analog signal to be sampled.
We summarize two key points here.
- 1.
-
The sampling theorem establishes a minimum sampling rate for a given band-limited analog signal with highest-frequency component . If the sampling rate satisfies Equation (2.5), then the analog signal can be recovered via its sampled values using the lowpass filter, as described in Figure 2.6(b).
- 2.
-
Half of the sampling frequency is usually called the Nyquist frequency (Nyquist limit) or folding frequency. The sampling theorem indicates that a DSP system with a sampling rate of can ideally sample an analog signal with a maximum frequency that is up to half of the sampling rate without introducing spectral overlap (aliasing). Hence, the analog signal can be perfectly recovered from its sampled version.
Let us study the following example.
EXAMPLE 2.1
Suppose that an analog signal is given as
and is sampled at the rate 8,000 Hz.
- a.
-
Sketch the spectrum for the original signal.
- b.
-
Sketch the spectrum for the sampled signal from 0 to 20 kHz.
Solution
a. Since the analog signal is sinusoid with a peak value of 5 and frequency of 1,000 Hz, we can write the sine wave using Euler's identity:
which is a Fourier series expansion for a continuous periodic signal in terms of the exponential form (see Appendix B). We can identify the Fourier series coefficients as
Using the magnitudes of the coefficients, we then plot the two-side spectrum as shown in Figure 2.7A.
b. After the analog signal is sampled at the rate of 8,000 Hz, the sampled signal spectrum and its replicas centered at the frequencies , each with a scaled amplitude of , are as shown in Figure 2.7B:
Notice that the spectrum of the sampled signal shown in Figure 2.7B contains the images of the original spectrum shown in Figure 2.7A; that the images repeat at multiples of the sampling frequency (for our example, 8 kHz, 16kHz, 24kHz, …); and that all images must be removed, since they convey no additional information.
Read full chapter
URL:
https://www.sciencedirect.com/science/article/pii/B9780124158931000020
Signal Sampling and Distortion
Tony J. Rouphael , in Wireless Receiver Architectures and Design, 2014
5.1.1 Sampling and reconstruction of lowpass signals
In this section, we discuss the sampling of lowpass signals as well as the required antialiasing filters needed to obtain a certain desired signal-to-noise ratio (SNR). The reconstruction of the sampled lowpass signal into an analog signal is then presented.
5.1.1.1 Lowpass sampling and filtering requirements
In order to faithfully reconstruct an analog signal from its digital counterpart, the sampling theorem dictates that the lowpass signal must be sampled at least at twice the highest frequency component of the analog bandlimited signal. As will be seen later, this condition simply implies that the spectral replicas that occur due to sampling do not overlap and hence cause no distortion to the reconstructed analog signal. This in turn implies that all the information in the original analog signal is preserved.
To proceed, consider the lowpass analog signal x a (t) that for the purposes of this discussion is strictly bandlimited with a frequency upper bound of B/2. Strictly bandlimited in this discussion implies that the highest frequency component of x a (t) is strictly less than B/2 or X a (F) ≠ 0 for −B/2 < F < B/2 where B is called the Nyquist rate.
Consider the Fourier transform of the analog signal x a (t)
(5.1)
The frequency domain signal can also be used to recover the time-domain analog signal via the inverse Fourier transform:
(5.2)
The analog time-domain signal can then be sampled at the sampling rate of T s samples per seconds resulting in the discrete-time signal
(5.3)
In a similar manner to Eqn (5.2), the spectrum of x(n) can be obtained using the Fourier transform of discrete aperiodic signals as [1,2]
(5.4)
In a similar manner to the analog case, the discrete signal presented in Eqn (5.4) can be obtained by applying the inverse Fourier transform:
(5.5)
According to the relationships presented in Eqns (5.2) and (5.5), we can relate the analog signal spectrum to the discrete signal spectrum as
(5.6)
From Eqn (5.6), we can imply that due to periodic sampling the analog and discrete frequencies are related according to the relationship
(5.7)
Thus if we compare Eqns (5.5) and (5.6), we obtain
(5.8)
In order to further our understanding of the relationship presented in Eqn (5.8), the integral on the right-hand side can be expanded as an infinite sum of integrals
(5.9)
Note that in Eqn (5.9), the signal X a (F) over the interval [(l − 1/2)F s , (l + 1/2)F s ] is equivalent to X a (F + lF s ) in the integration interval [−F s /2, F s /2 s ]. The summation term in Eqn (5.9) can be further expanded as
(5.10)
The term on the right-hand side of Eqn (5.10) can be further manipulated by swapping the integral and summation signs as
(5.11)
where the exponential in Eqn (5.11) has been reduced since we can satisfy .
A comparison between Eqns (5.8) and (5.11) reveals that
(5.12)
A comparison between the right- and left-hand sides of Eqn (5.12) shows that
(5.13)
Or in terms of normalized frequency, the relationship in Eqn (5.13) can be written as
(5.14)
A close examination of the discrete spectrum X(f) in Eqn (5.14) reveals that it is made up of replicas of the analog spectrum X a (F) scaled by the sampling frequency F s and periodically shifted in frequency. The sampling process is illustrated in Figure 5.1.
Thus far, we have shown according to Eqn (5.14) that the discrete spectrum is made up of a series of periodic replicas of the analog spectrum with spacing dependent on the sampling frequency F s . If the sampling frequency is chosen such that it is greater than the bandwidth of the signal, that is, F s > B, where B is the intermediate frequency (IF) signal bandwidth, then the analog signal can in theory be accurately reconstructed without loss of information from the discrete-time samples. 1 As mentioned earlier, the particular frequency for which F Nyquist = B is known as the Nyquist rate. If, on the other hand, the sampling frequency is chosen such that F s < B, then the aliased replicas of the spectrum overlap the desired signal spectrum as shown in Figure 5.2(a) and degradation ensues. In other words, the discrete spectrum is made up of overlapped replicas of the original spectrum scaled by the sampling frequency. In this case, the analog signal reconstructed from the aliased signal spectrum is not an exact replica of the original signal spectrum as shown in Figure 5.2(b). In this case, the sampled signal does not faithfully represent the information present in the analog signal.
In practice, in addition to the proper choice of sampling frequency, an important aspect of managing the amount of degradation due to aliasing is limiting the amount of out-of-band energy that is allowed to fold over onto the desired signal's band. Although the desired signal impinging at the antenna is bandlimited, it is typically accompanied by out-of-band signal components from within the desired signaling band as well as from outside of it. These signals are either blockers or interferers. The band definition filter that precedes the low noise amplifier (LNA) usually attenuates the signals and interferers that exist out of the signaling band. The received signals and interferers are further manipulated and conditioned throughout the receive chain by a variety of analog linear and nonlinear blocks. All throughout, noise and new signals due to nonlinearities may arise in or around the desired signal's band. The last line of defense on the analog side is the antialiasing filter. The effectiveness of the antialiasing filter is measured by its attenuation outside the desired signal band. Any blockers or interferers that are more than ½ least significant bit (LSB) in relative strength can fold over onto the desired signal's band and cause distortion to the desired signal's SNR. Whether the aliased energy itself falls within the signal's bandwidth or not depends on its frequency location and on the sampling rate of the ADC [3].
Depending on the number of bits in the ADC, it may not be reasonable to expect the antialiasing filter to attenuate all nondesired out-of-band signals to less than ½ LSB. This stringent filtering requirement may be alleviated by oversampling the ADC and further spreading apart the spectral replicas. Digital filtering can then be used to further attenuate some of the nondesired signal blockers and interferers. This in turn serves to reduce the complexity of the antialiasing filter at the cost of running the ADC and digital circuits at a higher clock rate and adding more complexity to the digital signal processing. All in all, an architectural trade-off between the analog and digital signal processing must be performed to properly manage the out-of-band degradation to provide an acceptable desired signalSNR.
5.1.1.2 Reconstruction of lowpass signals from discrete samples
Next, we examine the reconstruction of the analog lowpass signals from digital samples. Consider the Fourier transform of the analog signal x a (t)
(5.15)
and the discrete-time signal sampled at the Nyquist rate F s = B
(5.16)
The Fourier transform of is given as
(5.17)
Then the reconstructed analog signal can be obtained by substituting Eqn (5.17) into Eqn (5.16) and then substituting the result into Eqn (5.15), that is
(5.18)
The order of the integral and the summation given in Eqn (5.18) can be further rearranged to obtain
(5.19)
The sine function divided by its argument is the sin c function shifted in time by the sampling period. Define the sin c function in Eqn (5.19) as p(t) and its frequency domain equivalent as P(F), or
(5.20)
From Eqn (5.20), it is obvious that the sin c function plays the role of an ideal interpolation filter that when applied to the signal spectrum of a nonaliased discrete-time signal recovers the original analog signal without degradation or
(5.21)
This process is illustrated in Figure 5.3 and shows the ideal filter's role in recovering the spectrum of the original analog signal.
Read full chapter
URL:
https://www.sciencedirect.com/science/article/pii/B9780123786401000056
Basic Transform Video Coding
Barry Barnett , in The Essential Guide to Video Processing, 2009
8.3.1 Sampling of Analog Video Signals
Digital video information is generated by sampling the intensity of the original continuous analog video signal I (x, y, t) in three dimensions. The spatial component of the video signal is sampled in the horizontal and vertical dimensions (x, y), and the temporal component is sampled in the time dimension (t). This generates a series of digital images or image sequence I(i,j,k). Video signals that contain colorized information are usually decomposed into three parameters (YC r C b , YUV, RGB, etc.) whose intensities are likewise sampled in three dimensions. The sampling process inherently quantizes the video signal due to the digital word precision used to represent the intensity values. Therefore, the original analog signal can never be reproduced exactly, but for all intents and purposes, a high-quality digital video representation can be reproduced with arbitrary closeness to the original analog video signal. The topic of video sampling and interpolation is discussed in Chapter 2.
An important result of sampling theory is the Nyquist Sampling Theorem. This theorem defines the conditions under which sampled analog signals can be "perfectly" reconstructed. If these conditions are not met, the resulting digital signal will contain aliased components, which introduce artifacts into the reconstruction. The Nyquist conditions are depicted graphically for the one-dimensional (1D) case in Fig. 8.2.
The 1D signal l is sampled at rate fs . It is band limited (as are all real world signals) in the frequency domain with an upper frequency bound of f B. According to the Nyquist Sampling Theorem, if a band-limited signal is sampled, the resulting Fourier spectrum is made up of the original signal spectrum | L| plus replicates of the original spectrum spaced at integer multiples of the sampling frequency fs . Figure 8.2(a) depicts the magnitude |L| of the Fourier spectrum for l. The magnitude of the Fourier spectrum |Ls | for the sampled signal ls is shown for two cases. Figure 8.2(b) presents the case where the original signal l can be reconstructed by recovering the central spectral island. Figure 8.2(c) shows the case where the Nyquist sampling criteria has not been met and spectral overlap occurs. The spectral overlap is termed aliasing and occurs when . When , the original signal can be reconstructed by using a low-pass digital filter whose pass band is designed to recover |L|. These relationships provide a basic framework for the analysis and design of digital signal processing systems.
2D or spatial sampling is a simple extension of the 1D case. The Nyquist criteria have to be obeyed in both dimensions, that is, the sampling rate in the horizontal direction must be two times greater than the upper frequency bound in the horizontal direction, and the sampling rate in the vertical direction must be two times greater than the upper frequency bound in the vertical direction. In practice, spatial sampling grids are square so that an equal number of samples per unit length in each direction are collected. Charge coupled devices (CCDs) are typically used to spatially sample analog imagery and video. The sampling grid spacing of these devices is more than sufficient to meet the Nyquist criteria for most resolution and application requirements. The electrical characteristics of CCDs have a greater effect on the image or video quality than its sampling grid size.
Temporal sampling of video signals is accomplished by capturing a spatial or image frame in the time dimension. The temporal samples are captured at a uniform rate of about 60 fields per second for NTSC television and 24 fps for a motion film recording. These sampling rates are significantly less than the spatial sampling rate. The maximum temporal frequency that can be reconstructed according to the Nyquist frequency criteria is 30 Hz in the case of television broadcast. Therefore, any rapid intensity change (caused for instance by a moving edge) between two successive frames will cause aliasing because the harmonic frequency content of such a step-like function exceeds the Nyquist frequency. Temporal aliasing of this kind can be greatly mitigated in CCDs by the use of low-pass temporal filtering to remove the high-frequency content. Photoconductor Storage Tubes are used for recording broadcast television signals. They are analog scanning devices whose electrical characteristics filter the high-frequency temporal content and minimize temporal aliasing. Indeed, motion picture film also introduces low-pass filtering when capturing image frames. The exposure speed and the response speed of the photo chemical film combine to mitigate high-frequency content and temporal aliasing. These factors cannot completely stop temporal aliasing, and so intelligent use of video recording devices is still warranted, for example, the main reason movie camera panning is done very slowly is to minimize temporal aliasing.
In many cases where fast motions or moving edges are not well resolved due to temporal aliasing, the HVS will interpolate such motion and provide its own perceived reconstruction. The HVS is very tolerant of temporal aliasing by using its own knowledge of natural motion to provide motion estimation and compensation to the image sequences generated by temporal sampling. The combination of temporal filtering in sampling systems and the mechanisms of human visual perception reduce the effects of temporal aliasing such that temporal under sampling (sub-Nyquist sampling) is acceptable in the generation of typical image sequences intended for general purpose use.
Read full chapter
URL:
https://www.sciencedirect.com/science/article/pii/B9780123744562000104
Signal Analysis in the Frequency Domain—Implications and Applications
John Semmlow , in Circuits, Signals and Systems for Bioengineers (Third Edition), 2018
4.2.1 Data Sampling: The Sampling Theorem
Slicing the signal into discrete time intervals (usually evenly spaced) is a process known as sampling and is described in Chapter 1 (see Figures 1.5 and 1.6 Figures 1.5 Figures 1.6 ). Sampling is a nonlinear process and has some peculiar effects on the signal's spectrum. Figure 4.1A shows an example of a magnitude frequency spectrum of a hypothetical 1.0-second periodic, continuous signal, as determined using continuous Fourier series analysis. The fundamental frequency is 1/T = 1 Hz and the first 10 harmonics are plotted out to 10 Hz. For this particular signal, there is little energy above 7.0 Hz.
If we apply the mathematics describing the sampling to the Fourier transform, we find that the sampling process produces many additional frequencies that were not in the original signal. After sampling at 20 Hz, the sampled magnitude spectrum, now plotted over a larger frequency range, is shown in Figure 4.1B. Only a portion can be shown because the sampled spectrum is, theoretically, infinite. The new spectrum is itself periodic, with a period equal to the sample frequency, f s (in this case 20 Hz). The spectrum also contains negative frequencies (it is, after all, a theoretical spectrum). It has even symmetry about f = 0.0 Hz as well as about both positive and negative multiples of f s . Finally, the portion between 0 and 20 Hz also has even symmetry about the center frequency, f s /2 (in this case 10 Hz).
The spectrum of the sampled signal is certainly bizarre, but comes directly out of the mathematics of sampling as described in Chapter 5 (Section 5.7.1). When we sample a continuous signal, we effectively multiply the original signal by a periodic impulse function (with period f s ) and that multiplication process produces all those additional frequencies. Even though the negative frequencies are mathematical constructs, their effects are felt because they are responsible for the symmetrical frequencies above f s /2 as clearly noted in Figure 3.21. If the sampled signal's spectrum is different from the original signal's spectrum, it stands to reason that the sampled signal is different from the original. If the sampled signal is not the same as the original and we cannot somehow link the two, then digital signal processing is a lost cause. We would be processing something unrelated to the original signal. The critical question is: given that the sampled signal is different from the original, can we find some way to reconstruct the original signal from the sampled signal? The frequency domain version of that question is: can we reconstruct the unsampled spectrum from the sampled spectrum? The definitive answer is: maybe, but it depends on things we can understand and measure.
Figure 4.2 shows just one period of the spectrum shown in Figure 4.1B, the period between 0 and f s Hz. In fact, this is the only portion of the spectrum that can be calculated by the discrete Fourier transform (DFT); all the other frequencies shown in Figure 4.1B are theoretical (but not inconsequential). Comparing this spectrum to the spectrum of the original signal, Figure 4.1A, we see that the two are the same for the first half of the spectrum, that is, up to f s /2. The second half is just the mirror image of the first half. These mirror image frequencies are just the negative frequencies reflected back from f s .
The mirror image frequencies, those above fs /2, were not part of the original signal. But the lower frequencies, those below f s /2, are in the original spectrum. So if we somehow got rid of all frequencies above f s /2, we would have our original spectrum. We can get rid of the frequencies above f s /2 by filtering them out. Just knowing that it is possible to get back to the original spectrum is sufficient to justify our sampled computer data; we just ignore the frequencies above f s /2. The frequency f s /2 is so important it has its own name: the "Nyquist 1 frequency."
This strategy of just ignoring all frequencies above the Nyquist frequency (f s /2) works well and is the approach that is commonly adopted. But it can be used only if the original signal does not have spectral components at or above f s /2. Consider a situation in which four sinusoids with respective frequencies of 100, 200, 300, and 400 Hz are sampled at a frequency of 1000 Hz. The spectrum produced after sampling actually contains eight frequencies, Figure 4.3A: the four original frequencies plus the four mirror image frequencies reflected about f s /2 = 500 Hz. As long as we know, in advance, that the sampled signal does not contain any frequencies above the Nyquist frequency (500 Hz), we do not have a problem: we know that the first four frequencies are those of the signal and the second four, above the Nyquist frequency, are the reflections, which can be ignored. However, a problem occurs if the signal contains frequencies higher than the Nyquist frequency. The reflections of these high-frequency components will be reflected back into the lower half of the spectrum. This is shown in Figure 4.3B where the signal now contains two additional frequencies at 650 and 850 Hz. These frequency components have their reflections in the lower half of the spectrum: at 350 and 150 Hz, respectively. It is now no longer possible to determine if the 350 and 150 Hz signals are part of the true spectrum of the signal (i.e., the spectrum of the signal before it was sampled) or whether these are reflections of signals with frequency components greater than f s /2 (which in fact they are). Both halves of the spectrum now contain mixtures of frequencies above and below the Nyquist frequency, and it is impossible to know where they really belong. This confusing condition is known as "aliasing." The only way to resolve this ambiguity is to ensure that all frequencies in the original signal are less than the Nyquist frequency.
If the original signal contains frequencies above the Nyquist frequency, then you cannot determine the original spectrum from what you have in the computer and you cannot reconstruct the original analog signal from the one in the computer. The frequencies above the Nyquist frequency have hopelessly corrupted the signal stored in the computer. Fortunately, the converse is also true. If there are no corrupting frequency components in the original signal (i.e., the signal contains no frequencies above half the sampling frequency), the spectrum in the computer can be adjusted to match the original signal's spectrum if we eliminate or disregard the frequencies above the Nyquist frequency. (Elimination of frequencies above the Nyquist frequency can be achieved by low-pass filtering, and the original signal can be reconstructed.) This leads to the famous "Sampling Theorem" of Shannon: the original signal can be recovered from a sampled signal provided the sampling frequency is more than twice the maximum frequency 2 contained in the original:
(4.1)
Usually the sampling frequency is under software control, and it is up to the biomedical engineer doing the sampling to ensure that f s is high enough. To make elimination of the unwanted higher frequencies easier, it is common to sample at three to five times f max . This increases the spacing between the frequencies in the original signal and those generated by the sampling process, Figure 4.4. The temptation to set f s higher than is really necessary is strong, and it is a strategy often pursued. However, excessive sampling frequencies lead to large data storage and processing requirements that needlessly overtax the computer system.
The concepts behind sampling and the sampling theorem can also be described in the time domain. Consider a single sinusoid. (Since all periodic waveforms can be broken into sinusoids, the influence of sampling on a single sinusoid can be extended to cover any general waveform.) In the time domain, Shannon's sampling theorem states that a sinusoid can be accurately reconstructed as long as two or more (evenly spaced) samples are taken over its period. This is equivalent to saying that f s must greater than 2 f sinusoid . Figure 4.5 shows a main sine wave (solid line) defined by two samples per cycle (black circles). The Shannon sampling theorem states that no other sinusoids of a lower frequency can pass through both these points, so these two samples uniquely define this sine wave. This spacing would also uniquely define any sine wave that was of a lower frequency. However, there are many higher frequency sine waves that can pass cleanly through these two points, two of which are shown in Figure 4.5 as dashed and dotted lines. The two higher frequency sine waves shown are second and third harmonics of the main sine wave. In fact, all the higher harmonics of the main sine wave would pass though these two points, so there are an infinite number of higher frequencies defined by the 2 samples. These higher frequency sine waves give rise to the added points in the sample spectrum as shown in Figure 4.1; they are the source of the additional frequencies. 3
Figure 4.6 illustrates aliasing using an undersampled sine wave. A 5 Hz sine wave is sampled at 7 samples/s, so f s /2 = 3.5 Hz. A 2 Hz sine wave (dotted line) also passes through the seven points. This is predicted by aliasing: the 5 Hz sine reflected about f s would be 7 − 5 = 2 Hz.
Aliasing can also be observed in images. Figure 4.7 shows two image pairs: the left images are correctly sampled and the right images are undersampled. The upper images are of a sine wave that increases in spatial frequency going from left to right. This is the image version of a "chirp" signal that increases in frequency over time. The left image shows the expected smooth progression of sinusoidal bars. The right image is fine for the lower spatial frequencies, but as spatial frequency increases, additional frequencies are created because of aliasing, disrupting the progression. The lower images are MR images of the brain and the undersampled image shows jagged diagonals and a type of moiré pattern that is characteristic of undersampled images.
Example 4.1
Construct a signal consisting of three sine waves at 100, 200, and 350 Hz. Find and plot the magnitude spectrum of this signal assuming two different sampling frequencies: f s = 800 and 500 Hz. Use an N of 512 points and label and scale the frequency axes. Plot only valid (i.e., N/2) points.
Solution: Use a loop to operate on the two sampling frequencies. Construct a time vector and a frequency vector with the appropriate sampling frequency. Use the time vector to construct the signal as the sum of three sine waves and the frequency vector for plotting. Find the magnitude spectrum and plot only N/2 points.
% Example 4.1 Example of aliasing.
%
N = 512; % Number of points, N
N2 = N/2; % Half N
fs = [800 500]; % Sample frequencies
for k = 1:2
t = (0:N-1)/fs(k); % Time vector
f = (1:N)∗fs(k)/N; % Frequency vector
x = sin(2∗pi∗100∗t) + sin(2∗pi∗200∗t) + sin(2∗pi∗350∗t); % Signal
Xmag = abs(fft(x)); % Magnitude spectrum
subplot(1,2,k);
plot(f(1:N2),Xmag(1:N2),'k'); % Plot magnitude spectrum
.......labels and title........
end
Results: The two spectra are shown in Figure 4.8. In both cases, f max is 350 Hz. When f s > 2 f max (i.e., 700 Hz), the three peaks are found at the correct frequencies: 100, 200, and 350 Hz, Figure 4.8A. When the sampling frequency is reduced to 500 Hz, f s is now < 2 f max . Consequently, the peak at 350 Hz manifests as a false peak at 150 Hz, Figure 4.8B. (Note: 500 − 350 = 150 Hz). This is a classic example of aliasing.
Read full chapter
URL:
https://www.sciencedirect.com/science/article/pii/B9780128093955000047
Converting analog to digital signals and vice versa
Edmund Lai PhD, BEng , in Practical Digital Signal Processing, 2003
2.2 Sampling
We shall first consider the sampling operation. It can be illustrated through the changing temperature through a single day. The continuous temperature variation is shown in Figure 2.2. However, the observatory may only be recording the temperature once every hour.
The records are shown in Table 2.1. When we plot these values against time, we have a snapshot of the variation in temperature throughout the day. These snapshots are called samples of the signal (temperature). They are plotted as dots in Figure 2.2. In this case the sampling interval, the time between samples, is two hours.
Hour | Temperature |
---|---|
0 | 13 |
2 | 12 |
4 | 10 |
6 | 11 |
8 | 13 |
10 | 16 |
12 | 19 |
14 | 23 |
16 | 22 |
18 | 20 |
20 | 16 |
22 | 15 |
24 | 12 |
Figure 2.3 shows the diagram representation of the sampling process.
The analog signal is sampled once every T seconds, resulting in a sampled data sequence. The sampler is assumed to be ideal in that the value of the signal at an instant (an infinitely small time) is taken. A real sampler, of course, cannot achieve that and the 'switch' in the sampler is actually closed for a finite, though very small, amount of time. This is analogous to a camera with a finite shutter speed. Even if a camera can be built with an infinitely fast shutter, the amount of light that can reach the film plane will be very small indeed. In general, we can consider the sampling process to be close enough to the ideal.
It should be pointed out that throughout our discussions we should assume that the sampling interval is constant. In other words, the spacing between the samples is regular. This is called uniform sampling. Although irregularly sampled signals can, under suitable conditions, be converted to uniformly sampled ones, the concept and mathematics are beyond the scope of this introductory book.
The most important parameter in the sampling process is the sampling period T, or the sampling frequency or sampling rate f s, which is defined as
Sampling frequency is given in units of 'samples per second' or 'hertz'. If the sampling is too frequent, then the DSP process will have to process a large amount of data in a much shorter time frame. If the sampling is too sparse, then important information might be missing in the sampled signal. The choice is governed by sampling theorem.
2.2.1 Sampling theorem
The sampling theorem specifies the minimum-sampling rate at which a continuous-time signal needs to be uniformly sampled so that the original signal can be completely recovered or reconstructed by these samples alone. This is usually referred to as Shannon's sampling theorem in the literature.
Sampling theorem:
If a continuous time signal contains no frequency components higher than W hz, then it can be completely determined by uniform samples taken at a rate f s samples per second where
or, in term of the sampling period
A signal with no frequency component above a certain maximum frequency is known as a bandlimited signal. Figure 2.4 shows two typical bandlimited signal spectra: one low-pass and one band-pass.
The minimum sampling rate allowed by the sampling theorem (f s = 2W) is called the Nyquist rate.
It is interesting to note that even though this theorem is usually called Shannon's sampling theorem, it was originated by both E.T. and J.M. Whittaker and Ferrar, all British mathematicians. In Russian literature, this theorem was introduced to communications theory by Kotel'nikov and took its name from him. C.E. Shannon used it to study what is now known as information theory in the 1940s. Therefore in mathematics and engineering literature sometimes it is also called WKS sampling theorem after Whittaker, Kotel'nikov and Shannon.
2.2.2 Frequency domain interpretation
The sampling theorem can be proven and derived mathematically. However, a more intuitive understanding of it could be obtained by looking at the sampling process from the frequency domain perspective.
If we consider the sampled signal as an analog signal, it is obvious that the sampling process is equivalent to very drastic chopping of the original signal. The sharp rise and fall of the signal amplitude, just before and after the signal sample instants, introduces a large amount of high frequency components into the signal spectrum.
It can be shown through Fourier transform (which we will discuss in Chapter 4 ) that the high frequency components generated by sampling appear in a very regular fashion. In fact, every frequency component in the original signal spectrum is periodically replicated over the entire frequency axis. The period at which this replication occurs is determined by the sampling rate.
This replication can easily be justified for a simple sinusoidal signal. Consider a single sinusoid:
Before sampling, the spectrum consists of a single spectral line at frequency f a. Sampling is performed at time instants
where n is a positive integer. Therefore, the sampled sinusoidal signal is given by
At a frequency
The sampled signal has value
which is the same as the original sampled signal. Hence, we can say that the sampled signal has frequency components at
This replication is illustrated in Figure 2.5.
Although it is only illustrated for a single sinusoid, the replication property holds for an arbitrary signal with an arbitrary spectrum. Replication of the signal spectrum for a low-pass bandlimited signal is shown in Figure 2.6.
Consider the effect if the sampling frequency is less than twice the highest frequency component as required by the sampling theorem. As shown in Figure 2.7, the replicated spectra overlap each other, causing distortion to the original spectrum. Under this circumstance, the original spectrum can never be recovered faithfully. This effect is known as aliasing.
If the sampling frequency is at least twice the highest frequency of the spectrum, the replicated spectra do not overlap and no aliasing occurs. Thus, the original spectrum can be faithfully recovered by suitable filtering.
2.2.3 Aliasing
The effect of aliasing on an input signal can be demonstrated by sampling a sine wave of frequency f a using different sampling frequencies. Figure 2.8 shows such a sinusoidal function sampled at three different rates: f s = 4f a, f s = 2f a, and f s = 1.5f a.
In the first two cases, if we join the sample points using straight lines, it is obvious that the basic 'up–down' nature of the sinusoid is still preserved by the resulting triangular wave as shown in Figure 2.9.
If we pass this triangular wave through a low-pass filter, a smooth interpolated function will result. If the low-pass filter has the appropriate cut-off frequency, the original sine wave can be recovered. This is discussed in detail in section 2.5.
For the last case, the sampling frequency is below the Nyquist rate. We would expect aliasing to occur. This is indeed the case. If we join the sampled points together, it can be observed that the rate at which the resulting function repeats itself differs from the frequency of the original signal. In fact, if we interpolate between the sample points, a smooth function with a lower frequency results, as shown in Figure 2.10.
Therefore, it is no longer possible to recover the original sine wave from these sampled points. We say that the higher frequency sine wave now has an 'alias' in the lower frequency sine wave inferred from the samples. In other words, these samples are no longer representative of the input signal and therefore any subsequent processing will be invalid.
Notice that the sampling theorem assumes that the signal is strictly bandlimited. In the real world, typical signals have a wide spectrum and are not bandlimited in the strict sense. For instance, we may assume that 20 kHz is the highest frequency the human ears can detect. Thus, we want to sample at a frequency slightly above 40 kHz (say, 44.1 kHz as in compact discs) as dictated by the sampling theorem. However, the actual audio signals normally have a much wider bandwidth than 20 kHz. We can ensure that the signal is bandlimited at 20 kHz by low-pass filtering. This low-pass filter is usually called anti-alias filter.
2.2.4 Anti-aliasing filters
Anti-aliasing filters are always analog filters as they process the signal before it is sampled. In most cases, they are also low-pass filters unless band-pass sampling techniques are used. (Band-pass sampling is beyond the scope of this book.)
The sampling process incorporating an ideal low-pass filter as the anti-alias filter is shown in Figure 2.11. The ideal filter has a flat passband and the cut-off is very sharp. Since the cut-off frequency of this filter is half of that of the sampling frequency, the resulting replicated spectrum of the sampled signal do not overlap each other. Thus no aliasing occurs.
Practical low-pass filters cannot achieve the ideal characteristics. What are the implications? Firstly, this would mean that we have to sample the filtered signals at a rate that is higher than the nyquist rate to compensate for the transition band of the filter. The bandwidth of a low-pass filter is usually defined as the 3 dB point (the frequency at which the magnitude response is 3 dB below the peak level in the passband). However, signal levels below 3 dB are still quite significant for most applications. For the audio signal application example in the previous section, it may be decided that, signal levels below 40 dB will cause insignificant aliasing. The anti-aliasing filter used may have a bandwidth of 20 kHz but the response is 40 dB down starting from 24 kHz. This means that the minimum sampling frequency has to be increased to 48 kHz instead of 40 kHz for the ideal filter.
Alternatively, if we fix the sampling rate, then we need an anti-alias filter with a sharper cut-off. Using the same audio example, if we want to keep the sampling rate at 44.1 kHz, the anti-aliasing filter will need to have an attenuation of 40 dB at about 22 kHz. With a bandwidth of 20 kHz, the filter will need a transition from 3 dB at down to 40 dB within 2 kHz. This typically means that a higher order filter will be required. A higher order filter also implies that more components are needed for its implementation.
2.2.5 Practical limits on sampling rates
As discussed in previous sections, the practical choice of sampling rate is determined by two factors for a certain type of input signal. On one hand, the sampling theorem imposes a lower bound on the allowed values of the sampling frequency. On the other hand, the economics of the hardware imposes an upper bound. These economics include the cost of the analog-to-digital converter (ADC) and the cost of implementing the analog anti-alias filter. A higher speed ADC will allow a higher sampling frequency but may cost substantially more. However, a lower sampling frequency will put a more stringent requirement on the cut-off of the anti-aliasing filter, necessitating a higher order filter and a more complex circuit, which again may cost more.
In real-time applications, each sample is acquired (sampled), quantized and processed by a DSP. The output samples may need to be converted back to analog form. A higher sampling rate will mean that there are more samples to be processed within a certain amount of time. If T proc represents the total DSP processing time, then the time interval between samples T s will need to be greater than T proc. Otherwise, the processor will not be able to keep up. This means that if we increase the sampling rate we will need a higher speed DSP chip.
2.2.6 Mathematical representation
A mathematical representation of the sampling process (and any other process involved in DSP for that matter) is needed so that we can describe precisely the process and will help us in the analysis of DSP.
The sampling process can be described as a multiplication of the analog signal with a periodic impulse function. This impulse function is also known as the dirac delta function and is usually denoted by δ(t). It is shown in Figure 2.12.
It can be considered as a rectangular pulse with zero duration and infinite amplitude. It has the property that the energy or the area under the pulse is equal to one. This is expressed as
Thus, a weighted or scaled impulse function would be defined as one that satisfies
The weighted impulse function is drawn diagrammatically as an arrow with a height proportional to the scaling factor.
The periodic train of impulse functions is expressed as
where T s is the amount of time between two impulses. In terms of sampling, it is the sampling period.
If the input analog signal is denoted by f(t), then the sampled signal is given by
or the samples of the output of the sampling process are
Sometimes the sampling period is understood and we just use y(n) to denote y(nT s). This mathematical representation will be used again and again in later chapters of this course.
Read full chapter
URL:
https://www.sciencedirect.com/science/article/pii/B9780750657983500023
Source: https://www.sciencedirect.com/topics/engineering/original-signal-spectrum
0 Response to "Spectrum Cannot Be Displayed for Continuous or Infinite Sample Times"
Post a Comment