clear all

t = 0:.001:1;

%y = sin(2*pi*10*t);
%y = sin(2*pi*10*t.*(1+2*sin(2*pi*t).*t));
%y = sin(2*pi*10*t).*sin(2*pi*2*t);
%y = randn(size(t));

r=3.99;        %the rate parameter range 0-4  nice 3.7
n=4000;       %the number of point to generate
y(1)=0.55;    %initial value for x
for i=1:n-1
   y(i+1)=r*y(i)*(1-y(i));
end
y=y(end-3000:end);

sd = std(y);
y = (y-mean(y))/sd;

r = 0.1 ; %since the stdDev is normalized to 1.0
m = 5;

tic
[e,A,B]=sampencBRL(y,m,r);
toc
figure(1)
clf
np=2;
subplot(np,1,1);
plot(y)
title('input signal')

subplot(np,1,2);
plot(e(2:end))
xlabel('m (length of fit)')
ylabel('sample entropy')

