Digital Signal Processing Notes
1. Introduction to Digital Signals and Systems
• Analog Signal: Continuous in time and amplitude.
• Digital Signal: Discrete in time (sampled) and amplitude (quantized).
• Advantages of DSP: Flexibility, accuracy, perfect reproducibility,
size/cost, advanced algorithms.
• Disadvantages of DSP: Bandwidth limitation, quantization effects,
complex hardware/software.
• DSP System Components:
◦ Analog-to-Digital Converter (ADC): Sampling, Quantization, Encoding.
◦ Digital Signal Processor (Microprocessor/FPGA/ASIC).
◦ Digital-to-Analog Converter (DAC): Reconstruction.
◦ Anti-aliasing filter (before ADC), Reconstruction filter (after DAC).
2. Discrete-Time Signals and Systems
• Discrete-Time (DT) Signal: x[n] defined only for integer values of n.
• Basic DT Signals:
◦ Unit Impulse: δ[n] = {1 for n=0, 0 otherwise}.
◦ Unit Step: u[n] = {1 for n≥0, 0 otherwise}.
◦ Real Exponential: x[n] = aⁿ.
◦ Complex Exponential: x[n] = A e^(jω₀n + φ).
• DT System Properties:
◦ Linearity: T{ax₁[n] + bx₂[n]} = aT{x₁[n]} + bT{x₂[n]}.
◦ Time Invariance: T{x[n-n₀]} = y[n-n₀].
◦ Causality: Output depends only on present and past inputs.
◦ Stability (BIBO): Bounded input produces bounded output.
◦ Memory/Memoryless: Output depends on past/future inputs or only
present input.
• Linear Time-Invariant (LTI) Systems:
◦ Characterized by Impulse Response h[n].
◦ Convolution Sum: y[n] = x[n] * h[n] = Σ (k=-∞ to ∞) x[k]h[n-k].
◦ Causality: h[n] = 0 for n < 0.
◦ Stability: Σ (n=-∞ to ∞) |h[n]| < ∞.
• Finite Impulse Response (FIR) Systems: Impulse response h[n] has
finite duration.
◦ Always stable. Can be designed to have linear phase.
• Infinite Impulse Response (IIR) Systems: Impulse response h[n] has
infinite duration.
◦ More efficient in terms of components/memory for given magnitude
response.
◦ Can be unstable. Cannot have perfect linear phase.
• Difference Equations: Describe DT LTI systems.
◦ y[n] = -Σ (k=1 to N) a_k y[n-k] + Σ (k=0 to M) b_k x[n-k].
3. Sampling and Reconstruction
• Sampling: Converting a continuous-time signal x_c(t) into a discrete-time
signal x[n].
◦ x[n] = x_c(nT_s) where T_s is sampling period, f_s = 1/T_s is sampling
frequency.
• Nyquist-Shannon Sampling Theorem: A continuous-time signal x_c(t)
with maximum frequency f_max can be perfectly reconstructed from its
samples x[n] if f_s > 2f_max (or ω_s > 2ω_max).
◦ Nyquist Rate: 2f_max.
• Aliasing: If f_s ≤ 2f_max, higher frequency components in x_c(t) will
appear as lower frequency components in x[n], leading to irreversible
distortion.
• Anti-Aliasing Filter: An analog low-pass filter applied before sampling to
limit the bandwidth of x_c(t) and prevent aliasing.
• Reconstruction: Converting a discrete-time signal x[n] back to a
continuous-time signal x_r(t).
◦ Ideally, done using an ideal low-pass filter (interpolation) with cutoff
frequency ω_c such that ω_max ≤ ω_c ≤ ω_s - ω_max.
◦ Practical DACs use zero-order hold or first-order hold.
4. Z-Transform
• Definition: X(z) = Σ (n=-∞ to ∞) x[n] z^(-n).
◦ z is a complex variable.
• Region of Convergence (ROC): Range of 'z' for which the sum
converges.
◦ For causal signals, ROC is exterior to a circle.
◦ For stable systems, ROC includes the unit circle (|z|=1).
• Inverse Z-Transform: Partial fraction expansion, power series
expansion, contour integration.
• Properties: Linearity, Time Shift, Scaling, Differentiation, Convolution
(x[n]*h[n] <=> X(z)H(z)).
• System Function H(z): For LTI systems, H(z) = Y(z)/X(z).
◦ Poles: Roots of the denominator of H(z).
◦ Zeros: Roots of the numerator of H(z).
◦ Stability: A causal LTI system is stable if and only if all its poles lie strictly
inside the unit circle in the z-plane.
• Frequency Response: H(e^(jω)) obtained by evaluating H(z) on the unit
circle (z = e^(jω)).
5. Discrete Fourier Transform (DFT) and Fast Fourier
Transform (FFT)
• Discrete Fourier Transform (DFT): Transforms a finite-length discrete-
time sequence x[n] (of length N) into a finite-length frequency-domain
sequence X[k] (of length N).
◦ X[k] = Σ (n=0 to N-1) x[n] e^(-j2πkn/N) for k = 0, 1, ..., N-1.
◦ Inverse DFT (IDFT): x[n] = (1/N) Σ (k=0 to N-1) X[k] e^(j2πkn/N) for n =
0, 1, ..., N-1.
• Properties of DFT: Linearity, Circular Shift, Circular Convolution.
• Circular Convolution: Convolution in the time domain corresponds to
multiplication in the DFT domain, but it's circular convolution.
◦ To get linear convolution from DFT, use zero-padding to make lengths
M+N-1.
• Fast Fourier Transform (FFT): An efficient algorithm to compute the
DFT.
◦ Reduces computational complexity from O(N²) to O(N log₂N).
◦ Common algorithms: Radix-2 (decimation-in-time, decimation-in-
frequency).
• Applications of DFT/FFT: Spectral analysis, filtering, correlation, fast
convolution.
6. Digital Filter Design
• Ideal Filter Characteristics: Perfect passband, perfect stopband, sharp
transition band, linear phase. Non-causal, non-realizable.
• FIR Filter Design:
◦ Windowing Method: Truncates an ideal (infinite) impulse response by
multiplying with a finite-length window function (e.g., Rectangular,
Hanning, Hamming, Blackman).
Trade-offs: Main lobe width vs. side lobe magnitude.
Always stable, can achieve linear phase.
◦ Frequency Sampling Method: Specifies desired frequency response at
certain points and uses IDFT to find impulse response.
◦ Optimal (Parks-McClellan/Remez) Algorithm: Designs filters that
minimize the maximum error between desired and actual response
(equiripple design).
• IIR Filter Design:
◦ Typically designed from analog prototypes using transformations.
◦ Impulse Invariance: h[n] = h_c(nT_s). Preserves impulse response.
Suffers from aliasing if analog filter is not band-limited.
◦ Bilinear Transformation: s = (2/T_s) * (1-z⁻¹)/(1+z⁻¹). Maps the entire
left-half s-plane to the unit circle.
Avoids aliasing but introduces frequency warping (non-linear mapping
of analog to digital frequencies).
Must pre-warp analog filter specifications.
◦ Analog Filter Prototypes: Butterworth, Chebyshev (Type I & II), Elliptic.
Butterworth: Maximally flat response in passband, monotonic rolloff.
Chebyshev: Equiripple in passband (Type I) or stopband (Type II),
steeper rolloff.
Elliptic: Equiripple in both passband and stopband, steepest rolloff for
given order.
7. Filter Structures
• Direct Form I & II: Basic implementations from difference equations.
◦ Direct Form II is canonical (uses fewer delay elements).
• Cascade Form: Connecting lower-order sections in series.
◦ Used for higher-order filters, can improve numerical stability.
• Parallel Form: Connecting lower-order sections in parallel (for IIR filters,
using partial fraction expansion).
◦ Used for IIR filters, can improve numerical stability.
• Lattice Structures: Specialized structures, particularly useful in adaptive
filtering and speech processing.
8. Multirate Digital Signal Processing
• Decimation (Downsampling): Reducing the sampling rate of a DT
signal.
◦ x_d[m] = x[mM] where M is the decimation factor (M > 1).
◦ Requires an anti-aliasing (decimation) low-pass filter before downsampling
to prevent aliasing.
• Interpolation (Upsampling): Increasing the sampling rate of a DT
signal.
◦ x_e[n] = {x[n/L] if n is a multiple of L, 0 otherwise}. L is the interpolation
factor (L > 1).
◦ Followed by an interpolation (reconstruction) low-pass filter to smooth the
signal.
• Applications: Sample rate conversion, subband coding, filter banks,
efficient implementation of narrow-band filters.
9. Quantization Effects
• Quantization: Converting continuous amplitude values to discrete levels.
• Quantization Error: Difference between the unquantized and quantized
signal.
• Quantization Noise: Modeled as a white noise source added to the
signal.
◦ Signal-to-Quantization-Noise Ratio (SQNR): For B bits, SQNR ≈ 6.02B +
1.76 dB.
• Coefficient Quantization: Quantizing filter coefficients affects filter
response.
• Product Quantization (Round-off Noise): Quantizing results of
multiplications in filter implementations.
• Overflow: Occurs when results of additions exceed the maximum
representable value.
◦ Saturation arithmetic can prevent limit cycles but introduces distortion.
• Limit Cycles: Undesirable oscillations in IIR filters due to non-linearities
from quantization or overflow.