MatLab Solutions: "Introduction to Digital Signal Processing: A Computer Laboratory Textbook".
29 Oct 2012
25 Nov 2013)
These files are the MatLab solutions of exercises contained in the above DSP lab textbook.
function X = my_DFT2(x)
% Direct DFT Computation using the definition formula.
% Input Arguments:
% x[n] : the discrete time signal whose DFT is to be computed.
% X[k]: a vector containing the DFT of x[n] calculated and frequency indices k.
N = length(x);
X = zeros(1,N);
for k = 0:N-1
for n = 0:N-1
X(k+1) = X(k+1) + x(n+1)*exp(-1i*2*pi*n*k/N);