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

M.

KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),


KARUR

18ECC301J - DIGITAL SIGNAL PROCESSING LAB 1


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

EX.NO.1 COMPUTATION OF DFT USING BASIC EQUATION, FFT AND POWER SPECTRUM
ESTIMATION USING DFT
DATE:

AIM:
To write and execute the SCILAB programs for computation of DFT, FFT and power spectrum
estimation

APPARATUS REQUIRED:
SCILAB with PC

THEORY

Let X(ejw) be discrete time Fourier transform of the discrete time signal x(n). The discrete Fourier transform
(DFT) of x(n) is obtained by sampling one period of the discrete time Fourier transform X(e jw) at a finite
number of frequency points. Let, x(n) = Discrete time signal of length L and X(k) = DFT of x(n)

The plot of samples of magnitude sequence versus k is called magnitude spectrum and the plot of samples of
phase sequence versus k is called phase spectrum. In general, these plots are called frequency spectrum

PROGRAM:

//Program for Computing DFT and IDFT


clc;clear;
x=[1 2 1 -2 1 3 1 -3];
N= 8;
k=0:N-1;
X=clean(fft(x));
x_inv=clean(ifft(X));
disp(x,'x(n)=');
disp(X,'X(k)=');
disp(x_inv,'Inverse of X');

//Plot the input sequence


subplot(1,3,1);
plot2d3(k,x);
xlabel('n-->');
ylabel('Amplitude of x(n)');
title('Input Sequence');

18ECC301J - DIGITAL SIGNAL PROCESSING LAB 2


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

//Plot the magnitude Spectrum

X1=abs(X);
subplot(1,3,2);
plot2d3(k,X1);
xlabel('K-->');
ylabel('Magnitude of X(K)');
title('Magnitude Plot');

//Plot the Phase Spectrum


X2=atan(X);
subplot(1,3,3);
plot2d3(k,X2);
xlabel('K-->');
ylabel('phase of X(K)');
title('Phase Plot');

OUTPUT:

18ECC301J - DIGITAL SIGNAL PROCESSING LAB 3


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

RESULT :

18ECC301J - DIGITAL SIGNAL PROCESSING LAB 4


M.KUMARASAMY COLLEGE OF ENGINEERING (AUTONOMOUS),
KARUR

Signature of the Faculty with Date

18ECC301J - DIGITAL SIGNAL PROCESSING LAB 5

You might also like