0% found this document useful (0 votes)
83 views30 pages

Dsp@unit 1

Uploaded by

Adithya Kanna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views30 pages

Dsp@unit 1

Uploaded by

Adithya Kanna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Digital Signal Processing

MATRUSRI ENGINEERING COLLEGE


Saidabad, Hyderabad-500 059.
(Approved by AICTE & Affiliated to Osmania University)
All Branches Accredited by NBA

Course Name : DIGITAL SIGNAL PROCESSING

Course Code : PC408EC

Semester : V SEM (2022-23)

Department of

ELECTRONICS AND COMMUNICATION ENGINEERING

Matrusri Engg. College, Saidabad Dept.


of ECE
1
Digital Signal Processing

UNIT-I

DISCRETE FOURIER TRANSFORM AND FAST FOURIER TRANSFORM

 Discrete Fourier Transform (DFT)


 Computation of DFT- Linear and Circular Convolution
 Fast Fourier Transform (FFT) algorithms: Radix-2 case
 Decimation in Time and
 Decimation in Frequency algorithms
 In place computation
 Bit reversal.

Matrusri Engg. College, Saidabad Dept.


of ECE
2
Digital Signal Processing

Introduction:

 Let’s start with the individual meaning of the words defining Digital Signal Processing in
its entirety.
o Digital: In digital communication, we use discrete signals to represent data using binary
numbers.
o Signal: A signal is anything that carries some information. It’s a physical quantity that
conveys data and varies with time, space, or any other independent variable. It can be in
the time/frequency domain. It can be one-dimensional or two-dimensional. Here are all
the major types of signals.
o Processing: The performing of operations on any data in accordance with some
protocol or instruction is known as processing.
o System: A system is a physical entity that is responsible for the processing. It has the
necessary hardware to perform the required arithmetic or logical operations on a signal.
Here are all the major types of systems.
 Putting all these together, we can get a definition for DSP.

Digital Signal Processing (DSP):


Digital Signal Processing is the process of representing signals in a discrete
mathematical sequence of numbers and analyzing, modifying, and extracting the
information contained in the signal by carrying out algorithmic operations and
processing on the signal.
Block diagram of a DSP system

Fig.(1): Block diagram of a digital signal processing system (DSP)

 The first step is to get an electrical signal. The transducer (in our case, a microphone)

Matrusri Engg. College, Saidabad Dept.


of ECE
3
Digital Signal Processing

converts sound into an electrical signal. You can use any transducer depending upon
the case.
 Once you have an analog electrical signal, we pass it through an operational amplifier
(Op-Amp) to condition the analog signal. Basically, we amplify the signal. Or limit it to
protect the next stages.
 The anti-aliasing filter is an essential step in the conversion of analog to a digital signal.
It is a low-pass filter. Meaning, it allows frequencies up to a certain threshold to pass. It
attenuates all frequencies above this threshold. These unwanted frequencies make it
difficult to sample an analog signal.
 The next stage is a simple analog-to-digital converter (ADC). This unit takes in analog
signals and outputs a stream of binary digits.
 The heart of the system is the digital signal processor. These days we use CMOS chips
(even ULSI) to make digital signal processors. In fact, modern processors, like the
Cortex M4 have DSP units built inside the SoC. These processor units have high-speed,
high data throughputs, and dedicated instruction sets.
 The next stages are sort of the opposite of the stages preceding the digital signal
processor.
 The digital-to-analog converter does what its name implies. It’s necessary for the slew
rate of the DAC to match the acquisition rate of the ADC.
 The smoothing filter is another low-pass filter that smoothes the output by removing
unwanted high-frequency components.
 The last op-amp is just an amplifier.
 The output transducer is a speaker in our case. You can use anything else according to
your requirements.

Applications of a Digital signal processing system:


We use digital signal processing in:
 Telecommunication
 For echo cancellation.
 Equalization – Think about tuning your radio for bass and treble).
 Filtering – Removing unwanted signals using specially designed filters like
the Infinite Impulse Response Filter (IIR).
 Multiplexing and repeating signals.
 Instrumentation and Control
 In designing Phase Locked Logic (PLL).
 Noise reduction circuits.
 Compression of signals.
 Function generators.
 Digital Image Processing

Matrusri Engg. College, Saidabad Dept.


of ECE
4
Digital Signal Processing

 Compression of an image.
 Enhancement, reconstruction, and restoration of an image.
 Analysis or face detection (like Snapchat).
 Speech Processing
 Digital audio synthesis.
 Speech recognition and analysis.
 Medicine
 X-rays, ECGs, EEGs.
 Signal filtering
 Noise removal and shaping of signal spectrums.
 Military
 Sonar and navigation.
 Analysis after tracking in radars.
 Consumer electronics
 Music players
 Professional music turntables (like the ones DJs use).

Advantages of a Digital Signal processing system:


A digital signal processing system enjoys many benefits over an analog signal
processing system. Some of these advantages are briefly outlined below:
 Less overall noise
