%
% file:      	test_functions.m, (c) Matthew Roughan, Tue Sep 21 2004
% directory:   /home/mroughan/Classes/Transformations/2004/Background_info/
% created: 	Tue Sep 21 2004 
% author:  	Matthew Roughan 
% email:   	matthew.roughan@adelaide.edu.au
% 
% place help info about TEST_FUNCTIONS here
%
%

step = 0.0001;
t = 0:step:1;

t_j = [0.1, 0.13, 0.15, 0.23, 0.25,0.40, 0.44, 0.65, 0.76, 0.78, 0.81];
h_j = [4, -5, 3, -4, 5, -4.2, 2.1, 4.3, -3.1, 2.1, -4.2];

% get BLOCKs
blocks = zeros(size(t));
for i=1:length(t_j)
  blocks = blocks + h_j(i) * (sign(t-t_j(i)) + 1)/2;
end

figure(1)
plot(t, blocks);
print('-deps', 'Plots/test_function_blocks.eps');

% get BUMPs
h_j = abs([4, -5, 3, -4, 5, -4.2, 2.1, 4.3, -3.1, 5.1, -4.2]);
w_j = [0.005, 0.005, 0.006, 0.01, 0.01, 0.03, 0.01, 0.01, 0.005, 0.008, 0.005 ];

bumps = zeros(size(t));
for i=1:length(t_j)
  temp = (t-t_j(i))/w_j(i);
  bumps = bumps + h_j(i) ./ ((1 + abs(temp)).^4);
end

figure(2)
plot(t, bumps);
print('-deps', 'Plots/test_function_bumps.eps');

% get HeaviSine
heavisine = 4 * sin(4*pi*t) - 2*(t-0.3 > 0) - 2*(0.72-t>0) + 2;
figure(3)
plot(t, heavisine);
print('-deps', 'Plots/test_function_heavisine.eps');

% get Doppler
epsilon = 0.05;
doppler = sqrt(t.*(1-t)) .* sin(2*pi*(1+epsilon)./(t+epsilon));
figure(4)
plot(t, doppler);
print('-deps', 'Plots/test_function_doppler.eps');
