Understanding Analytic Signal and Hilbert Transform

Key focus of this article: Understand the relationship between analytic signal, Hilbert transform and FFT. Hands-on demonstration using Python and Matlab.

Introduction

Fourier Transform of a real-valued signal is complex-symmetric. It implies that the content at negative frequencies are redundant with respect to the positive frequencies. In their works, Gabor [1] and Ville [2], aimed to create an analytic signal by removing redundant negative frequency content resulting from the Fourier transform. The analytic signal is complex-valued but its spectrum will be one-sided (only positive frequencies) that preserved the spectral content of the original real-valued signal. Using an analytic signal instead of the original real-valued signal, has proven to be useful in many signal processing applications. For example, in spectral analysis, use of analytic signal in-lieu of the original real-valued signal mitigates estimation biases and eliminates cross-term artifacts due to negative and positive frequency components [3].

This article is part of the following books
Digital Modulations using Matlab : Build Simulation Models from Scratch, ISBN: 978-1521493885
Digital Modulations using Python ISBN: 978-1712321638
Wireless communication systems in Matlab ISBN: 979-8648350779
All books available in ebook (PDF) and Paperback formats

Continuous-time analytic signal

Let be a real-valued non-bandlimited finite energy signal, for which we wish to construct a corresponding analytic signal .  The Continuous Time Fourier Transform of is given by

Lets say the magnitude spectrum of is as shown in Figure 1(a). We note that the signal is a real-valued and its magnitude spectrum is symmetric and extends infinitely in the frequency domain.

(a) Spectrum of continuous signal x(t) and (b) spectrum of analytic signal z(t)
Figure 1: (a) Spectrum of continuous signal x(t) and (b) spectrum of analytic signal z(t)

As mentioned in the introduction, an analytic signal can be formed by suppressing the negative frequency contents of the Fourier Transform of the real-valued signal. That is, in frequency domain, the spectral content of the analytic signal is given by

The corresponding spectrum of the resulting analytic signal is shown in Figure 1(b).

Since the spectrum of the analytic signal is one-sided, the analytic signal will be complex valued in the time domain, hence the analytic signal can be represented in terms of real and imaginary components as . Since the spectral content is preserved in an analytic signal, it turns out that the real part of the analytic signal in time domain is essentially the original real-valued signal itself . Then, what takes place of the imaginary part ? Who is the companion to x(t) that occupies the imaginary part in the resulting analytic signal ? Summarizing as equation,

It is interesting to note that Hilbert transform [4] can be used to find a companion function (imaginary part in the equation above) to a real-valued signal such that the real signal can be analytically extended from the real axis to the upper half of the complex plane . Denoting Hilbert transform as , the analytic signal is given by

From these discussion, we can see that an analytic signal for a real-valued signal , can be constructed using two approaches.

●  Frequency domain approach: The one-sided spectrum of is formed from the two-sided spectrum of the real-valued signal by applying equation (2)
● Time domain approach: Using Hilbert transform approach given in equation (4)

One of the important property of an analytic signal is that its real and imaginary components are orthogonal

Discrete-time analytic signal

Since we are in digital era, we are more interested in discrete-time signal processing. Consider a continuous real-valued signal gets sampled at interval seconds and results in real-valued discrete samples , i.e, . The spectrum of the continuous signal is shown in Figure 2(a). The spectrum of that results from the process of periodic sampling is given in Figure 2(b) (Refer here more details on the process of sampling).  The spectrum of discrete-time signal can be obtained by Discrete-Time Fourier Transform (DTFT).

Figure 2: (a) CTFT of continuous signal x(t), (b) Spectrum of x[n] resulted due to periodic sampling and (c) Periodic one-sided spectrum of analytical signal z[n]

At this point, we would like to construct a discrete-time analytic signal from the real-valued sampled signal . We wish the analytic signal is complex valued and should satisfy the following two desired properties

● The real part of the analytic signal should be same as the original real-valued signal.
● The real and imaginary part of the analytic signal should satisfy the following property of orthogonality