o Since the signals are digital and inherently possess a low probability of getting mixed
with unwanted signals, the entire system benefits. Thus, DSPs don’t really have as much
noise to deal with comparatively.
 Error detection and correction is possible in DSPs
o Again, the presence of digital signal means we have access to many error detection and
correction features. For example, we can use parity generation and correction as a
detection and correction tool.
 Data storage is easier
o Yet again, an advantage because of digital signals. You know how easy it is to store
digital data, right? We can choose from a wide plethora of digital memories. However,
analog data needs to be stored in tapes and stuff like that. It’s harder to transport and
recreate with 100% fidelity.
 Encryption
o Digital signals are easy to encrypt. So this one counts as a win for the entire DSP
system too.
 Easier to process
o Digital signals can easily undergo mathematical changes as compared to their analog
counterparts.

Matrusri Engg. College, Saidabad Dept.


of ECE
5
Digital Signal Processing

 More data transmission


o Time-division multiplexing is a great tool available for digital systems to transmit more
data over unit time and over a single communication path.
 Higher component tolerance in DSP
o The components like resistors, capacitors, and inductors have a certain threshold in
terms of temperature. Outside this threshold, as the temperature increases, they might
start behaving erratically.
o These components are not present in a digital system. Moreover, digital systems can
increase their accuracy with concepts like floating-point arithmetic.
 Easier to modify
o To modify an analog processing system, you need to change components, test, and
verify the changes. With digital processing systems, you just need to change a few
commands or alter a few lines of code.
 DSP systems can work on frequencies of a broader range
o There are some natural frequencies, like seismic frequencies that detect earthquakes.
These signals have very low frequencies. Traditional analog signals might not even
detect these signals. However, digital signal processing systems are adept at picking up
even the tiniest of disturbances and also process them easily.
 Cost
o When working at scale, DSPs are cheaper.

Matrusri Engg. College, Saidabad Dept.


of ECE
6
Digital Signal Processing

Disadvantages of a Digital Signal processing system:


 Complexity
o As we saw in the block diagram above, there are a lot of elements preceding and
following a Digital Signal Processor. Stuff like filters and converters add to the
complexity of a system.
 Power
o A digital signal processor is made up of transistors. Transistors consume more power
since they are active components. A typical digital signal processor may contain
millions of transistors. This increases the power that the system consumes.
 Learning curve and design time
o Learning the ins and outs of Digital Signal processing involves a steep learning curve.
Setting up digital processing systems thus takes time. And if not pre-equipped with the
right knowledge and tools, teams can spend a lot of time in setting up.
 Loss of information
o Quantization of data that is below certain Hz causes a loss in data according to the Rate
-Distortion Theory.
 Cost
o For small systems, DSP is an expensive endeavor. Costing more than necessary.

Discrete Time Fourier Transform (DTFT) Vs Discrete Fourier Transform


(DFT)

In this section we will encapsulate the differences between Discrete Fourier Transform
(DFT) and Discrete-Time Fourier Transform (DTFT). Fourier transforms are a core
component of this digital signal processing course. So make sure you understand it
properly. If you are having trouble understanding the purpose of all these transforms,
check out this simple explanation of signal transforms.
DTFT:
DTFT stands for Discrete-Time Fourier Transform. We can represent it using the
following equation. Read the equation carefully.

∑ x(n)e
-jwn
X(w) =
n=-∞

Here, the signal has a period of 2π.


DFT:
DFT stands for discrete Fourier Transform. We can represent it using the following
equation.

Matrusri Engg. College, Saidabad Dept.


of ECE
7
Digital Signal Processing

N-1
-j2πkn
X(k) = ∑
n=0
x(n)e N

Probably the only things that you can notice in this equation are the fact that the
summation is over some finite series. Additionally, the exponential function seems to
have gotten a bit more complicated. Let’s address what these differences actually
translate to.

Difference between DFT and DTFT:


Another difference that you may have noticed is the fact that in DTFT, we are calculating
for a quantity X(ω). X(ω) represents a continuous frequency domain.
DTFT DFT
DTFT is an infinite continuous DFT is a finite non-continuous discrete sequence.
sequence where the time signal (x(n)) DFT, too, is calculated using a discrete-time
is a discrete signal. signal.
DTFT is periodic DFT has no periodicity.
The DTFT is calculated over an The DFT is calculated over a finite sequence of
infinite summation; this indicates that values. This indicates that the result is non-
it is a continuous signal. continuous.
The continuous variable found in the DTFT (ω) is
replaced with a finite number of frequencies
located at 2πk/NTs. Here Ts is the sampling rate.
The ω in the exponential function is a In other words, if we take the DTFT signal and
continuous frequency variable. sample it in the frequency domain at
omega=2π/N, then we get the DFT of x(n). In
summary, you can say that DFT is just a sampled
version of DTFT.
DTFT gives a higher number of DFT gives a lower number of frequency
frequency components. components.
DTFT is defined from minus infinity to
plus infinity, so naturally, it contains DFT is defined from 0 to N-1; it can have only
both positive and negative values of positive frequencies.
frequencies.
To improve the accuracy of DFT, the number of
samples must be very high. However, this will, in
More accurate
turn, cause a significant increase in the required
computational power. So it’s a trade-off.
DTFT will contain some of the values DTFT and DFT will coincide at intervals of
Matrusri Engg. College, Saidabad Dept.
of ECE
8
Digital Signal Processing

