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_DFT(x)
% This function calculates the DFT of the input signal x.
% Input: x is a row vector that contains the signal who's DFT is to be computed.
% Output: X is a row vector containing the DFT of x[n].
% First create the twiddle factors matrix W:
N = length(x);
n = 0:N-1;
w = exp(-1i*2*pi*n/N);
W = zeros(N,N);
W(:,k+1) = w.^k;
% Compute the DFT as a product of the twiddle factors matrix with input vector x:
X = x*W;