In Frequency domain approach for the continuous-time case, we saw that an analytic signal is constructed  by suppressing the negative frequency components from the spectrum of the real signal. We cannot do this for our periodically sampled signal . Periodic mirroring nature of the spectrum prevents one from suppressing the negative components. If we do so, it will vanish the entire spectrum. One solution to this problem is to set the negative half of each spectral period to zero. The resulting spectrum of the analytic signal is shown in Figure 2(c).

Given a record of samples of even length , the procedure to construct the analytic signal is as follows. This method satisfies both the desired properties listed above.

● Compute the -point DTFT of using FFT
● N-point periodic one-sided analytic signal is computed by the following transform

● Finally, the analytic signal (z[n]) is obtained by taking the inverse DTFT of

Matlab

The given procedure can be coded in Matlab using the FFT function. Given a record of real-valued samples , the corresponding analytic signal can be constructed as given next. Note that the Matlab has an inbuilt function to compute the analytic signal. The in-built function is called hilbert.

function z = analytic_signal(x)
%x is a real-valued record of length N, where N is even %returns the analytic signal z[n]
x = x(:); %serialize
N = length(x);
X = fft(x,N);
z = ifft([X(1); 2*X(2:N/2); X(N/2+1); zeros(N/2-1,1)],N);
end

To test this function, we create a 5 seconds record of a real-valued sine signal. The analytic signal is constructed and the orthogonal components are plotted in Figure 3. From the plot, we can see that the real part of the analytic signal is exactly same as the original signal (which is the cosine signal) and the imaginary part of the analytic signal is phase shifted version of the original signal. We note that the imaginary part of the analytic signal is a cosine function with amplitude scaled by which is none other than the Hilbert transform of sine function.

t=0:0.001:0.5-0.001;
x = sin(2*pi*10*t); %real-valued f = 10 Hz
subplot(2,1,1); plot(t,x);%plot the original signal
title('x[n] - original signal'); xlabel('n'); ylabel('x[n]');

z = analytic_signal(x); %construct analytic signal
subplot(2,1,2); plot(t, real(z), 'k'); hold on;
plot(t, imag(z), 'r');
title('Components of Analytic signal'); 
xlabel('n'); ylabel('z_r[n] and z_i[n]');
legend('Real(z[n])','Imag(z[n])');

Python

Equivalent code in Python is given below (tested with Python 3.6.0)

import numpy as np
def main():
    t = np.arange(start=0,stop=0.5,step=0.001)
    x = np.sin(2*np.pi*10*t)
    
    import matplotlib.pyplot as plt
    plt.subplot(2,1,1)
    plt.plot(t,x)
    plt.title('x[n] - original signal')
    plt.xlabel('n')
    plt.ylabel('x[n]')
    
    z = analytic_signal(x)
    
    plt.subplot(2,1,2)
    plt.plot(t,z.real,'k',label='Real(z[n])')
    plt.plot(t,z.imag,'r',label='Imag(z[n])')
    plt.title('Components of Analytic signal')
    plt.xlabel('n')
    plt.ylabel('z_r[n] and z_i[n]')
    plt.legend()

