Code covered by the BSD License  

Highlights from
MatLab Solutions: "Introduction to Digital Signal Processing: A Computer Laboratory Textbook".

image thumbnail

MatLab Solutions: "Introduction to Digital Signal Processing: A Computer Laboratory Textbook".

by

 

29 Oct 2012 (Updated )

These files are the MatLab solutions of exercises contained in the above DSP lab textbook.

my_IDFT(X)
function  x = my_IDFT(X)
% This function calculates the Inverse DFT of the input signal X.
% Input:  X is a vector containing the DFT of x[n].
% Output: x is a row vector that contains the time domain signal .

% First create the conjugate twiddle factors matrix Wc:
% Make sure X is row vector for subsequent processing:
X = X(:).';
N = length(X);

x = zeros(size(X));
n = 0:N-1;
w = exp(1i*2*pi*n/N);
Wc = zeros(N,N);
for k=0:N-1
      Wc(:,k+1) = w.^k;
end

% Compute the IDFT as a product of the conjugate twiddle factors matrix with input vector x:
x = 1/N*X*Wc;    

Contact us