Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Manual – Digital Signal Processing

2018 course

Name: Suyash Suhas Doshi


Roll No: 312017
GR No: 21910111
Div: B
Batch: B1

1
Manual – Digital Signal Processing
2018 course

EXPERIMENT NO : 02

TITLE OF EXPERIMENT: Compute DFT. Plot the spectrum with different DFT resolution.

2.1
Aim: Compute DFT. Plot the spectrum with different DFT resolution.
2.2
Equipment / Apparatus: PC with Python software.

2
Manual – Digital Signal Processing
2018 course

2.3
Theory:

Compute DFT and IDFT of following sequence.

x(n)=[1,2,3,4]

2.4
Lab session expectation:
1. Compute DFT
2. Plot the spectrum with different DFT resolution.

2.5
Questions:
1. How do you select N, the number of samples in DFT domain or what
is sampling theorem in frequency domain?
2. What is aliasing in time domain?
3. What can you say about DFT of a shifted sequence?
4. How are you avoiding aliasing in overlap and add or overlap and save
algorithm?

2.6
Output Expected:
1. Python code calculation of DFT .( OR Paste your Code here with
Output)
N = int(input("Enter number of elements : "))
seq=[]
for i in range(0, N):
ele = int(input())

seq.append(ele)

print(seq)
import matplotlib.pyplot as plt
import numpy as np
from scipy.linalg import dft # .linalg -The NumPy linear algebra functions rely on BLAS

3
Manual – Digital Signal Processing
2018 course
and LAPACK to provide efficient low level implementations of standard linear algebra
algorithms.
m = dft(N)
DFTseq=m.dot(seq)
print(DFTseq)
plt.stem(DFTseq)
plt.show()

N = int(input("Enter number of elements : "))


seq=[]
for i in range(0, N):
ele = int(input())

seq.append(ele)

print(seq)

m = dft(N)
DFTseq=m.dot(seq)
print(DFTseq)
plt.stem(DFTseq)
plt.show()

2. Spectrum with different DFT resolution plots

4
Manual – Digital Signal Processing
2018 course

5
Manual – Digital Signal Processing
2018 course

6
Manual – Digital Signal Processing
2018 course

2.7
Conclusion:
The Discrete Time Fourier Transform is a good way to analyze discrete time signals in the
frequency domain in theory, but in application the infinite range of time and frequency in the
conversion formulas can make analysis difficult, especially on the computer.

DFT converts a finite sequence of a function into a same-length sequence of equally-spaced samples of the DTF

7
Manual – Digital Signal Processing
2018 course

You might also like