def analytic_signal(x):
    from scipy.fftpack import fft,ifft
    N = len(x)
    X = fft(x,N)
    h = np.zeros(N)
    h[0] = 1
    h[1:N//2] = 2*np.ones(N//2-1)
    h[N//2] = 1
    Z = X*h
    z = ifft(Z,N)
    return z

if __name__ == '__main__':
    main()

Hilbert Transform using FFT

We should note that the hilbert function in Matlab returns the analytic signal $latex z[n]$ not the hilbert transform of the signal . To get the hilbert transform, we should simply get the imaginary part of the analytic signal. Since we have written our own function to compute the analytic signal, getting the hilbert transform of a real-valued signal goes like this.

x_hilbert = imag(analytic_signal(x))

In the coming posts, we will some of the applications of constructing an analytic signal. For example: Find the instantaneous amplitude and phase of a signal, envelope detector for an amplitude modulated signal, detecting phase changes in a sine wave.

Rate this article: Note: There is a rating embedded within this post, please visit this post to rate it.

References:

[1] D. Gabor, “Theory of communications”, Journal of the Inst. Electr. Eng., vol. 93, pt. 111, pp. 42-57, 1946. See definition of complex signal on p. 432.↗
[2] J. A. Ville, “Theorie et application de la notion du signal analytique”, Cables el Transmission, vol. 2, pp. 61-74, 1948.↗
[3] S. M. Kay, “Maximum entropy spectral estimation using the analytical signal”, IEEE transactions on Acoustics, Speech, and Signal Processing, vol. 26, pp. 467-469, October 1978.↗
[4] Frank R. Kschischang, “The Hilbert Transform”, University of Toronto, October 22, 2006.↗
[5] S. L. Marple, “Computing the discrete-time ‘analytic’ signal via FFT,” Conference Record of the Thirty-First Asilomar Conference on Signals, Systems and Computers , Pacific Grove, CA, USA, 1997, pp. 1322-1325 vol.2.↗

Topics in this chapter

Essentials of Signal Processing
● Generating standard test signals
 □ Sinusoidal signals
 □ Square wave
 □ Rectangular pulse
 □ Gaussian pulse
 □ Chirp signal
Interpreting FFT results - complex DFT, frequency bins and FFTShift
 □ Real and complex DFT
 □ Fast Fourier Transform (FFT)
 □ Interpreting the FFT results
 □ FFTShift
 □ IFFTShift
Obtaining magnitude and phase information from FFT
 □ Discrete-time domain representation
 □ Representing the signal in frequency domain using FFT
 □ Reconstructing the time domain signal from the frequency domain samples
● Power spectral density
Power and energy of a signal
 □ Energy of a signal
 □ Power of a signal
 □ Classification of signals
 □ Computation of power of a signal - simulation and verification
Polynomials, convolution and Toeplitz matrices
 □ Polynomial functions
 □ Representing single variable polynomial functions
 □ Multiplication of polynomials and linear convolution
 □ Toeplitz matrix and convolution
Methods to compute convolution
 □ Method 1: Brute-force method
 □ Method 2: Using Toeplitz matrix
 □ Method 3: Using FFT to compute convolution
 □ Miscellaneous methods
Analytic signal and its applications
 □ Analytic signal and Fourier transform
 □ Extracting instantaneous amplitude, phase, frequency
 □ Phase demodulation using Hilbert transform
Choosing a filter : FIR or IIR : understanding the design perspective
 □ Design specification
 □ General considerations in design

Books by the author


Wireless Communication Systems in Matlab
Second Edition(PDF)

Note: There is a rating embedded within this post, please visit this post to rate it.
Checkout Added to cart

Digital Modulations using Python
(PDF ebook)

Note: There is a rating embedded within this post, please visit this post to rate it.
Checkout Added to cart

Digital Modulations using Matlab
(PDF ebook)

Note: There is a rating embedded within this post, please visit this post to rate it.
Checkout Added to cart
Hand-picked Best books on Communication Engineering
Best books on Signal Processing

Sampling in Matlab and downsampling an audio file

Generating a continuous signal and sampling it at a given rate is demonstrated here. In simulations, we may require to generate a continuous time signal and convert it to discrete domain by appropriate sampling.

For baseband signal, the sampling is straight forward. By Nyquist Shannon sampling theorem, for faithful reproduction of a continuous signal in discrete domain, one has to sample the signal at a rate higher than at-least twice the maximum frequency contained in the signal (actually, it is twice the one-sided bandwidth occupied by a real signal. For a baseband signal bandwidth ( to ) and maximum frequency in a given band are equivalent).

Matlab or any other simulation softwares  process everything in digital i.e, discrete in time. This is because, the signals are represented as discrete samples in computer memory. Therefore, we cannot generate a real continuous-time signal on it, rather we can generate a “continuous-like” signal by using a very very high sampling rate. When plotted, such signals look like a continuous signal.

Let’s generate a simple continuous-like sinusoidal signal with frequency . In order to make it appear as a continuous signal when plotting, a sampling rate of is used.

fs=500e3; %Very high sampling rate 500 kHz
f=10e3; %Frequency of sinusoid
nCyl=5; %generate five cycles of sinusoid
t=0:1/fs:nCyl*1/f; %time index
x=cos(2*pi*f*t);

plot(t,x)
title('Continuous sinusoidal signal');
xlabel('Time(s)');
ylabel('Amplitude');
Figure 1: Continuous time signal in Matlab

Pretending the above generated signal as a “continuous” signal, we would like to convert the signal to discrete-time equivalent by sampling. By Nyquist Shannon Theorem, the signal has to be sampled at at-least . Let’s sample the signal at and then at  for illustration.

fs1=30e3; %30kHz sampling rate
t1=0:1/fs1:nCyl*1/f; %time index
x1=cos(2*pi*f*t1);

fs2=50e3; %50kHz sampling rate
t2=0:1/fs2:nCyl*1/f; %time index
x2=cos(2*pi*f*t2);

subplot(2,1,1);
plot(t,x);
hold on;
stem(t1,x1);
subplot(2,1,2);
plot(t,x);
hold on;
stem(t2,x2);
Figure 2: Sampling a Continuous time signal in Matlab

Manipulating audio files in Matlab

Matlab’s standard installation comes with a set of audio files. The audio files,that can be considered as one-dimensional vectors, can be inspected and played using xpsound command. With this command, we can visualize the audio files in three ways

● Time series (data-vector as function of time)
● Power spectral density (distribution of frequency content)
● Spectrogram (frequency content as function of time)

The output of the xpsound command plotting time-series plot of a sample audio file looks like this

Figure 3: Sound visualizer – xpsound

We can also load and plot the time-series plot using inbuilt Matlab commands as follows

>> load('gong') %load the variables for the 'gong' audio file, this loads the sample frequency and the sample values
>> Fs  %sampling frequency

Fs =

        8192

>> y(1:10) %first 10 sample values in the file

ans =

   -0.0027
   -0.0045
   -0.0074
   -0.0110
   -0.0128
   -0.0173
   -0.0223
   -0.0223
   -0.0200
   -0.0092
>> t=0:1/Fs:length(y)/Fs-1/Fs; %time index
>> figure;plot(t,y);xlabel('Time (s)'),ylabel('y')

Example: DownSampling

In signal processing, downsampling is the process of throwing away samples without applying any low-pass filtering. Mathematically, downsampling by a factor of implies, starting from the very first sample we throw away every $M-1$ samples (i.e, keep every -th sample.

For example, if is a vector of input samples, downsampling by implies

Going back to the previous example of ‘gong’ audio vector loaded in the Matlab variable space, the downsampling operation can be coded as follows.

>>M=2 % downsample by 2
>>y_down = y(1:M:end); % keep every M-th sample

Note: Downsampling↗ is not same as decimation. Decimation↗ implies reducing the sampling rate of a signal by applying low-pass filtering as the first step and then followed by decimation.

Rate this article: Note: There is a rating embedded within this post, please visit this post to rate it.

Reference

[1] Julius O smith III, “Spectral audio signal processing”, Center for Computer Research in Music and Acoustics, Stanford.↗

Books by the author


Wireless Communication Systems in Matlab
Second Edition(PDF)

Note: There is a rating embedded within this post, please visit this post to rate it.
Checkout Added to cart

Digital Modulations using Python
(PDF ebook)

Note: There is a rating embedded within this post, please visit this post to rate it.
Checkout Added to cart

Digital Modulations using Matlab
(PDF ebook)

Note: There is a rating embedded within this post, please visit this post to rate it.
Checkout Added to cart
Hand-picked Best books on Communication Engineering
Best books on Signal Processing

Sampling Theorem – Bandpass or Intermediate or Under Sampling

Prerequisite: Sampling theorem – baseband sampling

Intermediate Sampling or Under-Sampling

A signal is a bandpass signal if we can fit all its frequency content inside a bandwidth . Bandwidth is simply the difference between the lowest and the highest frequency present in the signal.

“In order for a faithful reproduction and reconstruction of a bandpass analog signal with bandwidth – , the signal should be sampled at a Sampling frequency () that is greater than or equal to twice the maximum bandwidth of the signal:

Consider a bandpass signal extending from 150Hz to 200Hz. The bandwidth of this signal is . In order to faithfully represent the above signal in the digital domain the sampling frequency must be . Note that the sampling frequency 100Hz is far below the maximum content of the signal (which is 200Hz). That is why the bandpass sampling is also called “under-sampling”. As long as the sampling frequency is greater than or equal to twice the bandwidth of the signal, the reconstruction back to analog domain will be error free.

Going back to the aliasing zone figure, if the signal of interest is in the zone other than zone 1, it is called a bandpass signal and the sampling operation is called “Intermediate Sampling” or “Harmonic Sampling” or “Under Sampling” or “Bandpass Sampling”.

Folding Frequencies and Aliasing Zones

Note that zone 1 is a mirror image of zone 2 (with frequency reversal). Similarly zone 3 is a mirror image of zone 4 etc.., Also, any signal in zone 1 will be reflected in zone 2 with frequency reversal which inturn will be copied in zone 3 and so on.

Lets say the signal of interest lies in zone 2. This will be copied in all the other zones. Zone 1 also contains the sampled signal with frequency reversal which can be correct by reversing the order of FFT in digital domain.

No matter in which zone the signal of interest lies, zone 1 always contains the signal after sampling operation is performed. If the signal of interest lies in any of the even zones, zone 1 contains the sampled signal with frequency reversal. If the signal of interest lies in any of the odd zones, zone 1 contains the sampled signal without frequency reversal.

Example:

Consider an AM signal centered at carrier frequency 1MHz, with two components offset by 10KHz – 0.99 MHz and 1.01 MHz. So the AM signal contains three frequency components at 0.99 MHz, 1 MHz and 1.01 MHz.

Our desire is to sample the AM signal. As with the usual sampling theorem (baseband), we know that if we sample the signal at twice the maximum frequency i.e Fs>=2*1.01MHz=2.02 MHz there should be no problem in representing the analog signal in digital domain.

By the bandpass sampling theorem, we do not need to use a sampler running at Fs>=2.02 MHz. Faster sampler implies more cost. By applying the bandpass sampling theorem, we can use a slower sampler and reduce the cost of the system. The bandwidth of the signal is 1.01MHz-0.99 MHz = 20 KHz. So, just sampling at will convert the signal to digital domain properly and we can also avoid using an expensive high rate sampler (if used according to baseband sampling theorem).

Lets set the sampling frequency to be (which is 3 times higher than the minimum required sampling rate of 40KHz or oversampling rate =3).

Now we can easily find the position of the spectral components in the sampled output by using the aliasing zone figure as given above. Since , will be 60KHz. So the zone 1 will be from 0 to 60 KHz, zone 2 -> 60-120KHz and so on. The three spectral components at 0.99MHz, 1MHz and 1.01 MHz will fall at zone 17 ( how ? 0.99 MHz/60 KHz = 16.5 , 1MHz/60KHz = 16.67 and 1.01MHz/60KHz = 16.83 , all figures approximating to 17). By the aliasing zone figure, zone 16 contains a copy of zone 17, zone 15 contains a copy of zone 16, zone 14 contains a copy of zone 15 and so on… Finally zone 1 contains the copy of zone 2 (Frequency reversal also exist at even zones). In effect, zone 1 contains a copy of zone 17. Since the original spectral components are at zone 17, which is an odd zone, zone 1 contains the copy of spectral components at zone 17 without frequency reversal.

Since there is no frequency reversal, in zone 1 the three components will be at 30KHz, 40KHz and 50KHz (You can easily figure this out ).

This operation has downconverted our signal from zone 17 to zone 1 without distorting the signal components. The downconverted signal can be further processed by using a filter to select the baseband downconverted components. Following figure illustrates the concept of bandpass sampling.

Bandpass Sampling

Consider the same AM signal with three components at 0.99MHz, 1MHz and 1.01 MHz. Now we also have an “unwanted” fourth component at 1.2 MHz along with the incoming signal. If we sample the signal at 120 KHz, it will cause aliasing (because the bandwidth of the entire signal is 1.2-0.99 = 0.21 MHz = 210 KHz and the sampling frequency of 120KHz is below twice the bandwidth). In order to avoid anti-aliasing and to discard the unwanted component at 1.2 MHz, an anti-aliasing bandpass filter has to be used to select those desired component before performing the sampling operation at 120KHz. This is also called “pre-filtering”. The following figure illustrates this concept.

Bandpass sampling with pre-filtering

See also:

[1] Oversampling, ADC – DAC Conversion,pulse shaping and Matched Filter
[2] Sampling Theorem Basics and Baseband Sampling

Sampling Theorem – Baseband Sampling

For Matlab demo of sampling see here.

“Nyquist-Shannon Sampling Theorem” is the fundamental base over which all the digital processing techniques are built. Processing a signal in digital domain gives several advantages (like immunity to temperature drift, accuracy, predictability, ease of design, ease of implementation etc..,) over analog domain processing.

Analog to Digital conversion:

In analog domain, the signal that is of concern is continuous in both time and amplitude. The process of discretization of the analog signal in both time domain and amplitude levels yields the equivalent digital signal. The conversion of analog to digital domain is a three step process 1) Discretization in time – Sampling 2) Discretization of amplitude levels – Quantization 3) Converting the discrete samples to digital samples – Coding/Encoding

