Digital Signal Processing Reference
In-Depth Information
and
X[3] = x[0] + x[1](-j) 3 + x[2](-j) 6 + x[3](-j) 9
= 1 + j2 - 3 - j4 =-2 - j2.
The following MATLAB program can be used to confirm the results of this example:
% This MATLAB program computes the DFT using the defining
% equations (12.30) for the transform pair.
N = input...
('How many discrete-time samples are in the sequence?')
x = input...
('Type the vector of samples, in brackets[...]:')
% Compute the DFT from (12.30)
for k1 = 1:N
X(k1) = 0;
k = k1 - 1;
for n1 = 1:N;
n = n1 - 1;
X(k1) = X(k1) + x(n1)*exp(-j*2*pi*k*n/N);
end
end
x
X
The discrete Fourier transform is also listed in Table 12.3. At this time we make no
attempt to give meaning to these values.
Calculation of an inverse DFT, with MATLAB confirmation
EXAMPLE 12.10
This example is a continuation of the last one. We now find the inverse discrete Fourier trans-
form of
X[k]
of Table 12.3. From (12.30),
x[0] = [X[0] + X[1] + X[2] + X[3]]/4
= [10 + (-2 + j2) + (-2) + (-2 - j2)]/4 = 1,
x[1] = [X[0] + X[1](j) + X[2](j) 2 + X[3](j) 3 ]/4
= [10 - j2 - 2 + 2 + j2 - 2]/4 = 2,
x[2] = [X[0] + X[1](j) 2 + X[2](j) 4 + X[3](j) 6 ]/4
= [10 + 2 - j2 - 2 + 2 + j2]/4 = 3,
and
x[3] = [X[0] + X[1](j) 3
+ X[2](j) 6
+ X[3](j) 9 ]/4
= [10 + j2 + 2 + 2 - j2 + 2]/4 = 4,
which are the correct values. Note the symmetries of the calculations of the DFT and its in-
verse. As stated earlier, these symmetries allow the same computer program used to calculate
the forward transform to calculate the inverse transform, with slight modification:
Search WWH ::




Custom Search