diskret tid fourier transform (dtft)

DSM4/ECE45/amh
Page 1 of 11
28-07-2017
DISCRETE TIME FOURIER TRANSFORM (DTFT)
1. Introduction
2. DTFT definition, Analysis and Synthesis Equation
3. DTFT-Properties
4. Connection between DTFT and DFT(or fft)
5. DTFT examples and derived DFT of selected examples
1. Introduction
The most general problem in Signal Analysis is the analysis of the frequency
content of a continuous time signal – whether it is a received signal or an
impulse response of an LTI system, which generally are neither finite or
periodic and often random or stochastic of nature. Random signals we will
prefer to characterize as a measurement. If the analysis is made on a computer
we will have to ‘ trim a heel and cut a toe’ to make it work and recognize the
errors and approximations this procedure involves. We can in the computer case
only operate with finite and discrete signals, quantized to a prescribed number of
bits.
To analyze these effects we have to introduce a Fourier Transform valid for
discrete, aperiodic signals: – The DTFT – and examine its properties. Further
we need to mention the Fourier Transform of aperiodic continuous time signals.
So far we have dealt with the following Transforms:
1. Continuous Periodic Time Signals. The tool in this case is the Analysis
and Synthesis equations of the Fourier Series. We observed here that the
Spectrum turned out to be discrete and aperiodic – containing solely
the harmonics of the so-called fundamental harmonic with frequency f=
1/T ( this is Planche 1 in the Fourier Outline of the FStoDFT-note),
where T is the time period of the signal. The discrete spectrum was a
consequence of the periodicity and we have the completely general rule:
Periodic in one domain => Discrete in the other domain…and vice versa
2. For c.t. signals we have not mentioned the Fourier Transform ( Planche
II in the outline), which is a generalization of the Fourier Series extended
to aperiodic signals in - < t < . It turns out to be a ’continuous
frequency’ signal with continuous frequency values equal to the
analogue frequency  , in general aperiodic in - <  < . It is utilized
mainly in analogue system analysis – and some of you may know it from
the Frequency Response of analogue systems with R, L og C
components ( " j - gymnastics") – but in reality it is often this Fourier
DSM4/ECE45/amh
Page 2 of 11
28-07-2017
Transform which we try to simulate as well as possible by our analysis
of sampled and truncated signals and the following computer-based
spectral analysis of this in a way deteriorated signal.
3. Above a term is missing: we cannot analyse aperiodic discrete signals –
another transform is needed here and this transform is the subject of this
note ( Planche III in the outline)
In the following figures we will try to sketch how a an fft emerges as a
model of a Fourier Transform: F.T. => DTFT=>fft:
1. Time Domain:
Frequency Domain:
- Here we observe the Frequency Function X(j) : The Fourier Transform of
x(t) – taking a value for any real value of the analogue frequency. Both are
in principle infinite in the t-  variables.
DTFT as Fourier Transform of a sampled signal:
We sample to discretize: - choosing Ts = 0.5s => s = 4:
- and here the missing Fourier Transform emerges. Its shape is like the
shape of X(j), but it is scaled and because of the discretization it is
periodic with period 2 in the normalized digital frequency .
Apparently the sampling has been adequately fast – there is not much
overlapping at ±π ( ~ ½fs).
It is seen that the DTFT is a function of a continuous range of frequencies
and thus it is a transform belonging to the brainstorm domain – where we
analyze, make plans, changes and so forth It is used typically in the analysis
of discrete LTI systems – but it is used in the analysis and interpretation of
signal spectra too.
DSM4/ECE45/amh
Page 3 of 11
28-07-2017
DFT/fft as a frequency sampling in the DTFT.
Eventually we must truncate the sampling to get a finite signal – by
looking at the signal it seems that N=20 represents the signal suitably in the
interval–5 <t< 5.
So we choose this … and we end up with the finite discrete sequence which
we frequency analyze with DFT /fft
We note from the DFT introduction that these N samples were to be
considered as an N-sampling in a period of a periodic signal. As we
artificially have made the signal periodic – the result must be discrete
(Compare the grey frame) and we have our DFT covering the frequency
interval  fs/2.
By looking at the figure it is observed that the fft seems to be a frequency
sampling in the DTFT - almost perfect here because the aliasing was not
pronounced. But exact coincidence would have been the result if the DTFT
had been produced from only the selected N samples – and we may
conclude:
The fft is a frequency sampling in the DTFT of the N samples
– the N frequency samples representing the frequencies
ωk  k
2π
of the continuous DTFT spectrum
N
( Please note – look at the graph- that the negative frequencies for practical
reasons are placed in the right half of the graph of a DFT. In principle s
should be subtracted from these values to get the correct negative values)
2. DTFT
Definition, Analyzis and Synthesis Equations.
DSM4/ECE45/amh
Page 4 of 11
28-07-2017
We have met the a DTFT a restricted form of the DTFT: The Frequency
Response of FIR and IIR-filter – which in reality is the DTFT of the time
signal h[n] = the Impulse Response. Those FIR filters we have met are finite
and often causal , but the causality is not a requirement when using the filters
off-line and the IIR systems have an infinite Impulse Response so we drop the
restriction and define for any discrete time signal for which it may exist:
DTFT: X( ej) of the discrete signal x[n] , n :
X ( e j ) 
n
 x[n]  e
 j n
