Discrete Time Fourier Transform (DTFT) : Digital Signal Processing, © 2011 Robi Polikar, Rowan University

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 48

Discrete Time

Fourier Transform
(DTFT)

Digital Signal Processing, © 2011 Robi Polikar, Rowan University


Sinusoids &
Signals
Impulse, step,
DSP Quantization
Finite
Exponentials rectangular Worldlength
Phasors (LTI) Systems A/D D/A
Frequency Number Rep.
Discrete LTI Fixed/Floating
Characterization Systems
Quantization Overflow
Power / Energy Periodicity Cont. / Discrete Classification Noise Effects

Convolution Sampling Linearity Causality Memory


Regular / Circular Nyquist Thm. Time Inv. Stability

Time domain Time Domain Rep. Advanced Topics


representation
Impulse Resp. Diff. Equation Random Signal Analysis
Multirate Signal Proc.
Transforms
Time Frequency Analysis
Freq. Domain Rep. Adaptive Signal Process.
Representation in
frequency domain Transfer Func.
Frequency Res.
Spectrum
Filtering FIR / IIR
LPF HPF BPF BSF APF Notch
CFT DFT
Ideal vs. Practical Filter Design Filter Structure
DTFT FFT FIR IIR FIR IIR
Specs Direct Lattice

Z Windows

Linear Phase
Bilinear. Tran.

Butterworth
Cascade

Poles & Zeros Chebychev


ROC Elliptic
Stability RP
This Week in DSP
 The Discrete Time Fourier Transform
 Definition
 Key theorems
• DTFT of the output of an LTI system
• The frequency response
• Periodicity of DTFT
• Definition of discrete frequency
• Existence of DTFT
 DTFTs of some important sequences
 DTFT properties
 DTFT in Matlab
Fourier Series and
Fourier Transform
 Any periodic signal x(t), with fundamental period is T0, can be represented as a finite
and discrete sum of complex exponentials (sines and cosines) that are integer
ck
multiples of Ω0, the fundamental frequency: FOURIER SERIES
 1 t0 T0  jk0t
x(t )   ck e j0kt ck   x (t ) e dt 1/2 1/2 1/2j

k   T0 t0
-3 -2 -1 0 1 2 3
k
-1/2j RP

 A non-periodic continuous time signal can


also be represented as an (infinite and
continuous) sum of complex exponentials: FOURIER TRANSFORM
 F
X       x(t )    x(t )e  jt
dt x(t ) X


X    X   X  


 X   e j  
1
x(t )    X ()  
1
 X ()e jt d 
2
Key Facts
to Remember
 All FT pairs provide a transformation between time and frequency domains: The
frequency domain representation provides how much of which frequencies exist in
the signal  More specifically, how much ejΩt exists in the signal for each Ω.
 In general, the frequency representation is complex (except when the signal is even).
 |X(Ω)|: The magnitude spectrum  the power of each Ω component
 Ang X(Ω): The phase spectrum  the amount of phase delay for each Ω component
 The FS is discrete in frequency domain, since it is the discrete set of exponentials –
integer multiples of Ω0 – that make up the signal. This is because only a finite
number of frequencies are required to construct a periodic signal.
 The FT is continuous in frequency domain, since exponentials of a continuum of
frequencies are required to reconstruct a non-periodic signal.
 Both transforms are non-periodic in frequency domain.
Digital Frequency
 Recall that a discrete time signal can be obtained from a continuous time
signal through the process of sampling: take a sample every Ts second

x(n)  x(nTs )  x(t ) t nT s


n  ,2,1,0,1,2,
 When time is discretized, what happens to frequency? Consider the
following: (where we use Ω to represent continuous frequency, and ω to
represent discrete frequency) Digital frequency Analog frequency
y (t )  A sin(t   ) 2 F F
  Ts   f  2
ys (nTs )  A sin(Ts n   ) s Fs Fs