of DFT too. omega=2ωk/N where k = 0,1,2…N-1.

Twiddle factors in DSP for calculating DFT, FFT and IDFT:


Throughout this Digital Signal Processing course, we are/will be seeing a trend of
simplifying mathematical operations. From the various transforms (Laplace, Z, and
Fourier) to using different forms of number representations, the general objective is to
simplify and optimize calculations. The twiddle factor is a major key component in this
pursuit of simplicity.
Contents
What are twiddle factors?
Twiddle factors (represented with the letter W) are a set of values that is used to speed
up DFT and IDFT calculations.
For a discrete sequence x(n), we can calculate its Discrete Fourier Transform (DFT) and
Inverse Discrete Fourier Transform (IDFT) using the following equations.

-j2πkn
DFT: X(k) = ∑N-1
n=0
x(n)e N

j2πkn
1 N-1
IDFT: x(n) = ∑n=0X(k)e N
N
The computation procedure for the above is quite complex.
To be pedantic, the DFT requires NxN complex multiplications and N(N-1) complex
2
additions. Without the twiddle factor, the computational complexity of DFT is O(n ).
With twiddle factors, the computational complexity is Nlog2N. Let’s keep this
information aside for a moment though.
Twiddle factors are mathematically represented as:
-j2π
WN = e N

Rewriting the equations for calculating DFT and IDFT using twiddle factors we get:
DFT:
N-1

X(k) = ∑x(n)W
n=0
nk
N

IDFT:
N-1
1
x(n) =
N ∑X(k)W
n=0
-nk
N

Why do we use twiddle factors?


We use the twiddle factor to reduce the computational complexity of calculating DFT
and IDFT.
The twiddle factor is a rotating vector quantity. All that means is that for a given N-point

Matrusri Engg. College, Saidabad Dept.


of ECE
9
Digital Signal Processing

DFT or IDFT calculation, it is observed that the values of the twiddle factor repeat at
th
every N cycles. The expectation of a familiar set of values at every (N-1) step makes
the calculations slightly easier. (N-1 because the first sequence is a 0)
Alternatively, we can also say that the twiddle factor has periodicity/a cyclic property.
We’ll graphically see this below.

Cyclic property of twiddle factors


1. For a 4-point DFT
Let’s derive the twiddle factor values for a 4-point DFT using the formula above.
For n=0 and k=0,
nk 0 0
WN = W4 = e = 1

(From Euler’s formula:e = cosθ + isinθ)
Similarly calculating for the remaining values we get the series below:

( ) = (e )
-j2π 0 -jπ 0
0 0
W4 = e 4 2 = e = cos0 + jsin0 = 1

= (e ) = (e )
-j2π 1 -jπ 1 -jπ
1 π π
W4 4 2 = e 2 = cos - jsin = 0 - j×1 = -j
2 2

= (e ) = (e )
-j2π 2 -jπ 2
2 -jπ
W4 4 2 =e = cosπ - jsinπ = -1 - j×0 = -1

= (e ) = (e )
-j2π 3 -jπ 3 -j3π
3 3π 3π
W4 4 2 =e 2 = cos - jsin = 0 - j×-1 = j
2 2

( ) = (e )
-j2π 4 -jπ 4
4 -j2π
W4 = e 4 2 =e = cos2π - jsin2π = 1 - j×0 = 1
th
As you can see, the value starts repeating at the 4 instant. This periodic property can is
shown in the diagram below.

Fig.(2): Twiddle factor calculations

2. For an 8-point DFT


Let’s derive the twiddle factor values for an 8-point DFT using the formula above.
For n=0 and k=0,

Matrusri Engg. College, Saidabad Dept.


of ECE
10
Digital Signal Processing

0
W8 = 1
Similarly calculating for the remaining values we get the series below:
0
W8 = 1
1
W8 = 0.707-0.707j
2
W8 = -j
3
W8 = -0.707-0.707j
4
W8 = -1
5
W8 = -0.707+0.707j
6
W8 = j
7
W8 = 0.707+0.707j
8
W8 = 1
th
As you can see, the value starts repeating at the 8 instant. This periodic property can is
shown in the diagram below.

Fig.(2): Twiddle factor calculations

Matrusri Engg. College, Saidabad Dept.


of ECE
11
Digital Signal Processing

Problems on DFT:
1. Find the DFT of a sequence x[n]=[1,0,-1,0]

N=4

N-1
-j2πkn
X(k) = ∑
n=0
x(n)e N 0 ≤ k ≤ N-1

3
-j2πkn
X(k) = ∑x(n)e
n=0
4 0≤k≤3

3
-jπkn
X(k) = ∑x(n)e
n=0
2 0≤k≤3

