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.

method3_idft(X)
function x = method3_idft(X)
%Exercise 6.3.2
%% b. Create a macro to compute the IDFT of a sequence using method III.
% Make sure X is a row vector.
X = X(:).';

N = length(X);
x = zeros(1,N);
   
% Calculate the inverse DFT by computing the DFT of X[k] ...
... and divide the result by 1/N 
x1 = 1/N*fft(X);

... and reverse the order of the result.
x = circshift(fliplr(x1),[0 1]);

Contact us