Components of ADC

The sampling operation samples (“chops”) the incoming signal at regular interval called “Sampling Rate” (denoted by ). Sampling Rate is determined by Sampling Frequency (denoted by ) as Lets consider the following logical questions: * Given a real world signal, how do we select the sampling rate in order to faithfully represent the signal in digital domain ? * Is there any criteria for selecting the sampling rate ? * Will there be any deviation if the signal is converted back to analog domain ? Answer : Consult the “Nyquist-Shannon Sampling Theorem” to select the sampling rate or sampling frequency.

Nyquist-Shannon Sampling Theorem:

The following sampling theorem is the exact reproduction of text from Shannon’s classic paper[1],

“If a function f(t) contains no frequencies higher than W cps, it is completely determined by giving its ordinates at a series of points spaced 1/2W seconds apart.”

Sampling Theorem mainly falls into two categories : 1) Baseband Sampling – Applied for signals in the baseband (useful frequency components extending from 0Hz to some Fm Hz) 2) Bandpass Sampling – Applied for signals whose frequency components extent from some F1 Hz to F2Hz (where F2>F1) In simple terms, the Nyquist Shannon Sampling Theorem for Baseband can be explained as follows

Baseband Sampling:

If the signal is confined to a maximum frequency of Fm Hz, in other words, the signal is a baseband signal (extending from 0 Hz to maximum Fm Hz).

