function y=cosinewave(f, a, dur, fs)
% generate a cosine wave

tt =0:(1/fs):dur;    %% units of seconds
y =a*cos(2*pi*f*tt);
