0% found this document useful (0 votes)
582 views6 pages

Expt - 2 - Frequency Analysis of Signals Using DFT

This document describes an experiment to perform frequency analysis of discrete time signals using the discrete Fourier transform (DFT). The key steps are: 1. Plot the magnitude and phase spectrum of sample discrete time signals using the DFT. 2. Vary the number of DFT points (N) to observe how the spectrum changes with different resolutions. 3. Conclude that for a discrete sequence of length L, an N=L point DFT is required to properly reconstruct the original sequence, but in practice N is often larger than L for a denser frequency representation.

Uploaded by

Purva
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)
582 views6 pages

Expt - 2 - Frequency Analysis of Signals Using DFT

This document describes an experiment to perform frequency analysis of discrete time signals using the discrete Fourier transform (DFT). The key steps are: 1. Plot the magnitude and phase spectrum of sample discrete time signals using the DFT. 2. Vary the number of DFT points (N) to observe how the spectrum changes with different resolutions. 3. Conclude that for a discrete sequence of length L, an N=L point DFT is required to properly reconstruct the original sequence, but in practice N is often larger than L for a denser frequency representation.

Uploaded by

Purva
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/ 6

Electronics and Telecommunication Engineering, FAMT Ratnagiri

Roll No.
Name:

Experiment No. 2 Frequency Analysis of Discrete Time Signals

Aim
To plot magnitude and phase spectrum and perform frequency analysis of
Discrete Time signals
Software/
Online platform Google Colab
used

Theory: The frequency spectrum of an signal is the distribution of the amplitudes and
phases of each frequency component against frequency.

A signal can be converted between the time and frequency domains with a pair
of mathematical operators called a transform. An example is the Fourier
transform, which decomposes a function into the sum of a (potentially infinite)
number of sine wave frequency components. The 'spectrum' of frequency
components is the frequency domain representation of the signal. The inverse
Fourier transform converts the frequency domain function back to a time
function.

Important frequency characteristics of a signal x(t) with Fourier transform X(ω)


are displayed by plots of the magnitude spectrum, |X(ω)| versus ω, and phase
spectrum, <X(ω) versus ω.

Here,

Discrete Time Signal Processing Lab ECL502 1


Electronics and Telecommunication Engineering, FAMT Ratnagiri

DTFT is not suitable for DSP applications because

• In DSP, we are able to compute the spectrum only at specific discrete values of
ω,

• Any signal in any DSP application can be measured only in a finite number of
points.

Therefore DFT is suitable tool for frequency analysis , using finite number of
samples of frequency spectrum obtained from DTFT.

Representing the signal into its “N” number of frequency components is N point DFT or
analysis and reconstruction of input sequence from the knowledge of frequency
components is called IDFT or synthesis.

Discrete Time Signal Processing Lab ECL502 2


Electronics and Telecommunication Engineering, FAMT Ratnagiri

1. To plot N-point DFT magnitude and phase spectrum for different values of N
Code and #To plot N point DFT Magnitude and Phase Spectrum
Output
#Import packages
import numpy as np
from scipy.fftpack import fft
import matplotlib.pyplot as plt

#Input sequence
xn=[1,2,3,4]

#DFT points
N=int(input('How many point DFT:'))
#Compute N point DFT
Xk=fft(xn,N)
print("DFT of x[n]", Xk)
#plot input sequence
plt.stem(xn,use_line_collection=True)
plt.title('Input sequence ')
plt.xlabel('n')
plt.ylabel('x(n)')
plt.show()

#plot magitude spectrum


Xm=np.absolute(Xk)
plt.stem(Xm,use_line_collection=True)
plt.title('Magnitude Response ')
plt.xlabel('k')
plt.ylabel('|Xk|')
plt.show()

 Output

How many point DFT:4


DFT of x[n] is:
[10. -0.j -2.+2.j -2.-0.j -2.-2.j]

Discrete Time Signal Processing Lab ECL502 3


Electronics and Telecommunication Engineering, FAMT Ratnagiri

Discrete Time Signal Processing Lab ECL502 4


Electronics and Telecommunication Engineering, FAMT Ratnagiri

 Magnitude and Phase Spectrum of x[n] for N=16

Conclusion 1. Through this experiment, we have learned to plot magnitude and phase
spectrum of discrete time sequences.
2. For a discrete sequence of L point, ideally N=L point DFT is required to
compute.
3. For number of DFT points N>L , the frequency spectrum (magnitude and
phase) becomes denser and better represented infrequency domain.

Discrete Time Signal Processing Lab ECL502 5


Electronics and Telecommunication Engineering, FAMT Ratnagiri

Test your
understanding
1. What is meaning of spectrum of a signal?
2. Which mathematical tool (transform) is required to get frequency spectrum?
3. For a L-point sequence , minimum how many DFT points needed , for proper
reconstruction of original sequence?
4. Why in practice, number of DFT points much greater actual length of
sequence?
5. What is the result on reconstructed sequence (using N-point IDFT ), where
length of original sequence is L point (and N>L)?

Discrete Time Signal Processing Lab ECL502 6

You might also like