n  
Existence: if the sum is convergent =>  x[n] < .
This requirement can be softened with certain consequences for the
2
convergence:
 x[n]  
meaning that the signal has finite energy. This for example is always the case
for finite signals like FIR impulse responses
n
1
Ex. 1 : x[n]=    u[ n]
2

1

0  2e j 
n

1
1
1 e  j
2
=> DTFT:
n

1
X( e ) =     e  j  n =
n 0  2 
j
( Geometric Sequence ...!)
n
 1
Exc1: Compute the DTFT of the signal x[n] =     u[n]
 2
Exc 2:
x[n] = an u[n]
1) For which values of a does the DTFT exist?
2) Compute the DTFT for these a’s
SYNTHESIS:
The problem most often met in DSP analysis is the Synthesis problem: We have
a description in the Frequency Domain of an ideal response to model (i.e. a
DTFT)– what will the impulse response look like, may it be used directly in the
implementation or do we have to modify it to cater for the needs of at least a
finite set of coefficients of the process? Firstly we will have to find a way to go
from the Frequency Domain to the Time Domain –the classical Synthesis
problem. It is described below
DTFT: ANALYSIS and SYNTHESIS:
Analysis:
X (e
j
)
n
 x[n]  e
n  
 j n
DSM4/ECE45/amh
Page 5 of 11
28-07-2017

Synthesis:
1
 X( e j  )  e j n d
2 -
x[n] 
Proof of the Synthesis Equation ( for those interested…):
X ( e j ) 

k 
 x[k ]  e j  k
=>
k  



 k 

  x[k ]  e  j  k   e j  n d


 k  

k 
 x[k ]   [n  k ]  2

X(ej) ejn d =

=
 k 


  x[k ] e  j  ( k  n ) d  



 k  
 


=
 2  x[n] -
k  
In this we have 1) Exchanged summation and integration order 2) Utilized
that a complex exponential integrated over a period gives a zero and 3) when
k=n, we get the integral of the constant 1 over a period = 2 .
The Synthesis emerges from these manipulations.
Excercise: a) Find the sequence x[n] with the DTFT shown below by
utilizing the Synthesis Equation:
1
|
-
-/3
/3
|


{ Result: x[n] = 1/3 sinc( n/3) (n: integer), with sinc(x) = sin(x)/(x) ,
xR}
b) Use a) to find the impulse response of an ideal low-pass filter with
f
normalized cut-off frequencies f̂ cut  -1/6 , 1/6 , fˆ 
f sample
c) Sketch with Matlab the Impulse Response found in b) with stem in a suitable
interval – and (hold on) 1/3sinc(t/3) with plot in a corresponding continuous
time interval
d) What does the impulse response look like for various cut-off frequencies
 fˆ og fˆ ?
