function [X,Y] = createData(nStep,a,b,sigma)

% Setup random generator seed
s = RandStream('mt19937ar','Seed',1);
RandStream.setGlobalStream(s);

% Signal process
X = zeros(1,nStep);
X(1) = -3; % starting value

% Measurement process
Y = zeros(1,nStep);

% Process noise (standard normal)
w = randn(1,nStep);

% Measurement noise (standard normal)
v = randn(1,nStep);

Y(1) = b * exp(-X(1)/2) * v(1);
for i = 2:nStep
    X(i) = a * X(i-1) + sigma * w(i);
    Y(i) = b * exp(X(i)/2) * v(i);
end
