function [freq_half, samples_freq, freq_mag] = Lab5_plot_dft(samples_time, ...
    samp_rate, figure_num)

samples_freq = fft(samples_time);
samples = length(samples_time); % # of samples
samples_freq_new = abs(samples_freq / samples);
samples_freq_new = ...
    samples_freq_new(1:round(length(samples_freq)/2.0),:) * 2;
freqs = (0:(samples - 1));
freqs = freqs * (samp_rate/(samples - 1));
freq_half = freqs(1:round(length(freqs) / 2, 0));
figure(figure_num);
freq_mag = samples_freq_new;
samples_freq = samples_freq(1:round(length(samples_freq)/2.0),:) * 2;
stem(freq_half, samples_freq_new);
title('Frequency Domain');
xlabel('Frequency (Hz)');
ylabel ('Amplitude (Volts)');
end