Unit 4 - Notes

ECE220

Unit 4: The Continuous Time Fourier Transform and Sampling

1. Introduction

In previous units, signal analysis often focused on periodic signals using the Fourier Series. However, many practical signals (e.g., a single pulse, a decaying exponential, speech, or transient noise) are aperiodic (non-periodic).

To analyze aperiodic signals in the frequency domain, we extend the concept of the Fourier Series by allowing the period to approach infinity (). This extension leads to the Continuous Time Fourier Transform (CTFT), a powerful tool that decomposes a signal into a continuum of frequency components rather than discrete harmonic series.


2. Representation of Aperiodic Signals: The Continuous Time Fourier Transform

2.1 Derivation Concept

Ideally, we view an aperiodic signal as a periodic signal with an infinite period ().

  1. As increases, the fundamental frequency becomes infinitesimally small ().
  2. The discrete harmonic spacing in the spectrum disappears, resulting in a continuous spectrum.

2.2 The Fourier Transform Pair

The CTFT allows us to move between the Time Domain and the Frequency Domain.

Analysis Equation (Forward Transform):
Computes the frequency spectrum from the time signal .

Synthesis Equation (Inverse Transform):
Reconstructs the time signal from the spectrum .

  • is often complex, denoted as .
    • : Magnitude Spectrum
    • : Phase Spectrum

2.3 Convergence (Dirichlet Conditions)

For the Fourier Transform to exist, must satisfy the Dirichlet conditions:

  1. Absolute Integrability: (The signal must have finite energy).
  2. Finite number of maxima and minima within any finite interval.
  3. Finite number of discontinuities within any finite interval.

3. The Fourier Transform for Periodic Signals

Although the CTFT is derived for aperiodic signals, it can be unified to include periodic signals using the Dirac Delta function ().

A periodic signal with period and fundamental frequency has a Fourier Series representation. In the CTFT context, the spectrum of a periodic signal consists of impulses located at the harmonic frequencies ().

Formula:
If is periodic with Fourier Series coefficients :

Common Examples:

  1. DC Signal ():
  2. Cosine Wave ():
  3. Sine Wave ():

4. Properties of Continuous Time Fourier Transform

Understanding these properties simplifies the calculation of complex transforms and system analysis. Assume .

4.1 Linearity

4.2 Time Shifting

Shifting in time introduces a linear phase shift in frequency.


Magnitude remains unchanged; only phase is altered.

4.3 Time Scaling

Compression in time equals expansion in frequency (and vice versa).

  • If (fast signal), spectrum broadens (high frequencies).
  • Time Reversal: .

4.4 Frequency Shifting (Modulation Property)

Multiplying by a complex exponential shifts the spectrum. This is the basis of AM radio.

4.5 Convolution Property

This is the most critical property for Linear Time-Invariant (LTI) systems. Convolution in the time domain corresponds to multiplication in the frequency domain.

  • : Impulse response.
  • : Frequency response.

4.6 Multiplication Property

Multiplication in time corresponds to convolution in frequency (scaled by ).

4.7 Differentiation and Integration

  • Differentiation:
  • Integration:

4.8 Parseval’s Relation

Conservation of energy between domains.


5. Software Simulation: Frequency Spectrum of Real-World Signals

To simulate CTFT in software (like Python or MATLAB), we approximate the continuous integral using the Fast Fourier Transform (FFT).

Python Example: Analyzing an Audio Signal

PYTHON
import numpy as np
import matplotlib.pyplot as plt

# 1. Generate a synthetic signal (e.g., sum of two sine waves)
# Simulating a "continuous" signal by using a very high sampling rate
fs = 1000  # Sampling frequency
t = np.arange(0, 1, 1/fs) # 1 second duration
# Signal: 5Hz component + 50Hz component
x_t = np.sin(2 * np.pi * 5 * t) + 0.5 * np.sin(2 * np.pi * 50 * t)

# 2. Compute Fourier Transform using FFT
N = len(t)
X_f = np.fft.fft(x_t)
freqs = np.fft.fftfreq(N, 1/fs)

# 3. Plotting
plt.figure(figsize=(10, 6))

# Time Domain
plt.subplot(2, 1, 1)
plt.plot(t, x_t)
plt.title("Time Domain Signal")
plt.xlabel("Time (s)")

# Frequency Domain (Magnitude)
plt.subplot(2, 1, 2)
# We only plot the positive frequencies
mask = freqs > 0
plt.plot(freqs[mask], np.abs(X_f[mask])) 
plt.title("Frequency Spectrum (Magnitude)")
plt.xlabel("Frequency (Hz)")
plt.ylabel("|X(f)|")
plt.grid()
plt.tight_layout()
plt.show()

Observation: The plot will show distinct spikes at 5 Hz and 50 Hz, representing the frequency content of the time-domain signal.


6. Sampling

6.1 Introduction

Sampling is the process of converting a continuous-time signal into a discrete-time signal by measuring the amplitude of at regular intervals. This bridges the physical world (analog) and the digital computer world (discrete).

