Exp 456
Exp 456
Lab Report
Submitted by:
Experiment Name: Write a MATLAB program to obtain (a) N-point DFT of sequence, (b) N-
point IDFT of sequence and (c) Linear convolution by DFT.
To obtain N-point DFT of sequence
To obtain N-point DFT of sequence
To obtain Linear convolution by DFT
Where:
• N is the length of the DFT.
• x[n] is the input sequence in the time domain.
• X[k] is the DFT coefficient at frequency index k.
FlowChart:
Output:
sgtitle('Reconstructed Sequence');
% Display the reconstructed sequence
disp('Reconstructed sequence using
N- point IDFT:');
disp(x_reconstructed);
Input:
Output:
Linear Convolution by
DFT: Program:
Linear Convolution by
DFT: Program Code:
Input
:
Output
:
Result:
Thus, the MATLAB programs for N-point DFT , N-point IDFT and linear convolution
have written.
Q2. How is linear convolution of two sequences performed using the Discrete
Fourier Transform (DFT)?
Answer: Linear convolution of two sequences can be performed using the Discrete Fourier
Transform (DFT) through the following steps:
1. Compute the DFT of both input sequences
2. Multiply the DFTs of the two sequences element-wise to obtain
3. Compute the Inverse DFT (IDFT) of Y[k] to obtain the linear convolution result
y[n].
This process is known as the "Convolution Theorem" and allows for faster convolution by
exploiting the efficient algorithms for DFT and IDFT calculations (such as the Fast
Fourier Transform, FFT). It is especially useful when dealing with long sequences, where
direct convolution can be computationally expensive.
Q12. What is the difference between the DFT and the Continuous Fourier Transform
(CFT)?
Answer: The Discrete Fourier Transform (DFT) is applied to discrete sequences (i.e.,
sampled data) and yields a discrete set of frequency components. It is primarily used for
digital signal processing. The Continuous Fourier Transform (CFT), on the other hand, is
applied to continuous signals and yields a continuous frequency spectrum. The DFT can be
thought of as a sampled version of the CFT, tailored for finite and discrete data.
Q4. What is the relationship between the DFT and the IDFT, and why are they
important in signal processing?
Answer: The DFT and IDFT are closely related mathematical operations. The DFT
transforms a signal from the time domain to the frequency domain, while the IDFT
transforms it back from the frequency domain to the time domain. They are essential
in signal processing for the following reasons:
• Analysis and Synthesis: DFT is used to analyze a signal's frequency
content, while IDFT is used to synthesize the original signal from its
frequency components.
• Filtering: In applications like audio and image processing, you can filter a
signal in the frequency domain (using DFT) and then transform it back to
the time domain (using IDFT).
• Convolution: The convolution theorem relates convolution in the time
domain to multiplication in the frequency domain, making DFT and IDFT
useful for efficient convolution calculations.
Q5. What is the advantage of using the Discrete Fourier Transform (DFT) for
linear convolution?
Answer: The advantage of using the DFT for linear convolution lies in efficiency,
especially when dealing with long sequences:
• Faster Computation: Convolution in the time domain has a time
complexity of O(N^2) for two sequences of length N. DFT-based
convolution, on the other hand, can be calculated in O(N log N) time using
algorithms like the Fast Fourier Transform (FFT).
• Reusability: Once you've computed the DFT of sequences, you can reuse
them for multiple convolutions, saving computational effort.
• Periodic Convolution: The circular convolution is efficiently implemented
using DFT, which is especially useful in applications involving periodic
signals.
• Overlapping Signals: DFT-based convolution is beneficial when dealing
with signals that overlap or have a large number of zeros. It avoids
unnecessary multiplications and additions of zero values.
• Noise Reduction: DFT-based convolution can be used for filtering noisy
signals more efficiently than direct convolution, making it advantageous in
applications like audio and image demising.
Q7. What is circular convolution, and how does it differ from linear
convolution? Answer: Circular convolution is a type of convolution where the
input sequences are treated as periodic and the result wraps around, meaning that the
output is also periodic. In contrast, linear convolution is the standard convolution
operation where the result is not periodic, and the output sequence has a length
equal to the sum of the lengths of the two input sequences minus one.
Lab Report
Submitted by:
Experiment Name: Write a MATLAB program to generate Spectrum Analysis of a sequence using
DFT.
Objective:
Apparatus required:
Theory: In time domain representation of digital signals describes the signal amplitude
versus the sampling time instant or the sample number. However, in some applications, signal
frequency content is very useful than as digital signal samples. The algorithm transforming
the time domain signal samples to the frequency domain components is known as the discrete
Fourier transform, or DFT. The DFT also establishes a relationship between the time domain
representation and the frequency domain representation. Therefore, we can apply the DFT to
perform frequency analysis of a time domain sequence. In addition, the DFT is widely used in
many other areas, including spectral analysis, acoustics, imaging/ video, audio,
instrumentation, and communications systems.
Spectral analysis:
It involves the calculation of waves or oscillations in a set of sequenced data. These
data may be observed as a function of one or more independent variables such as the
three Cartesian spatial coordinates or time. The results of a spectral analysis are
typical ly presented as a spectral power plot where the ordinate is either an absolute
(amplitude squared, C2n) or relative (amplitude squared normalized by the total
variance, C2n/σ2) measure of the amount of total variance explained by a sinusoidal
waveform at the nth frequency and where the abscissa is frequency or its inverse,
period.
Procedure:
1. Start the MATLAB program.
2. Type the program.
3. Compile and Run the program.
4. For the output see command window\ Figure window.
FlowChart:
Program Code:
clc;
close
all;
clear
all;
Output:
Result: Thus, the Spectrum Analysis of the signal using DFT is obtained using
MATLAB. By analyzing the magnitude and phase spectra, we can gain insights into the
frequency components present in the signal.
Spectral Leakage: Occurs when the signal's frequency components do not align with the
DFT's frequency bins.
Resolution: The frequency resolution depends on the length of the input sequence; longer
sequences provide better frequency resolution.
Periodic Assumption: The DFT assumes the signal is periodic within the observation
window, which may not be true for real-world signals.
Answer: In modern communication systems, the DFT is used for tasks like modulation,
demodulation, and signal detection. It helps analyze and process signals in the frequency domain,
which is crucial for efficient data transmission, error correction, and spectral analysis in wireless
communication technologies like OFDM (Orthogonal Frequency Division Multiplexing).
Q6. What is the output of the DFT in terms of magnitude and phase?
Answer: The output of the DFT consists of complex numbers, which can be expressed in terms
of magnitude and phase. The magnitude represents the amplitude of the frequency components,
while the phase indicates the phase shift of each frequency component relative to the original
signal
Department of Electrical & Electronic Engineering
Lab Report
Experiment Name: Write a MATLAB program to obtain: a) Partial fraction expansion of rational Z- transform. b)
Z-tran sform from partial fraction expansion. c) Power series expansion of Z-transform. d) Stability test for Z-
transform.
Submitted by:
Objective:
Apparatus required:
➢ Hardware:
Personal computer.
➢ Software: Matlab 2019a.
Theory:
Z-Transform:
The Z-transform serves as a vital tool in the analysis of linear shift-invariant (LSI) systems,
which are commonly represented by difference equations in the time domain. To solve these
equations effectively, they are first converted into algebraic equations in the z-domain using
the Z-transform. In the z-domain, these equations can be manipulated more easily. The results
obtained are then transformed back into the time domain using the inverse Z- transform. The
partial fraction expansion method, a technique for simplifying algebraic expressions, can be
applied to Ztransforms when the definition is rational, meaning they are expressed as the ratio
of two polynomials.
M = Degree of numerator
N = Degree of denominator
N(Z) = Numerator polynomial
D(Z) = Denominator
polynomial
For causal sequence, the z-transform G(z) can be expanded into a power series in z −1. In the
series expansion, the coefficient multiplying the term z −n is then the nth sample g[n]. For a
rational G(z), a convenient way to determine the power series is to express the numerator and
the denominator as polynomial in z −1 and then obtained the power series expansion by long
division.
The inverse of a rational z-transform can be readily calculated using MATLAB. The function
impz can be utilized for this purpose. Three versions of this function are as follows:
where the input data consist of the vectors num and den containing the coefficients of the
numerator and the denominator polynomials of the z-transform given in a descending powers
of z the output impulse response vector h, and the time index vector t. In the first form, the
length L of h is determined automatically by the computer with t = 0:L-1, whereas in the
remaining two forms it is supplied by the user through the input data L. In the last form, the
time interval is scaled so that the sampling interval is equal to 1/FT. The default value of FT
is 1.
Another way of arriving at this result using MATLAB is by making use of the M-file function
y = filter(num, den, x)
where y is the output vector containing the coefficients of the power series representation of
G(z) in increasing power of z −1. The numerator and denominator polynomial of G(z)
expressed in ascending power of z −1 are two of the input data vectors num and den. The
length of x is the same as that of y, and its elements are all zeros except for the first one being
a 1. We present next two examples to illustrate the use of both functions. Let the z-transform
of a causal sequence h[n] be given by
Procedure:
FlowChart:
Program Code:
clc;
close
all;
clear
all;
numerator_coeff = input('Enter the coefficients of the numerator polynomial (in
square brackets): '); denominator_coeff = input('Enter the coefficients of the
denominator polynomial (in square brackets): ');
disp('Residues:');
disp(r);
disp('Poles:');
disp(p);
disp('Direct
Terms:'); disp(k);
Input:
Output:
Program Code:
Output:
Program Code:
Program Code:
(d) Stability test for Ztransform
clc;
close
all;
clear
all;
Q1) What are the basic properties of the Z-transform that make it useful in digital
signal processing?
Answer: The Z-transform has several properties, including linearity, time-shifting,
convolution, and differentiation in the Z-domain, which make it useful for analyzing
discrete-time systems. It allows efficient analysis of system behavior, especially for
difference equations and digital filter design.
Q2)How does the region of convergence (ROC) relate to the causality of a system in
the context of Z-transforms?
Answer: The ROC of a Z-transform determines the causality of a system. For a causal
system, the ROC is typically outside the outermost pole (including infinity), and the
system’s response is dependent only on present and past inputs. For an anti-causal system,
the ROC is inside the innermost pole, and the response depends on future inputs.
Answer: The inverse Z-transform converts a function in the Z-domain back into its
corresponding time-domain sequence. It is done through various methods such as partial
fraction decomposition, power series expansion, or contour integration, and it represents the
original discrete-time signal.
Q4)How can poles and zeros of a Z-transform be used to analyze system behavior?
Answer: The poles of a Z-transform represent the frequencies where the system's response
becomes unbounded, while the zeros represent frequencies where the response is zero. The
arrangement of poles and zeros provides insight into system stability, frequency response,
and transient behavior.
Q5)What role does the partial fraction expansion play in computing the inverse Z-
transform?
Answer: Partial fraction expansion simplifies a complex rational Z-transform into simpler
fractions that correspond to standard time-domain sequences. By decomposing the Z-
transform, you can apply known inverse Z-transform pairs to easily convert each term back
to the time-domain.
Answer: The bilateral (or two-sided) Z-transform considers both positive and negative time
indices in a sequence, while the unilateral (or one-sided) Z-transform considers only non-
negative time indices. The unilateral Z-transform is often used in practical digital signal
processing since many systems are causal and deal only with present and past values.
Q7)How can the long division method be used to find the power series expansion of a
Z-transform?
Answer: The long division method can be used to express a rational Z-transform as an
infinite power series by dividing the numerator by the denominator. This method is useful
when finding a Z-transform's corresponding time-domain sequence for non-standard or
complex expressions, allowing the identification of the first few terms of the sequence.