CMM344 Digital Signal Analysis and Processing

Digital Signal Analysis and ProcessingUnit 410 min read

Frequency Analysis: Fourier, Periodicity, Power Spectrum

Unit 4 of Digital Signal Analysis and Processing covers how to decompose signals into their frequency components using Fourier analysis, periodicity tests, power spectral density, and windowing techniques—essential for designing filters, compressing audio, and analyzing real-world signals like speech or ECG.

Key Concepts and Definitions

0.20.40.60.811.21.41.61.82-1-0.50.51xyPeriodic cosine (T=1)Periodic cosine (T=0.5)
Periodic signals with different fundamental periods (T)

1. Periodic and Aperiodic Signals

A periodic signal repeats its values at regular intervals , called the fundamental period. Its fundamental frequency is . Aperiodic signals do not repeat.

How to check periodicity? A signal is periodic with period if: where is the smallest positive integer satisfying this.

Example: Consider . Is it periodic?

  • Solution: The cosine function repeats every , so: The smallest satisfying this for all is . Thus, is periodic with .

Visual:

graph LR
    A["Periodic Signal"] -->|"Repeats every N"| B["x[n] = x[n+N]"]
    A -->|"Fundamental frequency"| C["f₀ = 1/T"]
    A -->|"Fourier Series"| D["Sum of sinusoids"]
    B --> E["Example: x[n] = cos(2πn/5)"]

2. Fourier Series for Discrete-Time Signals

A periodic signal with period can be represented as a sum of complex exponentials (Fourier series): where are the Fourier coefficients, computed as:

Key Points:

  • The Fourier series decomposes a signal into sinusoidal components at frequencies (where ).
  • For real signals, coefficients satisfy (conjugate symmetry).
  • The DC component () is the average value of the signal.

Example: Square Wave Consider a square wave with period :

Compute : Simplify using : For : (no DC component). For : .

Visual: Square Wave and Its Fourier Coefficients


3. Power Spectral Density (PSD)

The power spectral density measures how the power of a signal is distributed over frequency. For a periodic signal, it is given by: where is the Dirac delta function.

-10-8-6-4-22468100.20.40.60.81xyPSD of white noisePSD of colored noise
Power spectral density examples: white vs. colored noise

For aperiodic signals, we use the Fourier Transform (covered in Unit 5), but PSD is computed via: where is the DTFT of .

Example: White Noise PSD White noise has a flat PSD (equal power at all frequencies): where is the noise variance.

Real-World Connection:

  • Ncell/NTN Signals: Mobile networks use PSD analysis to optimize frequency allocation and reduce interference between towers.
  • ECG Monitoring: Doctors analyze heartbeats’ PSD to detect arrhythmias (irregular frequencies).

4. Windowing for Aperiodic Signals

For finite-length signals, we use windows (e.g., rectangular, Hamming, Hanning) to reduce spectral leakage (false frequencies due to abrupt truncation).

Common Windows:

Window Formula Side Lobe Attenuation Main Lobe Width
Rectangular Poor (-13 dB) Narrow
Hamming Good (-43 dB) Wider
Hanning Good (-32 dB) Wider

Example: Rectangular vs. Hamming Window Consider for to , truncated abruptly (rectangular window) vs. smoothed with a Hamming window.

Visual: Spectral Leakage

0.10.20.30.40.50.60.70.80.9151015xyHamming Windowed SpectrumRectangular Window Spectrum (leakage)
Spectral leakage comparison: rectangular window (spikes) vs. Hamming window (cleaner)

Real-World Use:

  • YouTube Audio Compression: Uses windowing (e.g., Hann window) to analyze audio chunks before MP3 encoding.
  • NEPSE Stock Analysis: Traders apply windowed Fourier transforms to detect periodic trends in stock prices.

5. Parseval’s Theorem

Relates the total energy of a signal in time and frequency domains: For periodic signals:

Example: Energy of a Square Wave For the earlier square wave (): (Note: Parseval’s theorem holds when normalized correctly.)


6. Frequency Response of LTI Systems

For an LTI system with impulse response , the frequency response is the DTFT of :

  • Magnitude response : How the system attenuates/amplifies frequencies.
  • Phase response : Time delay introduced by the system.

Example: Moving Average Filter A 3-tap MA filter has: Its frequency response:

  • Magnitude:
  • Phase: Linear phase (delay of 1 sample).

Visual: MA Filter Frequency Response

0.10.20.30.40.50.60.70.80.910.511.52xy|H(e^{jω})| (3-tap MA filter)
Magnitude response of 3-tap moving average filter (low-pass behavior)

Real-World Use:

  • WhatsApp Voice Messages: Uses MA filters to smooth out noise before encoding.
  • NTC Power Grid: Frequency response analysis ensures stability when adding new substations.

In the Real World

  1. Khalti Payments:

    • Idea Used: Fourier Analysis for Fraud Detection
    • How? Khalti’s anti-fraud systems analyze transaction patterns in the frequency domain. Sudden spikes in transaction rates (e.g., a hacker flooding the system) appear as high-magnitude components in the PSD. Windowed Fourier transforms isolate these anomalies without needing full signal history.
  2. Pathao Ride Allocation:

    • Idea Used: Periodic Signal Modeling + PSD
    • How? Pathao’s algorithm treats demand as a periodic signal (peaks during rush hours). By computing the PSD of ride requests over time, they predict future demand spikes and pre-position drivers in high-probability zones. A Hamming window smooths noise from one-time events (e.g., a concert).
  3. NEPSE Stock Price Analysis:

    • Idea Used: Windowed Fourier Transform for Trend Detection
    • How? Traders use short-time Fourier transforms (STFT) with a Hanning window to analyze stock prices. For example, a 30-day window reveals weekly cycles (e.g., higher volumes on Fridays), while a 1-year window captures seasonal trends (e.g., pre-election volatility). Parseval’s theorem helps verify if a stock’s total volatility matches its frequency-domain energy.

Exam Tip

  1. Periodicity Checks:

    • Always verify if a signal is periodic by checking . For trigonometric signals, use and solve for such that .
  2. Fourier Coefficients:

    • For even/odd signals, exploit symmetry to simplify calculations. For example, if is real and even, .
  3. PSD vs. DTFT:

    • PSD is for power (long-term signals), while DTFT is for energy (finite-length signals). Confuse them in exams by misapplying Parseval’s theorem.
  4. Windowing:

    • Rectangular windows are simplest but cause leakage. Hamming/Hanning reduce leakage but widen the main lobe. Always justify your window choice in design problems.
  5. Frequency Response Plots:

    • Sketch magnitude/phase plots for common filters (MA, FIR, IIR). For example:
      • MA filter: Low-pass, linear phase.
      • Differentiator: High-pass, nonlinear phase.
  6. Real-World Applications:

    • Expect questions linking theory to systems like:
      • Audio compression (MP3): Uses windowed DFT.
      • Wi-Fi (802.11): PSD analysis for channel allocation.
      • ECG/EEG: Fourier analysis to detect abnormal rhythms.

Worked Example for Exam Practice: A system has impulse response .

  1. Find .
  2. Sketch its magnitude and phase responses.
  3. If the input is , find the output’s frequency components.

Solution:

  1. .
  2. Magnitude: ; Phase: .
  3. Output: , where is the phase shift.

Visual: System Response

Based on the PU BE Computer (PU) syllabus for Digital Signal Analysis and Processing (CMM344), unit 4.

Discussion

Loading…