0% found this document useful (0 votes)
45 views4 pages

DSP Exp 4

1. The document describes calculating the discrete Fourier transform (DFT) and inverse discrete Fourier transform (IDFT) of a digital signal. 2. It provides the formulas for the DFT and IDFT and explains that the DFT transforms a discrete time signal into its frequency domain representation. 3. The algorithm involves taking the input sequence, computing the DFT using nested for loops, and then computing the IDFT using the IDFT formula to recover the original signal.

Uploaded by

Atharva Patil
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)
45 views4 pages

DSP Exp 4

1. The document describes calculating the discrete Fourier transform (DFT) and inverse discrete Fourier transform (IDFT) of a digital signal. 2. It provides the formulas for the DFT and IDFT and explains that the DFT transforms a discrete time signal into its frequency domain representation. 3. The algorithm involves taking the input sequence, computing the DFT using nested for loops, and then computing the IDFT using the IDFT formula to recover the original signal.

Uploaded by

Atharva Patil
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/ 4

Page No.

Date:/

Expenment-4

HinToCind discrefe fouier tronulorm and inverse discète fourey


yanfoxm of a given digiBal Signal
a Using unchion
Witheut Using in-boBt fncion
Reayireiment : Matlob IDE toploB Se
Discrete fouriey onskotm
he diserefe fourier ronsferm DED Yese to a mathemaical
ime
dvons lermation or funchion,whichi derived rom disoeie ime
foure tofoo DTET,which is ufed o xepecend dscek Segn
into s eguiliale Freopnty domoln e pronentation iks LTI diseefe
ime Sgsfemn and fo derelop Vorlour Computafono olyo

Ihe forhmulox r DTE


xa)- zo).e
here J=condinuouf requemy dembin.
he foY muo for DET

heye,ke dicrefe Sreqcnts demaln.


DFT&iDFT without using in-built function

Program t8-1
subplot(2,2,2)3sten( t,nagnt tucie)
ylabel( "Anglttude" );
N tnput? Number of DFT points alabel('*
Xnnput("Enter the sequence x[n] '
titlet DrT Sequence")39rta o
tn length( xn) phasea angletDFT)3
xnxn zeros(1,N-Un)l aisp( hase
$Inttialie an array of sane stze as that of iput sequence dispiphase)s
For DFT t 0N-1
DET2eros(1,N) subplott2,2,3)sten(t,phase)
For DT ylabel("Phase );
DFT2eros( 1,N) xtabel(' )
xlint|-2 S]s
Nested for loop to find the DFT of the sequence titler Phase Response' )39rid n
$ Here, e 2st rix the k them taking sm of n tron & to N
Tor k 8:N-1 $Nested Tor lop to nas he zDT ef the saqence
torn 0:N-1 Nere, we 2st fix the a then taking suR of k fron 8 te
DFT(K+1)- DFT(K+1)+{Nxn(h+l)*exp((-11)2*pi*kn/N));| for na 0N-1
end Tor 0N-1
end LDFT2) iDFTR+2}H(OFT(K+2)*exg(212*pisk*N)
nd
t 8:N-
subplot(2,2,1);stentt,xn)3
ylabel( Anplitude' DFT DFTNG
xtabel('n') t 0:N-1s
Xtin-2 5])s subplot (2,2,4)
titlet Input Sequence );ortd ong sten(t, t0FT)S
disp( 10FT Sequence a )
nagnitude = abs(DET)S
disp('DFT Sequence ) disp( iDFT)S
disp(nagnttude ) ylabel( "Anplitude );
xlabel( °n° )3
xtintl-2 Ss])
title( 205T sequence 9rid ons

Output:

Number of DFT points= Seuence DET Sqe

Enter the scquence x[n] =

1,2, 1,0

DFTScquence
4.0000 2.0000 0 2.0000 Phase Response

Phase
-1.5708 0 1.5708

IDFT Sequence
L.0000-0.0000i 2.0000+0.0000i 1.0000+0.0000i 0.0000+0.00001
Page No.
Date:I1

nyeYse ditocfe ovriey onthorm


lhe ihversedisceke tovhey Yonitoym is delined asprocese
of Sinding the dickefe time Seajee h bom l cisovefe
tyegjentyOoman

lhe tormula foy iDET=

N k-o

Algoi.hm=
DTake h ihput Seqh zln]
ompute IEs DE, bs uing 2 or-loops* om k=o;N-1 and 2hd
krom h D:N-
Uscd thc abole mcenhioned fapmula to Complelc in DET
ObsorNalions
We obtjned tho magnikude and phate yesponse O giyen inpo
Slono LnLie. Ifs DET.
We aso obtained ths IbET Sagh uhich it Same a ihput Signal
Ocn
Cohclusion
we haVe Succegeully obtolnedtu DET Sexh phose ond magnikodh
Yes pohse Ond Segnyon gich ihput Se (n)
DFT&iDFT with using in-built function

Program
subplot(2,2,2)1stem(t,nagnttude, 'fil, black')
N input("Number of DFT points ); ylabel('Anplitude' ))
xn input( Enter the sequence x[n] = ) ;
xlabel( 'K')
In = length(xn); xlin(-2 5))}
title DFT Sequence')
phase = angle(DFT)
For DFT e used fft() function
disp(Phase =')
DFT fft(xn) disp(phase)
For DFT he used fft() function subplot(2,2,3);sten(t,phase,'fill','black')
iDFT ifft(DFT); ylabel 'Phase')}
xlabel( 'K)
t 0:N-1 xlin(-2 5))
subplot(2,2,1);stem(t,xn,'fill,'black'); title 'Phase Response');
ylabel( Amplitude' );
xlabel( 'n');
subplot(2,2,4);stem(t, iDFT,'TiLL', 'black');
disp IDFT Sequence = ')}
xlin(-2 5] disp( iOFT);
title( Input Sequence); ylabel( 'Anplitude')
magnitude abs(DFT); Xlabel( 'n');
disp('DFT Sequence xlim-2 5]);
disp(magnitude ); title('1DFT sequence')

Output:

Numberof DFT points 4 nput Soqang DFT Sequenss

Enter the sequence x[n)= [0, 1,2,3)

DFT Sequence=
6.0000 2.8284 2.0000 2.8284
Phaso Rosponse OFT e

Phase
0 2.3562 3.1416 -2.3562

1DFT Sequence
0.0000-0.0000i 1.0000 +0.00001 2.0000+0.0000 3.0000+ 0.0000

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy