Professional Documents
Culture Documents
Name:
Roll No:
Register No:
Sec:
Preface
Authors
K L UNIVERSITY
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
COURSE: III YEAR B.Tech A.Y: 2014-2015
LIST OF EXPERIMENTS
1. Computation of N-point DFT.
2. (a). Circular convolution in time domain and frequency domain.
K.L.University
INRODUCTION
MATLAB: MATLAB is a software package for high performance numerical
computation and visualization provides an interactive environment with hundreds of
built in functions for technical computation, graphics and animation. The MATLAB
name stands for MATrix Laboratory
MATLAB
Graphics
Computations
External interface
2D graphics
Linear algebra
3D graphics
Signal processing
Polynomials & interpolation
Toolbox
Signal processing
Image processing
Statistics
Control system
Page
K.L.University
At its core ,MATLAB is essentially a set (a toolbox) of routines (called m files or mex files)
that sit on your computer and a window that allows you to create new variables with names (e.g.
voltage and time) and process those variables with any of those routines (e.g. plot voltage against
time, find the largest voltage, etc).
It also allows you to put a list of your processing requests together in a file and save that combined
list with a name so that you can run all of those commands in the same order at some later time.
Furthermore, it allows you to run such lists of commands such that you pass in data and/or get data
back out (i.e. the list of commands is like a function in most programming languages). Once you
save a function, it becomes part of your toolbox (i.e. it now looks to you as if it were part of the
basic toolbox that you started with).
For those with computer programming backgrounds: Note that MATLAB runs as an interpretive
language (like the old BASIC). That is, it does not need to be compiled. It simply reads through
each line of the function, executes it, and then goes on to the next line. (In practice, a form of
compilation occurs when you first run a function, so that it can run faster the next time you run
it.).
Page
K.L.University
EXPERIMENT NO: 1
Date:
Computation of N point D.F.T
Introduction:
The Discrete Time Fourier Transform (DTFT) is the member of the Fourier transform
family that operates on aperiodic, discrete signals. Discrete Fourier Transform (D.F.T) is used to
practically implement D.T.F.T and determine the frequency components of the given signal. D.F.T
is usually the sampled version of the Frequency spectrum.
Aim:
To compute the N-point D.F.T of a given sequence.
Software Used :
Matlab
Theory:
Discrete Fourier Transform (DFT) is used for performing frequency analysis of discrete
time signals. DFT gives a discrete frequency domain representation whereas the other
transforms are continuous in frequency domain.
The N point DFT of discrete time signal x[n] is given by the equation
jw
X(k) is a complex number (remember e =cosw + jsinw). It has both magnitude and phase
which are plotted versus k. These plots are magnitude and phase spectrum of x[n]. The k
gives us the frequency information.
Here k=N in the frequency domain corresponds to sampling frequency (fs). Increasing N,
increases the frequency resolution, i.e., it improves the spectral characteristics of the
sequence. For example if fs=8kHz and N=8 point DFT, then in the resulting spectrum,
k=1 corresponds to 1kHz frequency. For the same fs and x[n], if N=80 point DFT is
computed, then in the resulting spectrum, k=1 corresponds to 100Hz frequency. Hence,
the resolution in frequency is increased.
Digital Signal Processing Laboratory Manual
4
Page
K.L.University
Since N L , increasing N to 8 from 80 for the same x[n] implies x[n] is still the same
sequence (<8), the rest of x[n] is padded with zeros. This implies that there is no further
information in time domain, but the resulting spectrum has higher frequency resolution.
This spectrum is known as high density spectrum (resulting from zero padding x[n]).
Instead of zero padding, for higher N, if more number of points of x[n] are taken (more
data in time domain), then the resulting spectrum is called a high resolution spectrum.
Algorithm:
1.
2.
3.
4.
Result:
enter the sequence=[1
2 1 0] enter the
length=5
Page
EXPERIMENT NO: 2 a
K.L.University
Date:
Page
EXPERIMENT NO: 2 b
K.L.University
Date:
Y(z)=z{x(n)*h(n)}=X(z)H(z).
where
X(z) is the z-transform of x(n).
H(z) is the z-transform of h(n).
Y(z) is the z-transform of y(n).
Page
K.L.University
Algorithm :
Page
K.L.University
Page
K.L.University
EXPERIMENT NO: 3 A
Date:
Implementation of D.I.T-F.F.T
Introduction:
Discrete Fourier transform is implemented in many ways. Fast Fourier Transform (FFT),
is an ingenious algorithm that decomposes a DFT with N points, into N DFTs each with a single
point. The FFT is typically hundreds of times faster than the other methods.
The FFT operates by decomposing an N point time domain signal into N time domain
signals each composed of a single point. The second step is to calculate the N frequency spectra
corresponding to these N time domain signals. Lastly, the N spectra are synthesized into a single
frequency spectrum.FFT is implemented using 2 algorithms Decimation in Time(D.I.T) and
Decimation in Frequency(D.I.F).
The decimation -in-time FFT algorithm is based on splitting (decimating) x(n) into
smaller sequences and finding X ( k ) from the DFTs of these decimated equences. This
decimation leads to an efficient algorithm when the sequence length is a power of 2. Since the
time samples which are divided up, this algorithm is known as the decimation in-time (DIT)
algorithm.
Aim:
To implement F.F.T using D.I.T-F.F.T algorithm
Software Used:
Matlab
Theory:
The CooleyTukey algorithm, named after J.W. Cooley and John Tukey, is the most
common fast Fourier transform (FFT) algorithm. It re-expresses the discrete Fourier transform
(DFT) of an arbitrary composite size N = N1N2 in terms of smaller DFTs of sizes N1 and N2,
recursively, in order to reduce the computation time to O(N log N) for highly-composite N
(smooth numbers). Because of the algorithm's importance, specific variants and implementation
styles have become known by their own names, as described below.
Because the Cooley-Tukey algorithm breaks the DFT into smaller DFTs, it can be
combined arbitrarily with any other algorithm for the DFT. For example, Rader's or Bluestein's
algorithm can be used to handle large prime factors that cannot be decomposed by Cooley
Tukey, or the prime-factor algorithm can be exploited for greater efficiency in separating out
relatively prime factors
A radix-2 decimation-in-time (DIT) FFT is the simplest and most common form of the
CooleyTukey algorithm, although highly optimized CooleyTukey implementations typically
Digital Signal Processing Laboratory Manual
11
Page
K.L.University
use other forms of the algorithm as described below. Radix-2 DIT divides a DFT of size N into
two interleaved DFTs (hence the name "radix-2") of size N/2 with each recursive stage.
The discrete Fourier transform (DFT) is defined by the formula:
However, these smaller DFTs have a length of N/2, so we need compute only N/2 outputs: thanks
to the periodicity properties of the DFT, the outputs for
from a DFT of length
N/2 are identical to the outputs for
. That is, Ek + N / 2 = Ek and Ok + N / 2 = Ok. The
phase factor exp[ 2 ik / N] (called a twiddle factor) obeys the relation: exp[ 2i(k + N / 2) /
i
N] = e
exp[ 2ik / N] = exp[ 2ik / N], flipping the sign of the Ok + N / 2 terms. Thus, the
whole DFT can be calculated as follows:
Page
K.L.University
This result, expressing the DFT of length N recursively in terms of two DFTs of size N/2, is the
core of the radix-2 DIT fast Fourier transform. The algorithm gains its speed by re-using the
results of intermediate computations to compute multiple DFT outputs. Note that final outputs
are obtained by a +/ combination of Ek and Okexp( 2ik / N), which is simply a size- 2 DFT
(sometimes called a butterfly in this context); when this is generalized to larger radices below,
the size-2 DFT is replaced by a larger DFT (which itself can be evaluated with an FFT).
Algorithm :
1)
2)
3)
4)
5)
Expected Figures:
Page
K.L.University
EXPERIMENT NO: 3 B
Date:
IMPLEMENTATION OF D.I.F-F.F.T
Introduction:
Discrete Fourier transform is implemented in many ways. Fast Fourier Transform (FFT),
is an ingenious algorithm that decomposes a DFT with N points, into N DFTs each with a single
point. The FFT is typically hundreds of times faster than the other methods.
The FFT operates by decomposing an N point time domain signal into N time domain
signals each composed of a single point. The second step is to calculate the N frequency spectra
corresponding to these N time domain signals. Lastly, the N spectra are synthesized into a single
frequency spectrum.FFT is implemented using 2 algorithms Decimation in Time(D.I.T) and
Decimation in Frequency(D.I.F).
In D.I.F algorithm the input is unaltered and its D.F.T is calculated. But the DFTs (X(k))
obtained will be splitted (in frequency domain), hence the name Decimation in Frequency.
Aim:
To implement F.F.T using D.I.F-F.F.T algorithm
Software Used:
Matlab
Theory :
The decimation-in-frequency (DIF) radix-2 FFT partitions the DFT computation into
even-indexed and odd-indexed outputs, which can each be computed by shorter-length DFTs of
different combinations of input samples. Recursive application of this decomposition to the
shorter-length DFTs results in the full radix-2 decimation-in-frequency FFT.
Algorithm :
1)
2)
3)
4)
5)
Page
K.L.University
Expected Figures:
Page
K.L.University
EXPERIMENT NO: 4 A
Date:
Design of IIR Butterworth and Chebyshev Filter using Impulse Invariant Technique
Introduction:
Almost each and every electronic system has filters in it. Filters allow some signal
frequencies applied at their input terminals to pass through their output terminals with little or no
reduction in signal level. There are 2 types of I.I.R filters namely butterworth and chebyshev. One
method to realize these filters is that they are first designed in analog domain and then
transformed into digital domain using transformation techniques.. One such technique is Impulse
invariance technique. In this the impulse response is kept invariant after transformation also.
Aim:
To design butterworth and chebyshev filters using impule invariant technique
Software Used :
Matlab
Theory:
IIR filters are one of two primary types of digital filters used in Digital Signal processing
applications. The word IIR means Infinite Impulse Response. The impulse response is infinite
because there is feedback in the filter; if you put in an impulse, an infinite number of non-zero
values will come out. IIR filters can achieve a given filtering characteristic using less memory and
calculations than a similar FIR filter. However they suffer from the following disadvantages. They
are more susceptible to problems of finite length arithmetic, such as noise generated by
calculations, and limit cycles. They are harder to implement using fixed-point arithmetic and they
do not offer the computational advantages of FIR filters for multirate applications. IIR filters have
the transfer function of the form
There are several methods that can be used to design digital filters having an infinite duration unit
impulse response. The most common technique involves first designing an analog prototype filter
and then transforming the prototype into a digital filter. The most commonly used techniques for
digitizing an analog filter are
(a) Approximation of derivatives
(b) Impulse invariance transformation
(c) Bilinear transformation
(d) Matched z-transformation
Digital Signal Processing Laboratory Manual
16
Page
K.L.University
Algorithm :
Page
K.L.University
Expected Figures:
(a) Butterworth filter
Page
K.L.University
EXPERIMENT NO: 4 B
Date:
Page
K.L.University
-z 1
In bilinear transformation s is replaced by 2 (1
)
T 1+z1
Algorithm :
(a)
Butterworth filter
Page
(b)
K.L.University
Chebyshev filter
Page
EXPERIMENT NO: 5
Date:
F.I.R Filter Design using Windows
Introduction:
An important step in development of a digital filter is the determination of a realizable
transfer function H(z). The process of deriving H(z) is called as digital filter design. The
characteristics of FIR filters is that they can achieve linear phase frequency response. They can be
efficiently realized on general or special purpose hardware. But the implementation of narrow
transition band is costly as it requires more arithmetic operations and hardware components.
Unlike IIR filter design, FIR filter design does not have any connection with the design of
analog filters. One way of developing a realizable approximation (H(z)) to the filter would be to
truncate the Ideal impulse response and then find its Frequency response. Truncation of the Ideal
impulse response is done using windows. Various windows such as rectangular, bartlett,
hamming, hanning, kaiser are used.
Aim:
To design F.I.R filter using various windows.
Software Used :
Matlab
Page
K.L.University
Algorithm :
Page
EXPERIMENT NO: 6 A
K.L.University
Date:
Realization of FIR Filters
Introduction:
Using the direct form I, we will get a special realization form, called the transversal form.
Using the linear phase property a linear phase realization structure is realized.
Aim:
To realize FIR filters using Direct form 1(Transversal Form).
Software Used :
Matlab
Theory:
A straightforward approach for IIR filter realization is Direct Form I, where the difference
equation is evaluated directly. This form is practical for small filters, but may be inefficient and
impractical (numerically unstable) for complex designs. In general, this form requires 2N delay
elements (for both input and output signals) for a filter of order N. Transversal form is a special
Page
K.L.University
Output
Out:
1.0000 3.2000 5.7600 8.3200 10.8800 13.4400 16.0000 18.5600 21.1200 23.6800
Page
K.L.University
EXPERIMENT NO: 6 B
Date:
Realization of IIR Filters
Introduction:
IIR filters are digital filters with infinite impulse response. Unlike FIR filters, they have the
feedback (a recursive part of a filter) and are known as recursive digital filters therefore.
Aim:
To realize IIR filter using Direct form -I
Software Used :
Matlab
Theory:
IIR filters have much better frequency response than FIR filters of the same order. Unlike FIR
filters, their phase characteristic is not linear which can cause a problem to the systems which need phase
linearity. For this reason, it is not preferable to use IIR filters in digital signal processing when the phase is
of the essence.
B(z)
H (z) =
A(z)
the difference equation is implemented as given using delays, multipliers, and adders. For the purpose of
illustration, Let M=N=2,
Page
x(n)
K.L.University
y(n
)
b0
1/z
b1
1/z
b2
H1(z)
-a1
1/z
-a2
1/z
H2(z)
Output:
0.3872 0.1499 0.2953 0.2062 0.2608 0.2274 0.2479 0.2353 0.2430 0.2383
Page