blob: 5b86a837370caaf2da548a217bf01e0cad92045d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
//Example 5.1
clc;
clear;
close;
x=[0 1 2 3];
//compute DFT by definition
w=-%i;
X=[0 0 0 0]
for i=1:4
for j=1:4
X(i)=X(i)+x(j)*w^((i-1)*(j-1));
end
end
//Displaying DFT
disp(X,"X[k]=");
|