In order for a faithful reproduction and reconstruction of an analog signal that is confined to a maximum frequency Fm, the signal should be sampled at a Sampling frequency (Fs) that is greater than or equal to twice the maximum frequency of the signal:

Consider a 10Hz sine wave in analog domain. The maximum frequency present in this signal is Fm=10 Hz (obviously no doubt about it !!!). Now, to satisfy the sampling theorem that is stated above and to have a faithful representation of the signal in digital domain, the sampling frequency can be chosen as Fs >=20Hz. That is, we are free to choose any number above 20 Hz. Higher the sampling frequency higher is the accuracy of representation of the signal. Higher sampling frequency also implies more samples, which implies more storage space or more memory requirements. In time domain, the process of sampling can be viewed as multiplying the signal with a series of pulses (“pulse train) at regular interval – Ts. In frequency domain, the output of the sampling process gives the following components – Fm (original frequency content of the signal), Fs±Fm,2Fs±Fm,3Fs±Fm,4Fs±Fm and so on and on…

Baseband Sampling

Now the sampled signal contains lots of unwanted frequency components (Fs±Fm,2Fs±Fm,…). If we want to convert the sampled signal back to analog domain, all we need to do is to filter out those unwanted frequency components by using a “reconstruction” filter (In this case it is a low pass filter) that is designed to select only those frequency components that are upto Fm Hz. The above process mentions only the sampling part which samples the incoming analog signal at regular intervals. Actually a quantizer will follow the sampler which will discretize (“quantize”) amplitude levels of the sampled signal. The quantized amplitude levels are sent to an encoder that converts the discrete amplitude levels to binary representation (binary data). So when converting the binary data back to analog domain, we need a Digital to Analog Converter (DAC) that converts the binary data to analog signal. Now the converted signal after the DAC contains the same unwanted frequencies as well as the wanted component. Thus a reconstruction filter with proper cut-off frequency has to placed after the DAC to filter out only the wanted components.

