N-Point DFT of a Function and its IDFT
- Discrete Fourier Transform
- Inverse Discrete Fourier Transform
DFT is defined as X(k)= summation from n=0 to N-1 of E-j*2*pi*k*(n/N)
% program to find N-point DFT of a given function x(n) and also its IDFT
clear all ; % close all
x=input('enter the sequence ');
N=input('Enter the length of the DFT');
xk=fft(x, N); %find DFT
magnitude=abs(xk); %find magnitude
subplot(2,2,1);
n=0:N-1;
stem(n,magnitude); % plot magnitude response.
phaseplot=angle(xk); %find phase angle
subplot(2,2,2);
stem(n,phaseplot); %plot phaseplot
%To find IDFT
xn=ifft(xk); %find IDFT
subplot(2,2,3);
No comments:
Post a Comment
Your Comments... (comments are moderated)