For k = 0 →X(0) = ∑x(n)e


n=0
0
= x[0] + x[1] + x[2] + x[3] = 1 + 0 - 1 + 0 = 0

3
-jπn -jπ0 -jπ1 -jπ2 -jπ3
For k = 1 →X(1) = ∑
n=0
x(n)e 2 = x[0]e 2 + x[1]e 2 + x[2]e 2 + x[3]e 2

-jπ1 -jπ3
0 -jπ
= 1×e + 0×e 2 - 1×e + 0×e 2 = 1 - 1×(cosπ-jsinπ) = 1 - (-1) = 2

For k = 2 →X(2) = ∑x(n)e


-jπn -jπ0 -jπ1 -jπ2 -jπ3 0 -jπ1 -j2π -jπ3
= x[0]e + x[1]e + x[2]e + x[3]e = 1×e + 0×e - 1×e + 0×e
n=0

= 1 - 1×(cos2π-jsin2π) = 1 - (1) = 0

3
-j3πn -j3π0 -j3π1 -j3π2 -j3π3
For k = 3 →X(3) = ∑
n=0
x(n)e 2 = x[0]e 2 + x[1]e 2 + x[2]e 2 + x[3]e 2

-j3π1 -j9π
0 -j3π
= 1×e + 0×e 2 - 1×e + 0×e 2 = 1 - 1×(cos3π-jsin3π) = 1 - (-1) = 2

Therefore X[k]= [0, 2, 0, 2]

Matrix method of calculating DFT and IDFT with twiddle factors:


The above DFT equation using the twiddle factor can also be written in matrix form. The
matrix form of calculating a DFT and an IDFT eases up many calculations.
X(k) = WN x(n)
Similarly an IDFT can be calculated using a matrix form using the following equation.
*
WN
x(n) = X(k)
N

Matrusri Engg. College, Saidabad Dept.


of ECE
12
Digital Signal Processing

*
Here, WN is the complex conjugate of the twiddle factor. To get the values of the
complex conjugate, just invert the signs of the complex components of the twiddle
factor. For example: The complex conjugate of 0.707+0.707j will become 0.707-0.707j.

DFT as linear transform:


The matrix of WN is known as the matrix of linear transformation. Check out the scene
of the linear transformation in DFT below.
We have the formula for calculating DFT using a matrix as:
X(k) = WN x(n)
-1
x(n) = WN X(k)
We also have the formula for calculating the IDFT using a matrix as:
*
WN
x(n) = X(k)
N
Equating the last two equations:
*
-1
WN
WN =
N
*
WNWN = NIN
Here, ‘I’ is an identity matrix of order N. This equation represents the fact that the DFT
displays linear transformation characteristics.
Now that we understand the twiddle factor, we can also see how it is used practically in
the calculation of IDFT using the Decimation in Frequency FFT algorithm

DFT Linear Filtering:


DFT provides an alternative approach to time domain convolution. It can be used to
perform linear filtering in frequency domain.
Thus, Y(ω)=X(ω).H(ω)⟷y(n).
The problem in this frequency domain approach is that Y(ω), X(ω) and H(ω) are
continuous function of ω, which is not fruitful for digital computation on computers.
However, DFT provides sampled version of these waveforms to solve the purpose.
The advantage is that, having knowledge of faster DFT techniques likes of FFT, a
computationally higher efficient algorithm can be developed for digital computer
computation in comparison with time domain approach.
Consider a finite duration sequence, [x(n)=0, for n<0 and n≥L] generalized equation,
excites a linear filter with impulse response [h(n)=0,for n<0 and n≥M].
x(n)h(n)
M-1

output = y(n) = ∑h(k).x(n-k)


k=0

From the convolution analysis, it is clear that, the duration of y(n) is L+M−1.
Matrusri Engg. College, Saidabad Dept.
of ECE
13
Digital Signal Processing

In frequency domain,
Y(ω)=X(ω).H(ω)
Now, Y(ω) is a continuous function of ω and it is sampled at a set of discrete
frequencies with number of distinct samples which must be equal to or exceeds L+M−1.
DFT size = N ≥ L+M−1

With w = k,
N
Y(ω)=X(k).H(k), where k=0,1,….,N-1
Where, X(k) and H(k) are N-point DFTs of x(n) and h(n) respectively. x(n) & h(n) are
padded with zeros up to the length N. It will not distort the continuous
spectra X(ω) and H(ω). Since N≥L+M−1, N-point DFT of output sequence y(n) is
sufficient to represent y(n) in frequency domain and these facts infer that the
multiplication of N-point DFTs of X(k) and H(k), followed by the computation of N-point
IDFT must yield y(n).
This implies, N-point circular convolution of x(n) and h(n) with zero padding, equals to
linear convolution of x(n) and h(n).
Thus, DFT can be used for linear filtering.
Caution − N should always be greater than or equal to L+M−1. Otherwise, aliasing effect
would corrupt the output sequence.

