%Signal Processing Basics

t = (0:0.001:1)';
y = sin(2 * pi * 50 * t) + 2 * sin(2 * pi * 120 * t);
plot(y);
plot(t(1:200),y(1:200));
plot(t, y)
axis([0 0.2 -3 3])

randn('state',0);
yn = y + 0.5 * randn(size(t));

plot(t(1:50),y(1:50));
plot(t(1:50),yn(1:50));
plot(t(1:50),y(1:50), t(1:50), yn(1:50));

t = (0:0.001:1)';
y = [1; zeros(99,1)];  % impulse
y = ones(100,1);       % step (filter assumes 0 initial cond.)
y = t;                 % ramp
y = t .^ 2;
y = square(2 * pi * 20 * t);

z = [t t.^2 square(2 * pi * 20 *t)];
plot(z);

%Sawtooth
fs = 8192;
t = 0:1/fs:1;
x = sawtooth(2*pi*50*t);
plot(t,x), axis([0 0.2 -1 1])
