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.1.2. Direct DFT Evaluation.
% This script demonstrates the DFT calculation time needed
% when the definition formula is used.
clc; clear; close all;
%% (a). DFT Execution Time of Random Sequences with variable size.
Seq_Size = 2.^(4:10); % Various Sequence Sizes selected as powers of 2.
L = length(Seq_Size);
T = zeros(1,L);
Samples = Seq_Size(i);
x = rand(1,Samples) + j*rand(1,Samples);
X = zeros(1,Samples);
X(k+1) = X(k+1) + x(n+1)*exp(-j*2*pi*n*k/Samples);
T(i) = toc;
figure('Name','Exercise 6.1.2. Direct DFT Evaluation');
title('Execution Time vs Sequence Length');
ylabel('Execution Time (sec)');