Graphical interpretation:

 Reflection of h(k) resulting in h(-k)

 Shifting of h(-k) resulting in h(n-k)

 Element wise multiplication of the sequences x(k) and h(n-k)

 Summation of the product sequence x(k)h(n-k) resulting in the convolution value


for y(n).

Example:

x(n) = {1, 2, 3, 1}
h(n) = {1, 1, 1}
length(y(n)) = length(x(n)) + length(h(n)) -1
=4+3–1=6

Matrusri Engg. College, Saidabad Dept.


of ECE
14
Digital Signal Processing

Matrusri Engg. College, Saidabad Dept.


of ECE
15
Digital Signal Processing

The linear convolution output is y(n) = {1, 3, 6, 6, 4, 1}

DFT Circular Convolution:

Let us take two finite duration sequences x1(n) and x2(n), having integer length as N.
Their DFTs are X1(k) and X2(k) respectively, which is shown below
N-1
-j2πkn
X1(k) = ∑
n=0
x1(n)e N k = 0,1,2,3,……N - 1
N-1
-j2πkn
X2(k) = ∑
n=0
x2(n)e N k = 0,1,2,3,……N - 1

Now, we will try to find the DFT of another sequence x3(n), which is given as X3(k)
X3(k) = X1(k) × X2(k)
By taking the IDFT of the above we get
N-1
j2πkn
1
x3(n) =
N ∑ k=0
X3(k)e N

After solving the above equation, finally, we get


N-1
j2πkn
1
x3(n) =
N ∑
k=0
X1(k)×X2(k)e N

N-1
1
x3(n) =
N ∑x (m)x [((n-m)) ]
k=0
1 2 N
m=0,1,2,3,…….N-1

Comparison points Linear Convolution Circular Convolution

Matrusri Engg. College, Saidabad Dept.


of ECE
16
Digital Signal Processing

Shifting Linear shifting Circular shifting


Samples in the N1+N2−1 Max(N1,N2)
convolution result
Finding response of a Possible Possible with zero
filter padding
Methods of Circular Convolution:
Generally, there are two methods, which are adopted to perform circular convolution
and they are
 Concentric circle method
 Matrix multiplication method.
Concentric Circle Method:
Let x1(n) and x2(n) be two given sequences. The steps followed for circular convolution
of x1(n) and x2(n) are
 Take two concentric circles. Plot N samples of x1(n) on the circumference of the
outer circle maintaining equal distance successive points in anti-clockwise
direction.
 For plotting x2(n), plot N samples of x2(n) in clockwise direction on the inner
th
circle, starting sample placed at the same point as 0 sample of x1(n)

 Multiply corresponding samples on the two circles and add them to get output.
 Rotate the inner circle anti-clockwise with one sample at a time.
Let x1(n) and x2(n) are finite duration sequences both of length N with DFT’s X1(k) and
X2(k). Convolution of two given sequences x1(n) and x2(n) is given by the equation

X3(k) = X1(k). X2(k)

x3(n) = IDFT[X3(k)]
N-1

x3(n) = ∑x (m)x ((n-m))


m=0
1 2 N

Example:
Let’s take x1(n) = {1, 1, 2, 1} and x2(n) = {1, 2, 3, 4}
Arrange x1(n) and x2(n) in circular fashion as shown below.

Matrusri Engg. College, Saidabad Dept.


of ECE
17
Digital Signal Processing

To get x2(-m), rotate x2(m) by 4 samples in clockwise direction.


x2(-m)

x3(0) = x1(m) x2(-m)


= x1(0) x2(0) + x1(1) x2(3) + x1(2) x2(2) + x1(3) x2(1)
= 1+ 4+6+2
= 13
Keep x1(m) constant and rotate x2(-m) once to compute further values.
To get x3(1) rotate x2(-m) by one sample in anti-clockwise direction.
x2(1-m)

Matrusri Engg. College, Saidabad Dept.


of ECE
18
Digital Signal Processing

x3(1) = x1(m) x2(1-m)


= x1(0) x2(1) + x1(1) x2(0) + x1(2) x2(3) + x1(3) x2(2)
= 2+ 1+8+3
= 14
To get x3(2) rotate x2(1-m) by one sample in anti-clockwise direction.
x2(2-m)

x3(2) = x1(m) x2(2-m)


= x1(0) x2(2) + x1(1) x2(1) + x1(2) x2(0) + x1(3) x2(3)
= 3+ 2+2+4
= 11
To get x3(3) rotate x2(2-m) by one sample in anti-clockwise direction.
x2(3-m)

x3(3) = x1(m) x2(3-m)


= x1(0) x2(3) + x1(1) x2(2) + x1(2) x2(1) + x1(3) x2(0)
= 4+ 3+4+1
= 12
The convoluted signal is,
x3(n) = {13, 14, 11, 12}

Matrix Multiplication Method:


Matrix method represents the two given sequence x1(n) and x2(n) in matrix form.
 One of the given sequences is repeated via circular shift of one sample at a time
to form a N × N matrix.
Matrusri Engg. College, Saidabad Dept.
of ECE
19
Digital Signal Processing

 The other sequence is represented as column matrix.


 The multiplication of two matrices gives the result of circular convolution.