c
c
e) May the Impulse Response from a) or b) be utilized as in/out in the DSPprocessor?
f) What may be done to approximate this infinite Impulse Response to create
an FIR filter?
g) Prepare the DTFT of the in f) suggested impulse response with freqz and
plot it – Does it look like the ideal?
DSM4/ECE45/amh
Page 6 of 11
28-07-2017
h) A low-pass filter is given by the following specifications: fc = 800 Hz , it
should operate in the frequency domain 0-4kHZ - and it must be
implemented with a digital FIR filter of length 71.
- Find the normalized fc - and write down the ideal impulse response for the
filter.
-Truncate the ideal symmetrically around n=0 til 71 values – and graph this
with stem
-Plot the Frequency Response (the DTFT) of the truncated impulse response
with freqz - on the frequency axis the frequency in Hz is needed.
i) You know probably how to handle the truncated Impulse Response in order
to achieve smaller sidelobes of the real Frequency Response?(
Windowing…)
If you use another window than the Rectangular ( f.ex. the Hamming
window– which prize do you have to pay? Try to show this graphically.
PROPERTIES OF THE DTFT:
Very often one needs to manipulate time sequences in simple ways such as
delay, addition, modulation and so forth. The properties of the DTFT tell
which consequences these manipulations have in the Frequency Domain –
how is the DTFT modified as a result of the manipulation. The table below
contains the answers:
4. Convolution
 
xn  n   e
 X e 


e
 xn  X e 
xn  yn  X e  Y e 
 
5.
Multiplication
1
xn yn 
 X e j  Y e j     d
2 
a  xn  b  yn  a  X e j  b  Y e j
1.Linearity
2. Shift or
delay
 j ˆ  n 0
j
0
j ˆ 0  n
3. Modulation
j   0
j

j
  

4. and 5. are particularly important – the others may be proven in simple
ways directly from the DTFT definition. We will sketch a proof of 4. – 5
may be proven in almost the same way…

DTFT ( x[n] y[n] ) 

n  

 x[k ] Y e   e

j
k  
 j k

 
  j n
 

  x[k ]    y[n  k ]e  j n 
  x[k ] y[n  k ]   e
k  
 k  

 n  

   
 Y e j  X e j 
DSM4/ECE45/amh
Page 7 of 11
28-07-2017
We have in this 1) Exchanged the summation order and 2) used the delay
rule 2.
Exercise: Prove the delay and the modulation rule
Note from rule 4 and 5 :
CONVOLUTION in one domain corresponds to
MULTIPLICATION in the other domain
Note the continuous (circular) convolution in the multiplication rule – you
may see examples of this in the link to Johns Hopkin’s University
Exercise: A signal x[n] has a DTFT as shown below::
1
|
-
- /3
|

/3

Use the modulation rule ( and Euler..) to sketch the DTFT of the signal
x[n]cos(0n);
Exercise: An in/out relation of a discrete LTI system is given as the
following difference equation:
y[n] -½[y[n-1] =x[n] +0.8x[n-1] +0.2x[n-2] ;
If we name the DTFT of x[n] as X(ej) and the DTFT of y[n] as Y(ej) use linearity, delay rule (and actually the convolution rule) to determine The
Y (e j )
Frequency Response of the system: H (e j ) 
X (e j )
Eventually we note: The DTFT is
1) periodic of period 2 in the normalized radian frequency , the
frequency  corresponds to the Nyquist frequency ½fs , and likewise for - 
2) For real signals the DTFT is :
a) an even function in Magnitude Response and b) an odd function in the
Phase Response – as already concluded in the FIR filter analysis
CORRESPONDANCE BETWEEN DTFT and DFT /fft:
Take a sampeld finite sequence x[n] , n=0:N-1 length: N.
It might be an inherently finite sequence – or possibly a representative finite
subset of an infinite sequence. The DFT computation for these N samples
has as a prerequisite that the N samples is a period of an infinite periodic
signal, while the DTFT computation in reality is a DTFT of an infinite signal
with 0-samples outside n=0:N-1;
DTFT for the sequence x[n]:
X(ej ) =
N 1
 x[n]  e
n0
 j n
DSM4/ECE45/amh
Page 8 of 11
N 1
DFT for the sequence x[n]:
X(k) =
 x[n]  e
28-07-2017
 2 
 j
k  n
 N 
