Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
0Activity
0 of .
Results for:
No results containing your search query
P. 1
digital signal processing practical 4

digital signal processing practical 4

Ratings: (0)|Views: 8|Likes:
Published by Atit Patel
Experiment 5

Discrete Fourier Transform & Inverse Discrete Fourier Transform
Program 1: Write a program to find the discrete Fourier transform of the given signal.
clc; clear all; close all; X=input('Enter the signal X:'); N=length(X); for k=1:1:N a=0; b=0; for n=1:1:N Y(k)=X(n)*(cos((2*pi*(k-1)*(n-1))/N)); Z(k)=X(n)*(sin((2*pi*(k-1)*(n-1))/N)); a=a+Y(k); b=b+Z(k); end Y(k)=a; Z(k)=-b; ans=Y(k)+i*Z(k) end

OR

clc; clear all; close all; X=input('Enter the signal X:'); N=length(X); for k=1:1:N a
Experiment 5

Discrete Fourier Transform & Inverse Discrete Fourier Transform
Program 1: Write a program to find the discrete Fourier transform of the given signal.
clc; clear all; close all; X=input('Enter the signal X:'); N=length(X); for k=1:1:N a=0; b=0; for n=1:1:N Y(k)=X(n)*(cos((2*pi*(k-1)*(n-1))/N)); Z(k)=X(n)*(sin((2*pi*(k-1)*(n-1))/N)); a=a+Y(k); b=b+Z(k); end Y(k)=a; Z(k)=-b; ans=Y(k)+i*Z(k) end

OR

clc; clear all; close all; X=input('Enter the signal X:'); N=length(X); for k=1:1:N a

More info:

Published by: Atit Patel on Nov 05, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

12/04/2012

pdf

text

original

 
 
Experiment 5
Discrete Fourier Transform & Inverse
 
Discrete Fourier Transform
Program 1:Write a program to find the discrete Fourier transform of the given signal.
clc;clearall;closeall;X=input('Enter the signal X:');N=length(X);fork=1:1:Na=0;b=0; forn=1:1:NY(k)=X(n)*(cos((2*pi*(k-1)*(n-1))/N));Z(k)=X(n)*(sin((2*pi*(k-1)*(n-1))/N));a=a+Y(k);b=b+Z(k);endY(k)=a;Z(k)=-b;ans=Y(k)+i*Z(k)end
OR 
clc;clearall;closeall;X=input('Enter the signal X:');N=length(X);fork=1:1:Na=0;b=0; forn=1:1:NY(k)=X(n)*(exp((-i*2*pi*(k-1)*(n-1))/N));a=a+Y(k); endY(k)=a;endY(k)=a
D
IGITAL
S
IGNAL
P
ROCESSING
M.E. (E.C.), 1
ST
S
EMESTER
 
A
TMIYA
 
I
NSTITUTE
O
F
 
T
ECHNOLOGY
 
& S
CIENCE
,
AJKOT
.
 
 
Experiment 5
Discrete Fourier Transform & Inverse
 
Discrete Fourier Transform
Output:
Enter the signal X: [1 2 3 4]ans =10ans =-2.0000 + 2.0000ians =-2.0000 - 0.0000ians =-2.0000 - 2.0000i
D
IGITAL
S
IGNAL
P
ROCESSING
M.E. (E.C.), 1
ST
S
EMESTER
 
A
TMIYA
 
I
NSTITUTE
O
F
 
T
ECHNOLOGY
 
& S
CIENCE
,
AJKOT
.
 
 
Experiment 5
Discrete Fourier Transform & Inverse
 
Discrete Fourier Transform
Program 2:Write a program to find the inverse discrete Fourier transform of the given signal.
clc;clearall;closeall;Y=input('Enter the signal Y:');M=length(Y);forn=1:1:Ma=0;b=0; fork=1:1:MX(n)=[Y(k)*(cos((2*pi*(k-1)*(n-1))/M))];Z(n)=[Y(k)*(sin((2*pi*(k-1)*(n-1))/M))];a=a+X(n);b=b+Z(n); endX(k)=a/M;Z(k)=-b/M;ans=X(k)+i*Z(k)end 
OR 
clc;clearall;closeall;Y=input('Enter the signal Y:');M=length(Y);forn=1:1:Ma=0;b=0; fork=1:1:MZ(n)=[Y(k)*(exp((-i*2*pi*(k-1)*(n-1))/M))];b=b+Z(n); endZ(n)=b/M;endZ(n)=b/M
D
IGITAL
S
IGNAL
P
ROCESSING
M.E. (E.C.), 1
ST
S
EMESTER
 
A
TMIYA
 
I
NSTITUTE
O
F
 
T
ECHNOLOGY
 
& S
CIENCE
,
AJKOT
.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->