Example: Find the circular convolution of two sequences using matrix multiplication
method. x1(n) = {1,2,2,1} and x2(n) = {1,2,3,1}
Let x1(n) and x2(n) are finite duration sequences both of length N with DFT’s X1(k) and
X2(k). Convolution of two given sequences x1(n) and x2(n) is given by the equation

X3(k) = X1(k). X2(k)

x3(n) = IDFT[X3(k)]
N-1 N-1

x3(n) = ∑x (m)x ((n-m)) = ∑x (m)x ((n-m))


m=0
1 2 N
m=0
2 1 N

1 1 3 2  1  1  2  6  2  11 
x3(n) = 2 1 1

3 2
  2  2  2  3   9 
      
3 2 1 1  2   3  4  2  1  10 
      
1 3 2 1  1   1  6  4  1  12 

DFT Sectional Convolution

Suppose, the input sequence x(n) of long duration is to be processed with a system
having finite duration impulse response by convolving the two sequences. Since, the
linear filtering performed via DFT involves operation on a fixed size data block, the input
sequence is divided into different fixed size data block before processing.
The successive blocks are then processed one at a time and the results are combined
to produce the net result.
As the convolution is performed by dividing the long input sequence into different fixed
size sections, it is called sectioned convolution. A long input sequence is segmented to
fixed size blocks, prior to FIR filter processing.
Two methods are used to evaluate the discrete convolution −
 Overlap-save method
 Overlap-add method

Overlap Save Method:


Overlap–save is the traditional name for an efficient way to evaluate the discrete
convolution between a very long signal x(n) and a finite impulse response FIR filter h(n).
Matrusri Engg. College, Saidabad Dept.
of ECE
20
Digital Signal Processing

Given below are the steps of Overlap save method.


Let the length of input data block = N = L+M-1. Therefore, DFT and IDFT length = N.
Each data block carries M-1 data points of previous block followed by L new data points
to form a data sequence of length N = L+M-1.
 First, N-point DFT is computed for each data block.
 By appending L−1 zeros, the impulse response of FIR filter is increased in length and N
point DFT is calculated and stored.
 Multiplication of two N-point DFTs H(k) and Xm(k) : Y′m(k) = H(k).Xm(k), where K=0,1,2,..N
-1
 Then, IDFT[Y′m(k)] = y′(n) = [y′m(0), y′m(1), y′m(2),.......y′m(M−1), y′m(M),.......y′m(N−1)]
here, N−1=L+M−2
 First M-1 points are corrupted due to aliasing and hence, they are discarded because the
data record is of length N.
 The last L points are exactly same as a result of convolution, so
y′m(n) = ym(n) where n = M, M+1,….N-1
 To avoid aliasing, the last M-1 elements of each data record are saved and these points
st
carry forward to the subsequent record and become 1 M-1 elements.

 Result of IDFT, where first M-1 Points are avoided, to nullify aliasing and remaining L
points constitute desired result as that of a linear convolution.

Overlap Add Method:


Given below are the steps to find out the discrete convolution using Overlap method −
Let the input data block size be L. Therefore, the size of DFT and IDFT: N = L+M-1
 Each data block is appended with M-1 zeros to the last.
 Compute N-point DFT.

Matrusri Engg. College, Saidabad Dept.


of ECE
21
Digital Signal Processing

 Two N-point DFTs are multiplied: Ym(k) = H(k).Xm(k), where k = 0,,1,2,….,N-1


 IDFT [Ym(k)] produces blocks of length N which are not affected by aliasing as the size
of DFT is N = L+M-1 and increased lengths of the sequences to N-points by appending
M-1 zeros to each block.
 Last M-1 points of each block must be overlapped and added to first M-1 points of the
succeeding block.
Reason: Each data block terminates with M−1 zeros
Hence, this method is known Overlap-add method. Thus, we get −
y(n) = {y1(0), y1(1), y1(2), ... .., y1(L−1), y1(L)+y2(0), y1(L+1)+y2 (1), ... ... ..,
y1 (N−1)+y2 (M−1), y2 (M), ... ... ... ... ... }

