% Load data file with sample DTMF signal and plot the FFT.
% 
% ELEC 470, R. Kozick

load dtmfa1 -ascii % Load the data in file dtmfa1 into a variable with same name
x = dtmfa1;        % Copy the data to a variable x

% If desired, you can listen to the signal as follows:
% sound(x, 8192)

% Find the frequencies in FFT: equally spaced from 0 to Fs hertz
Fs = 8192;	   % Sampling frequency, in samples/second
N = length(x);     % Number of time samples
Nf = 8192;         % Number of samples in FFT plot
f = (0:Nf-1)/Nf*Fs;  % Frequencies in the FFT

% Use the FFT to analyze the signal

X = fft(x, Nf);   % Compute Fast Fourier Transform (FFT)

figure(1)
plot(f, abs(X))
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('FFT Amplitude Spectrum')