6.2 Representation of Continuous Time Signal by its Samples

Ideally, sampling is modeled mathematically as multiplying the continuous signal by a periodic impulse train .

Impulse Train:


Where is the sampling period. The sampling frequency is (or ).

Sampled Signal ():

Frequency Domain Effect:
Using the multiplication property (Convolution in frequency):


Key Insight: Sampling creates periodic replicas (images) of the original spectrum centered at integer multiples of the sampling frequency .


7. The Sampling Theorem (Nyquist-Shannon)

For a continuous-time signal to be uniquely recoverable from its samples, the sampling frequency must be sufficiently high to prevent the spectral replicas from overlapping.

Statement:
Let be a band-limited signal with maximum frequency (i.e., for ).
The signal can be exactly reconstructed from its samples if and only if the sampling frequency satisfies:

  • Nyquist Rate: (The minimum required sampling rate).
  • Nyquist Frequency: (The maximum signal frequency a system with rate can handle).

8. Reconstruction of a Signal from its Samples (Interpolation)

If the sampling theorem is satisfied (), the spectral replicas do not overlap. We can recover the original by isolating the central copy of the spectrum (where ).

8.1 Ideal Low Pass Filter (LPF)

We pass the sampled signal through an ideal LPF with gain and cutoff frequency (where ).

8.2 Time Domain Interpolation

In the time domain, filtering corresponds to convolution. The impulse response of an ideal LPF is a Sinc function.


where .

This formula implies that the original signal is reconstructed by summing shifted, scaled Sinc functions centered at each sample point.


9. The Effect of Undersampling: Aliasing

9.1 Definition

If the sampling condition is violated (), the spectral replicas shifted by will overlap with the original spectrum. This phenomenon is called Aliasing.

9.2 Consequences

  • High frequencies in the original signal effectively "impersonate" (alias as) lower frequencies.
  • Information is irretrievably lost; the original signal cannot be reconstructed exactly.
  • Visual Example: The "Wagon Wheel Effect" in movies, where wheels appear to spin backward because the camera frame rate (sampling) is too slow for the wheel's rotation speed.

9.3 Anti-Aliasing Filter

To prevent aliasing in practical systems, signals are passed through an analog Low Pass Filter (Anti-Aliasing Filter) before sampling to ensure no frequencies above exist in the signal.


10. Software Simulation: Effect of Undersampling

The following Python code demonstrates aliasing. We will sample a high-frequency sine wave at a rate lower than the Nyquist rate and observe that it appears as a lower frequency wave.

PYTHON
import numpy as np
import matplotlib.pyplot as plt

def plot_sampling(freq_signal, freq_sampling, duration=0.1):
    t_continuous = np.linspace(0, duration, 1000)
    x_continuous = np.cos(2 * np.pi * freq_signal * t_continuous)
    
    # Sampling
    t_samples = np.arange(0, duration, 1/freq_sampling)
    x_samples = np.cos(2 * np.pi * freq_signal * t_samples)
    
    plt.figure(figsize=(10, 4))
    
    # Plot 'Continuous' signal
    plt.plot(t_continuous, x_continuous, label=f'Original ({freq_signal} Hz)')
    
    # Plot Samples
    plt.stem(t_samples, x_samples, linefmt='r-', markerfmt='ro', basefmt=' ', label='Samples')
    
    # Illustration of the aliased signal (Apparent reconstruction)
    # The aliased freq is |f_signal - k*f_sampling|
    # Here, if f_s = 30 and f_sig = 40, alias = |40 - 30| = 10Hz
    if freq_sampling < 2 * freq_signal:
        f_alias = abs(freq_signal - freq_sampling) 
        x_alias = np.cos(2 * np.pi * f_alias * t_continuous)
        plt.plot(t_continuous, x_alias, 'g--', alpha=0.7, label=f'Aliased ({f_alias} Hz)')

    plt.title(f'Sampling: Signal={freq_signal}Hz, Sampling Rate={freq_sampling}Hz')
    plt.xlabel('Time (s)')
    plt.ylabel('Amplitude')
    plt.legend()
    plt.grid(True)
    plt.show()

# Case 1: Proper Sampling (Nyquist Satisfied)
# Signal 10Hz, Sampling 50Hz (50 > 2*10) -> Good reconstruction
plot_sampling(freq_signal=10, freq_sampling=50)

# Case 2: Undersampling (Aliasing)
# Signal 40Hz, Sampling 50Hz (50 < 2*40) -> Aliases to 10Hz
# The red dots (samples) will perfectly fit the Green dashed line (10Hz)
# even though the original was 40Hz.
plot_sampling(freq_signal=40, freq_sampling=50)

Result Analysis:
In Case 2, the 40 Hz signal sampled at 50 Hz produces sample points that fall exactly onto the path of a 10 Hz cosine wave. A reconstruction system will output the 10 Hz wave, resulting in Aliasing.