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.
% Exercise 6.3.3. Computational Complexity of the FFT.
powers = 4:11;
lengths = 2.^powers;
timeFFT = zeros(size(powers));
timeDFT = zeros(size(powers));
% Compute its N-point DFT:
Samples = lengths(i);
x = rand(1,Samples);
X = my_DFT(x);
DFTtime(i) = toc;
X2 = fft(x);
FFTtime(i) = toc;
%% Plot the results.
figure('Name','Exercise 6.3.3. Computational Complexity of the FFT');
ylabel('Execution Time (sec)');
xlabel('Sequence Length in Log_2 Scale: log_2(length(x))');
title('DFT (blue) vs FFT (red) Execution Time)');