, k=0:N-1
n 0
If we compare it is seen that the discrete values X(k) are produced from
2
X(ej ) by sampling this in the period 0:2 with sample distance
N
x[n] periodic => the Spectrum is discrete. We note here that the negative
frequencies are represented for k>N/2 traditionally, in reality a subtraction of
2 from these values should be made in order to obtain the correct value in
the Nyquist interval.
Example:
Given a rectangular signal of length 9 med wr[n]=1 for n=0:8 and 0
otherwise. Below a couple of periods of the |DTFT| is sketched (with freqz)
We note immediately that the DTFT looks like the Frequency Response of
the Moving Average filter – not surprising… the zero-crossings are found at
2
with N  9 here - the magnitude in 0 is N ( = 9
the frequencies   k 
N
here)
Then we compute the fft of the N samples - and stem these values on the
graph above:
Hopefully not unexpected we find a DFT with only one nonzero value for
n=0 of value DC*9. The 9 samples repeated periodically constitutes in the
time domain a sampled DC - and our fft-samples coincided with the 0-
DSM4/ECE45/amh
crossings of the DTFT…!
Page 9 of 11
28-07-2017
Zero-padding:
If we try to zero-pad our 9 ones with 9 zeros appended we get the following:
- What happens here?Our DTFT has not changed, of course (why?) – but
the fft does in this case have a frequency distance of 2/2N – and 2N pins.
Zero-padding gives as result a kind of interpolation in the unaltered DTFT –
but of course the padding does not add extra information to the N original
values. This effect is often utilized (and abused) to make the background
DTFT more accurate– zero-padding with an infinite amount of zeros results
exactly in the DTFT.
Examples of correspondance between DTFT and DFT/fft for other signals:
Let us look at the rectangular window again: x[n] = 1 for n =0:N-1; – which
has a DTFT seen above – dependent of the length N
Window:
DSM4/ECE45/amh
DTFT:
Page 10 of 11
28-07-2017
Truncation of a sinusoid:
Let us look at the signal y[n] = cos( 0n) for nZ - If this signal is
multiplied with the rectangular window –
It corresponds to a truncation of the signal to ytrunc[n] = cos(0n),
n=0:N-1;
Of interest are the DTFT and DFT of this truncated signal– and how they
e j 0 n  e  j  0 n
correspond. First we note that cos( 0  n) 
. If we utilize
2
the modulation rule it may be realized that - the DTFT-spectrum of the
truncated cosine becomes the Spectrum of the Window *½ and placed
centred in -0 and 0 respectively.
Let us verify this:
It looks a little "DC-displaced”, but it is correct
Exercise: why is the spectrum "DC-displaced”? Eventually we look at the
fft of our N samples – hopefully they are N samples in this DTFT-
DSM4/ECE45/amh
Page 11 of 11
2π
spectrum, placed with a distance
N
28-07-2017
Looks quite all right!
Exercise: 1) Is leakage present in this fft-spectrum?
2) How is the leakage related to the value of 0
3) Try to suggest a value of 0 , that does not give leakage – and stem its
length N fft-spectrum in order to verify that there’s no leakage
4) Choose a hamming window to truncate our cosine:
Let 0 = 0.7 and N=16; Graph the DTFT and the fft in the same graph –
what does it look like compared to the graph above?
5) If we choose a fixed length N of our sampling – do the discrete fft
harmonics depend on 0 ?
6) Will the DTFT depend on the value of 0 ?
Conclusion:
The idea behind truncating a sinusoid with other windows than the most
obvious rectangular led us in the exercise above to smaller leakage pins – at
the expense of a wider main lobe – which is the inevitable prize to pay in
spectral analysis
We have seen in producing FIR filters from ideal infinite impulse responses
by applying a truncation window symmetrically that we were able to specify
a given stop band damping ( or more rarely: a given ripple variation) by
choosing a suitable window – but at a prize here once again: the larger the
damping the wider the transition width.
PS. Truncation of the time signal hideal[n] with a given window
w[n]corresponds to the multiplication in the time domain: hideal[n].*w[n] –
and thus it corresponds to a convolution in the DTFT-domain.
This must then be a circular continuous convolution – refer to ‘Properties
of the DTFT’. This ‘monster’ will turn up now and then in DSP – and it is
described in the link to Johns Hopkins University