% plot_SamplingDemoHigh - Sample three sinusoidal signals to 
%                         demonstrate the impact of sampling

%% set parameters
fs  = 100;
dur = 1;

%% generate signals
tt  = 0:1/fs:dur;
xx1 = cos(2*pi*tt+pi/4);
xx2 = cos(2*pi*9*tt-pi/4);
xx3 = cos(2*pi*11*tt+pi/4);

%% plots
plot(tt,xx1,'-*',tt,xx2,'-x',tt,xx3,'-+',...
    tt(1:10:end), xx1(1:10:end),'ok');
grid
xlabel('Time (s)')
legend('f=1','f=9','f=11','f_s=10','Location','EastOutside')

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