Aliasing and Anti-aliasing:

Consider a signal with two frequency components f1=10Hz – which is our desired signal and f2=20Hz – which is a noise. Let’s say we sample the signal at 30Hz. The first frequency component f1=10Hz will generate following frequency components at the output of the multiplier (sampler) – 10Hz,20Hz,40Hz,50Hz,70Hz and so on. The second frequency component f2=20Hz will generate the following frequency components at the output of the multiplier – 20Hz,10Hz,50Hz,40Hz,80Hz and so on…

Aliasing and Anti-aliasing

Note the 10Hz component that is generated by f2=20Hz. This 10Hz component (which is a manifestation of noisy component f2=20Hz) will interfere with our original f1=10Hz component and are indistinguishable. This 10Hz component is called “alias” of the original component f2=20Hz (noise). Similarly the 20Hz component generated by f1=10Hz component is an “alias” of f1=10Hz component. This 20Hz alias of f1=10Hz will interfere with our original component f2=20Hz and are indistinguishable. We do not need to care about the interference that occurs at 20Hz since it is a noise and any way it has to be eliminated. But we need to do something about the aliasing component generated by the f2=20Hz. Since this is a noise component, the aliasing component generated by this noise will interfere with our original f1=10Hz component and will corrupt it. Aliasing depends on the sampling frequency and its relationship with the frequency components. If we sample a signal at Fs, all the frequency components from Fs/2 to Fs will be alias of frequency components from 0 to Fs/2 and vice versa. This frequency – Fs/2 is called “Folding frequency” since the frequency components from Fs/2 to Fs folds back itself and interferes with the components from 0Hz to Fs/2 Hz and vice versa. Actually the aliasing zones occur on the either sides of 0.5Fs, 1.5Fs, 2.5Fs,3.5Fs etc… All these frequencies are also called “Folding Frequencies” that causes frequency reversal. Similarly aliasing also occurs on either side of Fs,2Fs,3Fs,4Fs… without frequency reversals. The following figure illustrates the concept of aliasing zones.

