% Script to test myFFT.m
% See example 12.1 on p.498 of Heath
% K. Ming Leung, 03/28/03

clear all; format long;
x=[4 0 3 6 2 9 6 5];
%x=rand(1,2^10); % test using a much longer vector
n=length(x);

y=myFFT(x,n,exp(-2*pi*i/n));

% For conparison: use Matlab's built-in fft function
yMatlab=fft(x,n);

%display([y.' yMatlab.']);
isequal(y,yMatlab), % result not exactly the same as Matlab
max(abs(y-yMatlab)),% but the difference is very very small