by Ljiljana Milic
Supplemental material for Chapter I:
1. Single-Rate Signals and Systems: Background Review
1.1 Discrete Time Fourier Transform (DTFT)
Remainder
Definition of the discrete-time Fourier transform (DTFT):
DTFT for the test signal of a finite length L Example 1.1
In this example, the spectrum of the triangular signal is computed using function freqz from the Signal Processing Toolbox. Introducing the test signal L = length(x); % length of the sequence
N = 256; % number of DTFT points
Computing Discrete Time Fourier Transform using Matlab function freqz [X,w] = freqz(x,1,N); % computation of the signal spectrum
mag = abs(X); % magnitude spectrum
phase = angle(X); % phase spectrum
Displaying the results =
xlabel('Time index n'), ylabel('x[n]')
title('Magnitude Spectrum')
xlabel('Normalized frequency \omega/\pi'), ylabel('|X(e^{j\omega})|')
plot(w/pi,unwrap(phase)),
xlabel('Normalized frequency \omega/\pi'), ylabel('\phi(\omega)')
disp('END OF EXAMPLE 1.1')
1.2 Discrete Fourier Transform (DFT)
Remainder
Definition of the discrete Fourier transform (DFT):
, where With substitution DFT is presented in the form: , Example 1.2
In this example, we use function fft to compute DFT sequence for the test signal composed of three sinusoidal components . Introducing test signal x[n]
x=sin(2*pi*4*n/64)+0.6*sin(2*pi*8*n/64) + 0.8*sin(2*pi*18.5*n/64);
xlabel('Time index n'), ylabel('x[n]')
Computing Discrete Fourier Trnsform X[k]
X = fft(x); % Computation of DFT
k = n; % Frequency index k
xlabel('Frequency index k'), ylabel('|(X[k])|')
disp('END OF EXAMPLE 1.2')
1.3 Linear Time-Invariant (LTI) System
Computation of frequency response and pole-zero plot
Remainder
Transfer function of an LTI system Frequency response
Magnitude response: Phase response Group delay Example 1.3
LTI system example: Design and analysis of the 5th order Chebyshev filter by using function cheby1 for design.
Designing the transfer function [B,A] = cheby1(5,1,0.4); % 5th order Chebyshev filter
Computing frequency response [H,f] = freqz(B,A,250,2); % Frequency response
Mag=abs(H); % Magnitude response
Phase = unwrap(angle(H)); % Phase response
[Gd,f] = grpdelay(B,A,250,2); % Group delay
Displaying the results
zplane(B,A),text(1,0.9,'(a)') % Pole-zaro plot
title('Pole-zero locations')
plot(f,Mag), axis([0,1,0,1.1]),text(0.8,0.97,'(b)')
xlabel('\omega/\pi'), ylabel('Magnitude')
title('Magnitude response')
plot(f,Phase), axis([0,1,-8,0]),text(0.8,-1,'(c)')
xlabel(' \omega/\pi'), ylabel('Phase, rad')
plot(f,Gd), axis([0,1,0,15])
xlabel('\omega/\pi'), ylabel('Group delay, samples'),text(0.8,13,'(d)')
disp('END OF EXAMPLE 1.3')
disp(' END OF CHAPTER I')