function [nos ir output esn] = simpleSine()
%simpleSine Testing script
%  Detailed explanation goes here
nSeqLength = 1200;
%output = sin((1:nSeqLength) / 4) / 10;
%output = output ;

[input output] = generate_freqGen_sequence(nSeqLength, 14, 26, 200);  %14, 26, 200);

output = 2 * output - 1;
output = output / 2;

plot (1:nSeqLength, [input output]);


esn = create_esn(1, 200, 1, 30, 0.95);

esn = scaling(esn, 0.5, 1, 3.8); %2.88        0.88  feedback na 1.4
                    %(esn, 2.5, 1, 5) (esn, 0.5, 1, 1.4)
plot([input output]);

%max(abs(eig(esn.resWeights)))

%initial run

%[nos ir esn] = runNetwork(100, esn);
%figure(1);
%plot(1:100, nos(1:100));

%figure(1);
%plot(1:50, ir(1:5, 1:50));

% online train network
[nos ir error esn] = online_train(input, output, 0.01, esn);



%[nos ir error esn] = online_train(input, output, 0.01, esn);
%[nos ir error esn] = online_train(input, output, 0.01, esn);

%[nos ir error esn] = online_train(output, 0.3, esn);
%[nos ir error esn] = online_train(output, 0.3, esn);

%[nos ir error esn] = online_train(output, 0.01, esn);
%[nos ir esn] = train(teacher, esn);


figure(2);
plot(1:length(output), ir(1:5, 1:length(output)));
figure(3);
plot(1:length(error), error(1:length(error)));

% test run

[nos2 ir esn] = runNetwork(input, esn);
figure(4);
plot(1:length([nos nos2]), [nos nos2]);