Properties of DFT:
All of these properties of the discrete Fourier transform (DFT) are applicable for discrete
-time signals that have a DFT. Meaning these properties of DFT apply to any generic
-j2πkn
↔ X(k)) where X(k) = ∑N-1
signal x(n) for which an X(k) exists. (x(n) DFT n=0
x(n)e N .
Property Mathematical Representation
Linearity ↔ a1X1(k) + a2X2(k)
a1x1(n)+a2x2(n) DFT
if x(n+N) = x(n) for all n
Periodicity
then X(k+N) = X(k) for all k
Time reversal ↔ X(N-k)
x(N-n) DFT
Duality x(n) ↔ Nx[((-k))N]
DFT

Circular convolution ↔X1(k).X2(k)


x1(n) * x2(n) DFT
For x(n) and y(n), circular correlation rxy(l) is
Circular correlation
↔ Rxy(k) = X(k).Y*(k)
rxy(l) DFT
↔ X(k+l)
2πjln/N DFT
x(n)e
Circular frequency shift
↔ X(k-l)
-2πjln/N DFT
x(n)e
↔ X(k)e
-2πjlk/N
x((n-l))N = x(n-l) DFT
Circular time shift kl
or X(k)W N where W is the twiddle factor.
If the circular shift is in
Circular symmetries of a  anti-clockwise direction (positive): Delayed discrete-
sequence time signal
 clockwise direction (negative): Advanced discrete-time

Matrusri Engg. College, Saidabad Dept.


of ECE
22
Digital Signal Processing

signal
 Time reversal: Obtained by reversing samples of the
discrete-time sequence about zero axis/locating x(n) in
a clockwise direction.
1
Multiplication ↔ (X1(k)*X2(k))
x1(n) . x2(n) DFT
N
Complex conjugate ↔ X*(N-k)
x*(n) DFT
For even sequences:
X(k) = ∑N-1
n=0
x(n)Cos(2πnk/N)
Symmetry
For odd sequences:
X(k) = ∑N-1
n=0
x(n)Sin(2πnk/N)
1 N-1
Parseval’s theorem ∑N-1
n=0
x(n).y*(n) = ∑ X(k).Y*(k)
N n=0

Fast Fourier Transform (FFT)


In earlier DFT methods, we have seen that the computational part is too long. We want
to reduce that. This can be done through FFT or fast Fourier transform. So, we can say
FFT is nothing but computation of discrete Fourier transform in an algorithmic format,
where the computational part will be reduced.
The main advantage of having FFT is that through it, we can design the FIR filters.
Mathematically, the FFT can be written as follows;
N-1

X(k) = ∑x(n)W
n=0
nk
N

Let us take an example to understand it better. We have considered eight points named
from x0 to x7. We will choose the even terms in one group and the odd terms in the
other. Diagrammatic view of the above said has been shown below

Here, points x0, x2, x4 and x6 have been grouped into one category and similarly, points
x1, x3, x5 and x7 has been put into another category. Now, we can further make them in
a group of two and can proceed with the computation. Now, let us see how these

Matrusri Engg. College, Saidabad Dept.


of ECE
23
Digital Signal Processing

breaking into further two are helping in computation.


N N
-1 -1
2 2

∑x(2r)W ∑x(2r+1)W
2rk (2r+1)k
X(k) = N
+ N
r=0 r=0
N N
-1 -1
2 2

= ∑x(2r)W
r=0
rk
N 2
+ ∑x(2r+1)W
r=0
rk
N 2
×WN
k

k
= G(k) + H(k). WN

Initially, we took an eight-point sequence, but later we broke that one into two parts G[k]
and H[k]. G[k] stands for the even part whereas H[k] stands for the odd part. If we want
to realize it through a diagram, then it can be shown as below

Fig.(3): Butterfly structure of DIT-FFT

From the above figure, we can see that


8
W4 =−1
8 8
W5 =−W1
8 8
W6 =−W2
8 8
W7 =−W3
Similarly, the final values can be written as follows −
G[0]−H[0]=x[4]
8
G[1]−W1 H[1]=x[5]
8
G[2]−W2 H[2]=x[6]
8
G[3]−W3 H[3]=x[7]
The above one is a periodic series. The disadvantage of this system is that K cannot be
broken beyond 4 point. Now Let us break down the above into further. We will get the
Matrusri Engg. College, Saidabad Dept.
of ECE
24
Digital Signal Processing

structures something like this

Fig.(4): Butterfly structure of DIT-FFT

Example

Consider the sequence x[n]={ 2,1,-1,-3,0,1,2,1}. Calculate the FFT.


Solution − The given sequence is x[n]={ 2,1,-1,-3,0,1,2,1}
Arrange the terms as shown below;

Fig.(5): Butterfly structure of DIT-FFT

In-Place Computation

This efficient use of memory is important for designing fast hardware to calculate the
FFT. The term in-place computation is used to describe this memory usage.

Matrusri Engg. College, Saidabad Dept.


of ECE
25
Digital Signal Processing

Decimation in Time Sequence:


In this structure, we represent all the points in binary format i.e. in 0 and 1. Then, we reverse those
structures. The sequence we get after that is known as bit reversal sequence. This is also known
as decimation in time sequence. In-place computation of an eight-point DFT is shown in a tabular
format as shown below –

POINTS BINARY REVERSAL EQUIVALENT


FORMAT POINTS
0 000 000 0
1 001 100 4
2 010 010 2
3 011 110 6
4 100 001 1
5 101 101 5
6 110 011 3
7 111 111 7

Decimation in Frequency Sequence (DIF-FFT):


Apart from time sequence, an N-point sequence can also be represented in frequency.
Let us take a four-point sequence to understand it better.
Let the sequence be x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]. We will group two points into
one group, initially. Mathematically, this sequence can be written as;
N-1

X[k] = ∑x[n]W
n=0
nk
N

Matrusri Engg. College, Saidabad Dept.


