```
%DFT
close all;
clear all;
N=input('Howmany point DFT do you want?');
x2=input('Enter the sequence=');
n2=length(x2);
c= zeros(N);
x2=[x2 zeros(1,N-n2)];
for k=1:N
for n=1:N
w=exp((-2*pi*i*(k-1)*(n-1))/N);
%prev.step=>evaluating w-matrix
x(n)=w;
end
c(k,:)=x;
end
r=[c]*[x2']
%plotting magnitude and angle
subplot(211)
stem(abs(r));
title('DFT-absolute value');
subplot(212)
stem(angle(r));
title('DFT-angle');
```

` `

__OUTPUT WAVEFORM __

```
```

why we are using c=zeros(N)

ReplyDeleteThis comment has been removed by a blog administrator.

Deletejust to initialise the array by zero. we need it to create memory

Deletewhy we initialise array by zero and why create memory

Deleteto enter our values into it

DeleteKindly tell what to enter in the answer when it asks for "enter the sequence" and what is its function?

ReplyDeleteKindly if you can explain this program briefly. Waiting for your reply.

If you want a four point DFT, you will enter 4 values ,say, 2 3 4 6.

ReplyDeleteif I want to find DFT for square form

ReplyDeleteHow do I exchange

This comment has been removed by the author.

ReplyDeleteHow can I change the quantity of samples?

Delete