% generateSinusoid - generate a sinusoidal signal using vectorized code

%% Set Parameters
A   = 3;     % amplitude
f   = 440;   % frequency
phi = -pi/4; % phase

fs = 20e3;   % sampling rate
Ts = 0;      % start time
Te = 10e-3;  % end time

%% generate sinusoid
tt = Ts : 1/fs : Te;   % define time-axis
xx = A * cos( 2*pi * f * tt + phi );