Folding Frequencies and Aliasing Zones

In the above figure, zone 2 is just a mirror image of zone 1 with frequency reversal. Similarly zone 2 will create aliases in zone 3 (without frequency reversal), zone 3 creates mirror image in zone 4 with frequency reversal and so on… In the example above, the folding frequency was at Fs/2=15Hz, so all the components from 15Hz to 30Hz will be the alias of the components from 0Hz to 15Hz. Once the aliasing components enter our band of interest, it is impossible to distinguish between original components and aliased components and as a result, the original content of the signal will be lost. In order to prevent aliasing, it is necessary to remove those frequencies that are above Fs/2 before sampling the signal. This is achieved by using an “anti-aliasing” filter that precedes the analog to digital converter. An anti-aliasing filter is designed to restrict all the frequencies above the folding frequency Fs/2 and therefore avoids aliasing that may occur at the output of the multiplier otherwise.

A complete design of ADC and DAC

Thus, a complete design of analog to digital conversion contains an anti-aliasing filter preceding the ADC and the complete design of digital to analog conversion contains a reconstruction filter succeeding the DAC.

ADC and DAC chain

Note: Remember that both the anti-aliasing and reconstruction filters are analog filters since they operate on analog signal. So it is imperative that the sampling rate has to be chosen carefully to relax the requirements for the anti-aliasing and reconstruction filters.

