% plot_sinusoid - plot a simple sinusoid

%% parameters
A   = 3;
f   = 400;
phi = pi/4;

fs  = 50*f;
dur = 5/f;

%% generate signal
% 5 cycles with 50 samples per cycle
tt = 0 : 1/fs : dur;
xx = A*cos(2*pi*f*tt + phi);

%% plot
plot(tt,xx)
xlabel( 'Time (s)' )   % labels for x and y axis
ylabel( 'Amplitude' )
title( 'x(t) = A cos(2\pi f t + \phi)')
grid                   % create a grid
axis([0 dur -3.5 3.5]);

%% Store name of script for automated figure generation
ScriptName = mfilename;