Sampling frequency (rad/s) Sampling frequency (sam/s

 Note that when Ω=Ωs  ω = ωs= 2π What does this mean?


Spectrum of discrete signals – by definition – is normalized with respect to sampling frequency.
If the analog frequency is equal to the sampling frequency, the corresponding frequency of
the discrete signal, ω, is 2π. While counterintuitive, ω is NOT discrete in frequency! ,
Discrete –Time
Fourier Transform (DTFT)
 Similar to continuous time signals, discrete time sequences can also be periodic or
non-periodic, resulting in discrete-time Fourier series or discrete – time Fourier
transform, respectively.
 Most signals in engineering applications are non-periodic, and DTFS is really a
special case of DTFT, so we will concentrate on DTFT.
 We will represent the discrete signal‟s frequency as ω, measured in radians/sample.
Quick facts:
 • Since x[n] is discrete, we can only add them,  summation in the
x[n]  X ( ) analysis equation. ejωn, however, is continuous function for each n 
• The sum of x[n], weighted with continuous exponentials ejωn, is
 continuous  the DTFT X(ω) is continuous (non-discrete)
1
x[n]   X ( )e j n d  • Since X(ω) is continuous, x[n] is obtained as a continuous integral
2  of X(ω), weighed by the same complex exponentials.
• x[n] is obtained as an integral of X(ω), where the integral is over
 an interval of 2π.  This is our first clue that DTFT is periodic
 with 2π in frequency domain.
 j n
X ( )   x[n]e • X(ω) is sometimes denoted as X(ejω) or X(jω) in some books, including
n    2 f f s yours. While X(ejω) is more accurate, we will use X(ω) for brevity.
• The ∞ indicates that the sum is simply over all available samples!
Proof
 We now show that x[n] and X(ω) are indeed FT pairs, that is one can
be obtained from the other:
Analysis Equation Synthesis Equation
 
X     x  n e jn
1
 X    e j n
d x  n 
n  2 
 Lemma: complex exponentials* are orthogonal, that is
t T0
Integral over 0, k  m
  T0 [k  m]
j 0 ( k  m ) t
e dt   Time domain case
one period
t  0
T , k  m

0, n  l
   2 [n  l ]
j ( n l )
e d   Frequency domain case
2 , n  l

1    j n
x  n     x   e j  e d
2  

* Remember: Continuous time complex exponentials are ALWAYS periodic with some fundamental frequency 0 –
unlike the discrete complex exponentials, which are only periodic for rational values of angular frequency
Digital Signal Processing, © 2011 Robi Polikar, Rowan University
Important Theorems
 Theorem 1: The frequency response of the output of any system is
the product of the spectrum of the input signal and that of the
frequency response
 Theorem 2: The DTFT of the impulse response is the frequency
response of the system.
 Theorem 3: DTFT is periodic with 2π.
 Theorem 4: The digital frequency 2π corresponds to the linear
sampling frequency of the signal.
 Theorem 5: DTFT only exists for sequences that are absolutely
summable.
System Output
 If x[n] is input to an LTI system with an impulse response of h[n],
then the DTFT of the output is the product of X(ω) and H(ω)

x[n] h[n] y[n]=x[n]*h[n]

X(ω) H(ω) Y(ω) = X(ω) . H(ω)


RP
Frequency Response
 Theorem 2:
 If the input to an LTI system with an impulse response of h[n] is a complex
exponential ej0n , then the output is the SAME complex exponential whose
magnitude and phase are given by |H(ω)| and <H(ω), evaluated at ω = ω0.

ejω0n h[n]
y[n]   h[k ]e  
k 
j 0 nk 

  
Quantity    h[k ]e  j0 k  e j0n
 k 
independent of n
H(ω0)
y[n]  H 0  e j0n
If the system input is a complex exponential at a specific frequency ω0, then the system
output is the same exponential, at the same frequency ω0 but weighted by a complex
amplitude that is a function of this input frequency. This complex amplitude, H(ω0), is
the DTFT of system impulse function h[n], evaluated at ω0 , and it is called the
frequency response of the system.
Frequency Response
 This theorem constitutes the fundamental cornerstone for the concept
of frequency response. H(ω), the DTFT of h[n], is called the
frequency response of the system
 Why is it important?
 If a sinusoidal sequence with frequency 0 is applied to a system whose frequency
response is H(ω), then the output can be obtained simply by evaluating H(ω) at
ω = ω0.
 Since all signals can be written as a superposition of sinusoids at different
frequencies, then the output to an arbitrary input can be obtained as the
superposition of H(ω) for each component ω0 that makes up the input signal!
 Most importantly, this is cornerstone of filter design: If you want to design a filter
that blocks a certain frequency ωcut, then we design the system such that H(ωcut)=0;
and if we want the system to pass a certain frequency ωpass then we make sure that
H(ωpass)=1
A Simple
Filtering Example
 Consider the ideal lowpass filter H(ω)

1
1,   c
H    
0, c     -π -ωc ωc π ω
passband

 We apply an input, x  n  C1 cos 1n   C2 cos 2n  , 0  1    2   , which has


two frequency components in it, ω1 that falls within the passband of our filter, and
ω2 that falls outside of the passband.
 According to Theorem 2, the output will be at the same frequencies, but multiplied
by a constant specified by the frequency response of the system, evaluated at those
frequencies.
y  n  H 1  C1 cos 1n   H 2  C2 cos 2 n   H 1  C1 cos 1n 
0 The output does not include the
(why is this an approximation, frequency ω2 , i.e., it is filtered out.
but not an equality?)
Hello Filter
(My First Filter Design)

 Let‟s design a simple lowpass FIR filter that blocks frequencies above
0.7π, but passes the frequencies below 0.2π perfectly.
 We want our filter to be as simple as possible, so let’s assume that we have length
3, symmetric impulse response filter. That is, h[0]=h[2]=1 , and h[1]= 2.
 Then our filter should have a frequency response of the form
H    h  0 e  j 0  h 1 e  j1  h  2 e  j 2
 1   2 e j  1e j 2  1 1  e j 2    2 e j

 2
 e j
 e j 
e j   2 e j   21 cos     2  e j
1
2
cos 

 We want H(0.2π)=1, and H(0.7π)=0. Furthermore, right now, we are primarily


concerned with the magnitude and not phase. Plugging these values into H(ω),
magnitude 1

H  0.2    21 cos  0.2    2  e  1  21 cos  0.2    2  1 
 j 0.2
 1  0.3580,

H  0.7    21 cos  0.7    2  e j 0.7  0  21 cos  0.7    2  0   2  0.4208.
magnitude 1 

Hello Filter
Did My First Filter Work?

b=[0.3580 0.4208 .3580];


a=1;
[H w]=freqz(b,a, 1024); 1.4
plot(w/pi, abs(H))
grid
xlabel('Normalized Angular Frequency / \pi ') 1.2
H(0.2π)=1
ylabel('Magnitude Frequency Response')

Magnitude Frequency Response


1

0.8

0.6

H(0.7π)=0
0.4

0.2

RP
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Angular Frequency / 
Periodicity of DTFT
 Theorem 3:
 The DTFT of a discrete sequence is periodic with the period 2π, that is
X()  X(  2 k ) for any integer

 The periodicity of DTFT can be easily verified from the definition:




X     x  n e  j n X   2 k    x[n]e
n 
 j    2 k  n

n 
 

 x  n e  j n  j  2k n
 x n e  X  
 j   n
 e 
n  n 

Why…?
Implications of the
Periodicity Property
H    H   2 

Theorem 4 (You-will-flunk-if-you-do-not-understand-this-fact theorem):


The discrete frequency 2π rad. corresponds to the sampling frequency Ωs used to
sample the original continuous signal x(t) to obtain x[n].
Proof: x  t   A sin  t     x  nTs   A sin  Ts n  

ω=ΩTs For Ω= Ωs, we have ω=ΩsTs=2πfsTs=2π


Understanding the
Periodicity of the DTFT
 Recall the following example
Sin(2 20t)+4Cos(2 50t)+2Sin(2 100t)
10
t=0:0.001:2; % sampling frequency = 1000Hz
x=sin(2*pi*20*t)+4*cos(2*pi*50*t)+2*sin(2*pi*100*t); 5
subplot(211)
plot(t(1:200),x(1:200)) 0

grid
-5
title('Sin(2\pi20t)+4Cos(2\pi50t)+2Sin(2\pi100t)')
xlabel('Time, s') -10
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
subplot(212) Time, s

X=abs(fft(x)); Frequency domain representation of Sin(220t)+4Cos(250t)+2Sin(2100t)


4000
X2=fftshift(X);

f=-499.9:1000/2001:500; 3000

plot(f,X2);
2000
grid
title(' Frequency domain representation of 1000

Sin(2\pi20t)+4Cos(2\pi50t)+2Sin(2\pi100t)') xlabel RP
0
('Frequency, Hz.') -500 -400 -300 -200 -100 0 100 200 300 400 500
Frequency, Hz.
Understanding the
Periodicity of the DTFT
Sin(220t)+4Cos(2 50t)+2Sin(2100t)
10

t=0:0.001:2; %Sampling frequency = 1000Hz 5


% Note that the length of the signal is 2001 samples.
x=sin(2*pi*20*t)+4*cos(2*pi*50*t)+2*sin(2*pi*100*t); 0
subplot(211)
plot(t(1:200),x(1:200)) %plot a portion of the signal
-5
grid
title('Sin(2\pi20t)+4Cos(2\pi50t)+2Sin(2\pi100t)')
-10
xlabel('Time, s') 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
subplot(212) Time, s
X=abs(fft(x)); Frequency domain representation of Sin(2 20t)+4Cos(250t)+2Sin(2100t)
plot(X) 4000
grid
title(' Frequency domain representation of 3000
Sin(2\pi20t)+4Cos(2\pi50t)+2Sin(2\pi100t)')
xlabel('Normalized Frequency') 2000

1000
FFT computes the FT at the same N number RP
of points as the length of the originl signal 0
0 500 1000 1500 2000 2500
with the assumption that the frequency Normalized Frequency
range is one period of [0 2π]. Then, sample
1 of the FFT corresponds to frequency 0,
What do these mean?
and sample N corresponds to frequency 2π
(which is the sampling frequency).
Sin(220t)+4Cos(250t)+2Sin(2100t)
10

t=0:0.001:2; %Sampling frequency = 1000Hz


x=sin(2*pi*20*t)+4*cos(2*pi*50*t)+2*sin(2*pi*100*t); 0
subplot(411)
plot(t(1:200),x(1:200)) %plot a portion of the signal
-10
grid 0 0.05 0.1 0.15 0.2
title('Sin(2\pi20t)+4Cos(2\pi50t)+2Sin(2\pi100t)') Time, s
Frequency domain representation of Sin(2 20t)+4Cos(250t)+2Sin(2100t)
xlabel('Time, s') 4000
subplot(412)
X=abs(fft(x));%Take the DFT(FFT)
2000
plot(X) % Plots X in the default [0 2π] range
grid
title(' Frequency domain representation of 0
0 500 1000 1500 2000 2500
Sin(2\pi20t)+4Cos(2\pi50t)+2Sin(2\pi100t)') Normalized Frequency
subplot(413)
4000
X2=fftshift(X); % Flip the FT so that 0 frequency is at the center, and the
% frequency range is now [-π π] instead of [0 2π]
2000
plot(X2)
grid
title(' Frequency domain representation of 0
0 500 1000 1500 2000 2500
Sin(2\pi20t)+4Cos(2\pi50t)+2Sin(2\pi100t)')
Normalized Frequency
subplot(414)
4000
f=-499.9:1000/2001:500; %Create frequency axis to plot -500 to 500 Hz
plot(f,X2);
grid 2000
xlabel('Frequency, Hz.')
RP
0
-500 -400 -300 -200 -100 0 100 200 300 400 500
Frequency, Hz.
Existence of DTFT
 Theorem 5:
 The DTFT of a sequence exists if and only if, the sequence x[n] is absolutely
summable, that is, if

 x[n]  
n  
because: This quantity is always ≤ 1

  
X     x  n e
n 
 j n
  x n  e
n 
 j n
  x n  
n 

 Hence, if x[n] is absolutely summable, then |X(ω)|is finite, which means that X(ω)
exists.
 We should add that this is sufficient, but not required to have a DTFT. Certain
sequences that do not satisfy this requirement also have DTFTs, if they satisfy
“mean square convergence.” These will be discussed later within z-transform.
Important DTFT Pairs
Impulse Function
 The DTFT of the impulse function is “1” over the entire frequency
band.
 [n]  1

  n     n e
 j n j 0n
 1 e 1
n 
Summations terms are all zero,
except for n=0

x[n] X(ω)
 [n] DTFT 1

n -π π RP ω

Extend of the frequency band


in discrete frequency domain
Important DTFT Pairs
Constant Function
 Note that x[n]=1 (or any other constant) does not satisfy absolute
summability. However, we can show that the DTFT of the constant
function is an impulse at ω=0. (this should make sense!!!)
 
Cannot use X     x  n e
n 
 j n
1  2     2m
m  
X(ω)
x[n]
2π(ω) 2π(ω-2π)
2π(ω+4π)
DTFT
RP
ω
n -4π -2π -π π 2π 4π
We can show that this transformation is correct, by computing the inverse DTFT of the above function

 
 1    jn
 2     2 m    2
1
 
 m     2 m   e d   e j 0n
1
 m  2 
Matlab Approximation
 In class demo! Original unit delta sequence [n]
1

x=zeros(1000,1);
x(500)=1; 0.5
subplot(211)
plot(x); grid
title('Original unit delta sequence \delta[n]')
0
X=abs(fft(x)); 0 100 200 300 400 500 600 700 800 900 1000
subplot(212)
Magnitude spectrum
w=-pi:2*pi/999:pi; 1
plot(w/pi, fftshift(X)); grid
title('Magnitude spectrum')
1
xlabel('Angular Frequency (x \pi)')

1
RP
1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Angular Frequency (x )
In class Demo

Original constant sequence [n]


2

1.5

x=ones(1000,1); 0.5
subplot(211)
plot(x); grid 0
title('Original constant sequence') 0 100 200 300 400 500 600 700 800 900 1000

X=abs(fft(x));
Magnitude spectrum
subplot(212) 1000
w=linspace(-pi, pi, 1000);
800
plot(w/pi, fftshift(X)); grid
title('Magnitude spectrum') 600
xlabel('Angular Frequency (x \pi)') 400
RP
200

0
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Angular Frequency (x )
Important DTFT Pairs
The Complex Exponential
 The DTFT of the complex exponential:

x[n]  e j0  X    2     
k 
0  2 k 

We are only interested in


[- π π] range, where there is
only one spectral component
Hence, the spectrum of a single
complex exponential at a specific
frequency is an impulse at that . .. ...
frequency. RP
ω0-4π ω0-2π ω0 ω0+2π ω0+4π
This can be verified by computing
the inverse DTFT of X(ω) given
above, as in the previous example.
Important DTFT Pairs
Real Exponential
 1
x[n]   u[n] n
1  e  j

 
X      e   1
n
n  j n j
 e 
n 0 n 0 1   e j
In Matlab
 This is an important function in signal processing. Why?
 1
x[n]   u[n] 
n
1  e  j
t=0:0.01:10;
x=(0.5).^t;
plot(t,x)
X=fftshift((fft(x)));
subplot(311)
plot(t,x); grid
subplot(312)
plot(abs(X)); grid
f=-50:100/1000:50;
plot(f,abs(X)); grid
RP
subplot(313)
plot(f, unwrap(angle(X))); grid

In Matlab, periodicity of X(ω) is assumed


Important DTFT Pairs
The sinusoid at ω=ω0
 By far the most often used DTFT pair (it is less complicated then it looks):
  
x[n]  cos0n        2m  0        2m  0 
m   m  
Cos (ω0t) X(ω)
1

DTFT
0.8

(ω+ ω0) (ω- ω0)


0.6

0.4

0.2

... ...
-0.2

-0.4

-0.6 RP
π 2π
-0.8

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-2π -π - ω0 ω0 ω

  The above expression can also be obtained


j0n
x[n]  e  2     0  2 m  from the DTFT of the complex exponential
m through the Euler’s formula.
Important DTFT Pairs
Rectangular Pulse
 Rectangular pulse train is also very commonly used in DSP (it is the
moving average filter).

1,  M  n  M
x[n]  rect M [n]  
0, otherwise


M sin M  1 2
 e  jn  sin  2
, 0
nM

 What if we change the order?


 Whose Fourier transform would RP
be a rectangular pulse (which
of course is ideal LPF)
Ideal Lowpass Filter
 The ideal lowpass filter is defined as

1,   c
H    
0, c    

 Taking its inverse DTFT, we can obtain the corresponding impulse function h[n]:
 c
1 1
 1 e  1 e
j n j n
h[n]  d  d
2 
2  c

 sin c n
,   n  
1 e jc n
e    n  jc n
   
2  jn jn   c
, n0
 
Ideal Lowpass Filter
 Note that:
 The impulse response of an ideal LPF is infinitely long  This is an IIR filter. In
fact h[n] is not absolutely summable  its DTFT cannot be computed  an ideal
h[n] cannot be realized!
 One possible solution is to truncate h[n], say with a window function, and then
take its DTFT to obtain the frequency response of a realizable FIR filter.
How does this code work?
(Carefully analyze at home)
Ideal_lpf_by_sinc.m
%This function creates an ideal LPF in frequency domain and then computes
its inverse Fourier transform.
%Robi Polikar, Feb 12 2007
Clear; close all
L=input('Enter the length of the frequency vector: L= ');
wc=input('Enter the LPF corner frequency in rad (times pi): wc= ')
%These values create good looking graphs L=128; wc=0.25*pi; Magnitude spectrum of LPF with cutoff frequency  =0.2 rad
w=linspace(-pi, pi, L); t=linspace(-0.5,0.5,L); c
%Create a LPF with a cutoff frequency of wc 1
H=zeros(L,1);
H(L/2-round(wc*(L/2)/pi): L/2+round(wc*(L/2)/pi))=1;
Ideal LPF defined in frequency domain 0.5
subplot(311); plot(w/pi, H); grid
xlabel('Angular frequency, x\pi') 0
Wc=wc/pi; %Convert to a multiple of pi -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
title(['Magnitude spectrum of LPF with cutoff frequency \omega_c =', … Angular frequency, x 
num2str(Wc), '\pi rad']);
Inverse FT --> impulse response of H()
H=fftshift(H); %This is necessary to reset H into the [0 2pi] range as
%expected by Matlab 0.2
h=real(ifft(H)); h=fftshift(h);
subplot(312); plot(t, h); grid 0.1
axis([t(1) t(L) 0.8*min(h) 1.2*max(h)])
0
xlabel('Time, s.')
title('Inverse FT --> impulse response of H(\omega)') -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5
Time, s.
n=-L/2:L/2;
h_alt=sin(wc*n)./(pi*n);
Ideal LPF defined in time domain impulse response of H() computed analytically
if (rem(L,2)== 0)
0.2
end
h_alt(round(L/2)+1)=wc/pi; RP
0.1
subplot(313)
plot(n,h_alt); grid 0
axis([-L/2 L/2 0.8*min(h_alt) 1.2*max(h_alt)]) -60 -40 -20 0 20 40 60
xlabel('Time index n') Time index n
title('impulse response of H(\omega) computed analytically')
Some Useful
Matlab Functions
 Matlab cannot explicitly calculate the DTFT, since the frequency axis is continuous.
However, it can calculate an approximation of the DTFT using a given number of points.
 y=fft(x, N) – Calculates the discrete Fourier transform of the signal x at N points. If N is not
provided, length of y is the same as x. DFT is a sampled version of the DTFT, where the
samples are taken at N equidistant points around the unit circle from 0 to 2π.
 [h,w] = freqz(b,a,N,'whole') – Calculates the frequency response of a filter whose CCLDE
coefficients are given as b and a, using N number of points around the unit circle. If „whole‟
is included, it returns a frequency base of w from 0 to 2π, otherwise, from 0 to π.
 y=abs(x)- Calculates the absolute value of signal x. For complex values signals, the output is
the magnitude (spectrum) of the complex argument.
 y=angle(x) – Calculates the phase (spectrum) of the signal x.
 q = unwrap(p) corrects the radian phase angles in a vector p by adding multiples of 2π when
absolute jumps between consecutive elements of p are greater than the default jump tolerance
of π radians.
 y = fftshift(x) rearranges the outputs of fft by moving the zero-frequency component to the
center of the array. It is useful for visualizing a Fourier transform with the zero-frequency
component in the middle of the spectrum. It changes the default [0 2π] range to [-π π]
Other Important
Properties of DTFT
 We will study the following properties of the DTFT:
 Linearity  DTFT is a linear operator
 Time reversal  x[-n]  X(-ω)
 Time shift  x[n-n0]  X(ω)e-jωn0
 Frequency shift  x[n] ejω0n X(ω-ω0)
 Convolution in time  x[n]*y[n]  X(ω).Y(ω)
 Convolution in frequency
 Differentiation in frequency  nx[n]  j (dX(ω)/dω)
 Parseval’s theorem  Conservation of energy in time and frequency domains
 Symmetry properties

 
x[n]  X ( ) y[n]  Y ( )
Linearity &
Time Reversal

Given x(t) and X(ω) form a DTFT pair, x  n  X   we can show that

 The DTFT is a linear operator



ax  n  by  n  aX    bY  

 A reversal in of the time domain variable causes a reversal of the frequency variable

x  n  X   
Proof:
X     n x  n e jn , if y  n   x  n  
Y     n y  n e jn   n x  n  e jn  m x  m  e j m
 X   
m 
Time & Frequency Shift
 A shift in time domain by m samples causes a phase shift of e-jωm in the frequency
domain 
x  n  M   X   e jM , M 
 
y  k   x  n  M   Y     x n  M  e  j n
  x k  e  j  k  M 
k nM
n  n  k  M k 

   j k 
  x k  e
k 
 j k
e  j M
e  j M

 k 
x  k  e   X   e
 j M

 Note that the magnitude spectrum is unchanged by time shift.

y  k   x  n  M   Y    X    Why not?

 Similarly, a shift in frequency domain by ω0 causes a time delay of ejω0n



x  n e j0
X   0 
Importance of the Linearity &
Time Shift Properties
Frequency Response of FIR Systems
 Here is another way to show that the frequency response of a system,
whose impulse response is h[n], is in fact H(ω)=F{h[n]}
 Given the impulse response h[n] of an FIR system, the output y[n] to the input
x[n] is of course the convolution sum 
y  n   h k  x n  k 
k 

 To compute the spectrum of the output, Y(ω), let’s take the DTFT of both sides.
Assuming that X(ω) and Y(ω) exist, and using the linearity and time shifting
properties, we have 
Y     h  k  X   e jk
k 

 Now, since we know that in frequency domain, the output Y(ω) = H(ω). X(ω), we

have H      
h k e jk
k 
proving that the frequency response of the system is indeed the DTFT of the
impulse response h[n].
Importance of the Linearity &
Time Shift Properties
Frequency Response of IIR Systems
 Consider the CCLDE of a typical LTI system:
N 1 M 1

 a y[n  i] 
i 0
i
0
b x[n  j ], a0  1

y[n]  a1 y[n  1]  a2 y[n  2]  aN 1 y n   N  1  b0 x[n]  b1x[n  1]   bM 1x n   M  1

 The linearity of DTFT allows us to compute the DTFT of the entire


expression, by computing the DTFTs of the individual terms, and then
combine them:
Y    a1Y   e  j1  a2Y   e  j 2   aN 1Y   e  j  N 1 
b0 X    b1 X   e  j1  b2 X   e  j 2   bM 1 X   e  j  M 1
 Y   1  a1e  j1   aN 1e  j  N 1   X   b0  b1e  j1   bM 1e  j  M 1 


M 1
Y    j1  j  M 1  j k
 b0  b1e   bM 1e b e
  H     k 0 k

X   1  a1e  j1   aN 1e j  N 1



N 1
a e  j k
k 0 k
Differentiation in Frequency
 Multiplying the time domain signal with the independent time variable
is equivalent to differentiation in frequency domain.
 dX ( )
nx[n]  j
d
 Example: What is the DTFT of y n   n  1 a u n
n

1
Let x  n   a nu  n   X   
1  ae j
dX   1
 y  n   nx  n   x  n   Y    j  X   
d  
2
1  ae j
Convolution in Time
 Convolution in time domain is equivalent to multiplication in
frequency domain 
x  n   h  n   X     H  
 Proof: Let y[n]=x[n]*h[n], then we need to prove that Y(ω)=X(ω)H(ω)

y n  x n  h n    x  k  h n  k 
k 
 
  
Y      y  n    y  n  e  j n
    x  k  h  n  k   e  j n
n  n   k  
 

mnk    x  k  h  me
m  k 
 j  m  k 


  
  x  k    h  m e  j m  e  j k
k   m  
H  


  
  x  k  H   e  j k
   x  k  e  j k  H    X   H  
k   k  
 This is one of the fundamental theorems in DSP. It allows us to compute the
filter response in frequency domain using the frequency response of the filter.
Convolution in Frequency
(Modulation)
 Multiplication in time domain is equivalent to convolution integral in
frequency domain

 
1
x  n  h  n   X   H    d
2 

 This property is also called the modulation theorem, since it involves


the modulation of one signal x[n] with the other h[n].
 Recall our discussion on the meaning of signal and system. Here, h[n] can be
considered as another signal.
Parseval’s Theorem
 The energy of the signal , whether computed in time domain or the frequency
domain, is the same!

 
1
 x  n  X  
2 2
 d
n  2  Energy density spectrum
of the signal

 Alternatively:
 
1
 x  n y  n 

 X   Y   d
n  2 
Symmetry Properties
of DTFT
 Your text lists several symmetry properties of DTFT
 While all of these properties are important for academic reasons, the following are
important for practical reasons:
• The Fourier transform of a real signal is conjugate symmetric: the magnitude spectrum
is an even function of ω (symmetric), whereas the phase spectrum is an odd function
of ω (antisymmetric). That is, for a real signal x[n]

X *    X *     X    X    , X    X   

• The Fourier transform of a symmetric signal is real! More generally, if

x  n 

 X    X real    jX imag  
then, the following is true:

xeven  n  X real   , xodd  n 



 X imag  
since the even part of any signal is necessarily symmetric, it follows that the DTFT of
any symmetric signal must also necessarily be real!
Resolution of
the DTFT
 Recall the definition of the DTFT:
 
1
X     x  n e  j n
 x n  
2 
X    e jn
d
n 

 The analysis equation is an infinite sum. In reality, we cannot deal with the
infinitely long signals (particularly using computers), as we do not have infinite
memory. Hence, we usually have a finite length signal, say of N samples, in which
case the DTFT becomes:
N 1 
1
X     x  n e  j n
 x  n  
2 
X    e jn
d , 0  n  N  1
n 0

 …but then, it is obvious that the larger N, the larger number of components are
used to make up X(ω), and hence the more accurate X(ω) becomes. We will see
that the limitation that we can only use a finite number of samples will create some
artifacts in the spectrum
Resolution of
the DTFT
 Consider the following three sinusoids, all at the same (some angular) frequency of
π/2, and their corresponding spectra: 6
Spectrum of x [n] 1

4
%four time bases of length 10, 20 and 40 and 100 2
t1 = 0:9;
t2 = 0:19; 0
t3 = 0:39; -1 -0.5 0 0.5 1
t4 = 0:99; Spectrum of x2[n]
10
%Create frequency base of 1024 points between +/- pi
w = linspace(-pi, pi, 1024);
omega=pi/2; %Common frequency for all four signals 5

Spectral Amplitude
x1=cos(omega*t1); x2=cos(omega*t2);
x3=cos(omega*t3); x4=cos(omega*t4); 0
-1 -0.5 0 0.5 1
Spectrum of x3[n]
%Compute 1024 point FFTs 20
X1 = fftshift(abs(fft(x1, 1024)));
X2 = fftshift(abs(fft(x2, 1024)));
X3 = fftshift(abs(fft(x3, 1024))); 10
X4 = fftshift(abs(fft(x4, 1024)));
0
-1 -0.5 0 0.5 1
subplot(411); plot(w/pi, X1); title('Spectrum of x_1[n]'); grid Spectrum of x4[n]
50
subplot(412); plot(w/pi, X2); title('Spectrum of x_2[n]'); grid
subplot(413); plot(w/pi, X3); title('Spectrum of x_3[n]'); grid
subplot(414); plot(w/pi, X4); title('Spectrum of x_4[n]'); grid 30
xlabel('Normalized frequency -\pi to \pi') RP
10
0
-1 -0.5 0 0.5 1

Normalized frequency - to 
Frequency Resolution
of the DTFT
 Observe the following: 6
Spectrum of x1[n]
4
 While the peak spectral component is correctly 2
4

located at π/2 in each case, the peak is not 0


2

0
sharp there appears to be other frequencies: -0.8 -1 -0.7 -0.6
-0.5 -0.5 0 -0.4
Spectrum of x2[n]
-0.3
0.5 -0.2 1
10
• These are also due to using a finite length 8
signal, which can be interpreted as windowing 6
5
with a rectangular function (more on this later) 4

Spectral Amplitude
2
• Gibbs’ phenomenon 0 0
-1 -0.5 0 0.5 1
-0.7 -0.65 -0.6 -0.55 -0.5 -0.45 -0.4 -0.35 -0.3
• These are artifacts – these frequencies do not 20
Spectrum of x3[n]

actually exist in the signal


15
 The width of the main lobe is inversely 10
10

proportional to the length of the signal 5 0


0 -1 -0.5 0 0.5 1
-0.6 -0.55 Spectrum
-0.5 of x-0.45
4
[n] -0.4 -0.35
50

 The amplitude of the peaks are directly 30

proportional to the length of the signal 30


10 RP
0
 The longer the signal, the larger the number 10
0
-1 -0.5 0 0.5 1


- to-0.44
of side lobes but with narrower width for Normalized
-0.58 -0.56 -0.54 -0.52 frequency
-0.5 -0.48 -0.46 -0.42 -0.4

each.
What did we
learn this week?
 The Discrete Time Fourier Transform
 Definition
 Key theorems
• DTFT of the output of an LTI system
• The frequency response my first filter : Hello filter
• Periodicity of DTFT
• Definition of discrete frequency
• Existence of DTFT
 DTFTs of some important sequences
 DTFT properties
• Linearity and time reversal
• Time and frequency shifting
• Differentiation, convoltion, symmetry properties
• Parseval’s theorem
• The resolution of the DTFT
 DTFT in Matlab

You might also like