Effects of Sampling Rate:

Consider a sinusoidal signal of frequency Fm=2MHz. Lets say that we sample the signal at Fs=8MHz (Fs>=2*Fm). The factor Fs/Fm is called “over-sampling factor”. In this case we are over-sampling the signal by a factor of Fm=8MHz/2MHz = 4. Now the folding frequency will be at Fs/2 = 4MHz. Our anti-aliasing filter has to be designed to strictly cut off all the frequencies above 4MHz to prevent aliasing. In practice, ideal brick wall response for filters is not possible. Any filter will have a transition band between pass-band and stop-band. Sharper/faster roll off transition band (or narrow transition band) filters are always desired. But such filters are always of high orders. Since both the anti-aliasing and reconstruction filters are analog filters, high order filters that provide faster roll-off transition bands are expensive (Cost increases proportionally with filter order). The system also gets bulkier with increase in filter order.Therefore, to build a relatively cheaper system, the filter requirement in-terms of width of the transition band has to be relaxed. This can be done by increasing the sampling rate or equivalently the over-sampling factor. When the sampling rate (Fs) is increased, the distance between the maximum frequency content Fm and Fs/2 will increase. This increase in the gap between the maximum frequency content of the signal and Fs/2 will ease requirements on the transition bands of the anti-aliasing analog filter. Following figure illustrates this concept. If we use a sampling frequency of Fs=8MHz (over-sampling factor = 4), the transition band is narrower and it calls for a higher order anti-aliasing filter (which will be very expensive and bulkier). If we increase the sampling frequency to Fs=32MHz (over-sampling factor = 32MHz/2MHz=16), the distance between the desired component and Fs/2 has greatly increased that it facilitates a relatively inexpensive anti-aliasing filter with a wider transition band. Thus, increasing the sampling rate of the ADC facilitates simpler lower order anti-aliasing filter as well as reconstruction filter. However, increase in the sampling rate calls for a faster sampler which makes ADC expensive. It is necessary to compromise and to strike balance between the sampling rate and the requirement of the anti-aliasing/reconstruction filter.

Effects of Sampling Rate

Application : Up-conversion

In the above examples, the reconstruction filter was conceived as a low pass filter that is designed to pass only the baseband frequency components after reconstruction. Remember that any frequency component present in zone 1 will be reflected in all the zones (with frequency reversals in even zones and without frequency reversals in odd zones). So, if we design the reconstruction filter to be a bandpass filter selection the reflected frequencies in any of the zones expect zone 1, then we achieve up-conversion. In any communication system, the digital signal that comes out of a digital signal processor cannot be transmitted across as such. The processed signal (which is in the digital domain) has to be converted to analog signal and the analog signal has to be translated to appropriate frequency of operation that fits the medium of transmission. For example, in an RF system, a baseband signal is converted to higher frequency (up-conversion) using a multiplier and oscillator and then the high frequency signal is transmitted across the medium. If we have a band-pass reconstruction filter at the output of the DAC, we can directly achieve up-conversion (which saves us from using a multiplier and oscillator). The following figure illustrates this concept.

Application : Upconversion

Reference:

[1] Claude E. Shannon, “Communication in the presence of noise” ,Proceedings of the IRE, Vol 37, no.1,pp.10-21,Jan 1949

See also:

[1] Oversampling, ADC – DAC Conversion,pulse shaping and Matched Filter [2] Bandpass Sampling