of ECE
26
Digital Signal Processing

Now let us make one group of sequence number 0 to 3 and another group of sequence
4 to 7. Now, mathematically this can be shown as;
N
-1
2 N-1

X[k] = ∑x[n]W
n=0
nk
N
+ ∑ x[n]W nk
N
n=N 2

Let us replace n by r, where r = 0, 1 , 2….N/2−1. Mathematically,


N
-1
2

X[k] = ∑x[r]W
r=0
rk
N 2

We take the first four points x[0], x[1], x[2], x[3] initially, and try to represent them
mathematically as follows
3 3

∑x[n]W ∑x[n+4]W
nk (n+4)k
8
+ 8
n=0 n=0

[ ]
3 3

= ∑x[n]+∑x[n+4]W
n=0 n=0
4k
8
×W8
nk

now
3

X[0] = ∑(x[n]+x[n+4])
n=0
3

X[1] = ∑(x[n]-x[n+4])W
n=0
nk
8

1
=(x[0]−x[4])+(x[1]−x[5]) W8+(X[2]−X[6])
2 3
W8+(X[3]−X[7]) W8
We can further break it into two more parts, which means instead of breaking them as 4
-point sequence, we can break them into 2-point sequence.

Computing Inverse DFT (IDFT) using DIF FFT algorithm – IFFT


What is FFT?

 We use N-point DFT to convert an N-point time-domain sequence x(n) to an N-


point frequency domain sequence x(k).
 The purpose of performing a DFT operation is so that we get a discrete-time
signal to perform other processing like filtering and spectral analysis on it.
 However, the process of calculating DFT is quite complex.
 It requires NxN complex multiplications and N(N+1) complex additions.

Matrusri Engg. College, Saidabad Dept.


of ECE
27
Digital Signal Processing

 Cooley and Turkey were two mathematicians who came up with FFT – Fast
Fourier Transforms. This is a method of calculating DFT a bit faster.
 To be precise, the FFT took down the complexity of complex multiplications from
2 N N
N to log2 .
2
 Thus, the FFT (Fast Fourier Transform) is nothing but a more efficient way of
calculating the DFT (Discrete Fourier Transform).
 The FFT is basically two algorithms that we can use to compute DFT.
o Decimation in Time algorithm (DIT).
o Decimation in Frequency algorithm (DIF).
 The gist of these two algorithms is that we break up the signal in either time and
frequency domains and calculate the DFTs for each and then add the results up.
 We have taken an in-depth look into both of these algorithms in this Digital Signal
Processing course.

How can we use the FFT algorithm to calculate inverse DFT (IDFT)?
Check out the formulae for calculating DFT and inverse DFT below.
-j2πkn
DFT: X(k) = ∑N-1
n=0
x(n)e N

j2πkn
1 N-1
IDFT: x(n) = ∑k=0X(k)e N
N
As you can see, there are only three main differences between the formulae.

 In DFT we calculate discrete signal X(k) using a continuous signal x(n). Whereas
in the IDFT, it’s the opposite.
 In the IDFT formula, we have two different multiplying factors.
o The factor 1/N
-nk nk
o The factor WN which is the complex conjugate of the twiddle factor WN .
 Thus if we multiply with a factor of 1/N and replace the twiddle factor with its
complex conjugate in the DIF algorithm’s butterfly structure, we can get the IDFT
using the same method as the one we used to calculate FFT.
 In this case, DIF and DIT algorithms are the same.
 We’ll see the modified butterfly structure for the DIF FFT algorithm being used to
calculate IDFT.

Matrusri Engg. College, Saidabad Dept.


of ECE
28
Digital Signal Processing

Fig. (6): Butterfly diagram to calculate IDFT using DIF FFT

 From the above butterfly diagram, we can notice the changes that we have
incorporated. The inputs are multiplied by a factor of 1/N, and the twiddle factors
are replaced by their complex conjugates.

How to calculate values of conjugate twiddle factor?


Calculating the complex conjugates of the twiddle factor is easy. Just invert the sign of
the complex part of the non-conjugate values. The table below will help you understand
it better.

0 0
W8 = 1 W8 = 1
1 -1
W8 = 0.707-0.707j W8 = 0.707+0.707j
2 -2
W8 = -j W8 = j

Matrusri Engg. College, Saidabad Dept.


of ECE
29
Digital Signal Processing

3 -3
W8 = -0.707-0.707j W8 = -0.707+0.707j
4 -4
W8 = -1 W8 = -1
5 -5
W8 = -0.707+0.707j W8 = -0.707-0.707j
6 -6
W8 = j W8 = -j
7 -7
W8 = 0.707+0.707j W8 = 0.707-0.707j
8 -8
W8 = 1 W8 = 1
What is Inverse Fast Fourier Transform (IFFT)?
This method of using the FFT algorithms to calculate Inverse Discrete Fourier
Transform (IDFT) is known as IFFT (Inverse Fast Fourier Transform).

Matrusri Engg. College, Saidabad Dept.


of ECE
30

You might also like