% make test timeseries for timedelaydemo.m to read. Barnett 11/12/15

% 1  : noise-free logistic map
N = 1e3;
x = zeros(1,N);
x(1) = 0.7;
for n=1:N-1, x(n+1) = 3.76*x(n)*(1-x(n)); end
z = x;  % no transformation, plain measurement
save timeseries1 z

% 2 : noise-free logistic w/ nonlin measurement
N = 1e3;
x = zeros(1,N);
x(1) = 0.6;
for n=1:N-1, x(n+1) = 3.76*x(n)*(1-x(n)); end
z = sin(10*x);  % very nonlin deterministic distortion
save timeseries2 z

% 3 : henon w/ nonlin meas
a = 1.4; b = 0.3;
f = @(x) [a-x(1,:).^2+b*x(2,:);  x(1,:)]; % Henon map (vec func) w/ params a,b
N = 10000;                                % how many its
x = zeros(2, N);
x(:,1) = [0;0];
for n=1:N-1
  x(:,n+1) = f(x(:,n));
end
z = x(1,:) + sin(x(1,:) + x(2,:));   % some nonlin measurement func
save timeseries3 z

% 4 : henon w/ nonlin meas + noise
a = 1.4; b = 0.3;
f = @(x) [a-x(1,:).^2+b*x(2,:);  x(1,:)]; % Henon map (vec func) w/ params a,b
N = 10000;                                % how many its
x = zeros(2, N);
x(:,1) = [0;0.1];
for n=1:N-1
  x(:,n+1) = f(x(:,n));
end
z = x(1,:) + sin(x(1,:) + x(2,:)) + 0.3*randn(size(z));
save timeseries4 z
