entries0=910; valmin0=15; valmax0=189;
res0=[
1.02	193;	1.02	185;	1.15	182;	1.02	185;	1.02	184
1.02	190;	1.02	204;	1.02	210;	1.02	228;	1.02	235
1.02	247;	1.02	253;	1.15	255;	1.02	234;	1.02	209
1.02	179;	1.02	159;	1.02	134;	1.02	112;	1.02	92
1.02	81;	1.02	73;	1.02	67;	1.02	63;	1.02	67
1.02	72;	1.02	73;	1.02	86;	1.02	94;	1.02	98
1.02	100;	1.02	98;	1.02	98;	1.02	88;	1.02	75
1.02	69;	1.02	51;	1.02	41;	1.02	30;	1.02	26
1.02	25;	1.02	25;	1.02	26;	1.02	36;	1.02	42
1.02	57;	1.02	66;	1.02	75;	1.02	79;	1.02	81
1.02	81;	1.02	75;	1.02	64;	1.02	57;	1.02	48
1.02	33;	1.02	23;	1.02	17;	1.02	17;	1.02	16
1.02	16;	1.02	22;	1.02	32;	1.02	36;	1.02	51
1.02	63;	1.02	69;	1.02	75;	1.02	75;	1.02	75
1.02	69;	1.02	56;	1.02	51;	1.02	35;	1.02	25
1.02	17;	1.02	13;	1.02	13;	1.02	13;	1.02	14
1.02	26;	1.02	32;	1.02	44;	1.02	54;	1.02	64
1.02	70;	1.02	73;	1.02	73;	1.02	72;	1.02	60
1.02	51;	1.02	47;	1.02	29;	1.02	19;	1.02	13
1.02	11;	1.02	11;	1.02	11;	1.02	16;	1.02	28
1.02	32;	1.02	47;	1.02	56;	1.02	66;	1.02	70
1.02	70;	1.02	72;	1.02	67;	1.02	54;	1.02	47
1.02	32;	1.02	25;	1.02	14;	1.02	11;	1.02	10
1.02	10;	1.02	11;	1.02	22;	1.02	28;	1.02	36
1.02	51;	1.02	61;	1.02	67;	1.02	70;	1.02	70
1.02	70;	1.02	58;	1.02	50;	1.02	47;	1.02	29
1.02	19;	1.02	13;	1.02	10;	1.02	10;	1.02	10
1.02	13;	1.02	25;	1.02	29;	1.02	47;	1.02	53
1.02	63;	1.02	69;	1.02	70;	1.02	70;	1.66	60
1.02	51;	1.02	47;	1.02	29;	1.02	22;	1.02	13
1.02	10;	1.02	10;	1.02	10;	1.02	10;	1.02	67
1.02	58;	1.02	48;	1.02	42;	1.02	26;	1.02	17
1.02	10;	1.02	7;	1.02	7;	1.02	7;	1.02	10
1.02	22;	1.02	28;	1.02	42;	1.02	50;	1.02	60
1.02	67;	1.02	67;	1.02	67;	1.02	64;	1.02	51
1.02	47;	1.02	35;	1.02	22;	1.02	13;	1.02	7
1.02	5;	1.02	7;	1.02	7;	1.02	14;	1.02	23
1.02	28;	1.02	45;	1.02	56;	1.02	63;	1.02	66
1.02	67;	1.02	69;	1.02	60;	1.02	50;	1.02	45
1.02	28;	1.02	20;	1.02	10;	1.02	7;	1.02	7
1.02	7;	1.02	8;	1.02	20;	1.02	25;	1.02	39
1.02	50;	1.02	58;	1.02	66;	1.02	69;	1.02	69
1.02	66;	1.02	54;	1.02	47;	1.02	41;	1.02	25
1.02	16;	1.02	10;	1.02	7;	1.02	7;	1.02	7
1.02	11;	1.02	22;	1.02	26;	1.02	44;	1.02	51
1.02	61;	1.02	66;	1.02	67;	1.02	67;	1.02	63
1.02	50;	1.02	45;	1.02	30;	1.02	20;	1.02	11
1.02	7;	1.02	7;	1.02	7;	1.02	8;	1.02	16
1.02	25;	1.02	32;	1.02	47;	1.02	57;	1.02	64
1.02	67;	1.02	150;	1.02	198;	1.02	206;	1.02	209
1.02	210;	1.02	198;	];
entries1=900; valmin1=34; valmax1=183;
res1=[
1.02	238;	1.02	242;	1.15	244;	1.02	246;	1.02	249
1.02	249;	1.02	249;	1.02	249;	1.02	251;	1.02	255
1.02	255;	1.02	255;	1.15	255;	1.02	233;	1.02	199
1.02	178;	1.02	156;	1.02	139;	1.02	124;	1.02	112
1.02	99;	1.02	92;	1.02	87;	1.02	76;	1.02	71
1.02	67;	1.02	64;	1.02	58;	1.02	55;	1.02	53
1.02	49;	1.02	46;	1.02	44;	1.02	41;	1.02	39
1.02	35;	1.02	33;	1.02	32;	1.02	30;	1.02	28
1.02	28;	1.02	26;	1.02	24;	1.02	24;	1.02	24
1.02	24;	1.02	24;	1.02	24;	1.02	24;	1.02	23
1.02	21;	1.02	21;	1.02	19;	1.02	19;	1.02	19
1.02	16;	1.02	16;	1.02	16;	1.02	14;	1.02	14
1.02	14;	1.02	14;	1.02	14;	1.02	14;	1.02	16
1.02	16;	1.02	16;	1.02	16;	1.02	16;	1.02	16
1.02	14;	1.02	14;	1.02	14;	1.02	12;	1.02	12
1.02	10;	1.02	10;	1.02	10;	1.02	10;	1.02	10
1.02	14;	1.02	10;	1.02	12;	1.02	12;	1.02	12
1.02	12;	1.02	12;	1.02	12;	1.02	12;	1.02	10
1.02	10;	1.02	10;	1.02	8;	1.02	8;	1.02	8
1.02	8;	1.02	8;	1.02	8;	1.02	8;	1.02	8
1.02	10;	1.02	10;	1.02	10;	1.02	10;	1.02	10
1.02	10;	1.02	10;	1.02	10;	1.02	10;	1.02	8
1.02	7;	1.02	7;	1.02	7;	1.02	7;	1.02	7
1.02	7;	1.02	7;	1.02	7;	1.02	7;	1.02	8
1.02	8;	1.02	10;	1.02	10;	1.02	10;	1.02	10
1.02	10;	1.02	8;	1.02	7;	1.02	8;	1.02	7
1.02	7;	1.02	5;	1.02	5;	1.02	5;	1.02	7
1.02	7;	1.02	7;	1.02	7;	1.02	8;	1.02	8
1.02	8;	1.02	8;	1.02	8;	1.02	8;	1.02	1
1.02	3;	1.02	3;	1.02	5;	1.02	3;	1.02	5
1.02	5;	1.02	7;	1.02	7;	1.02	5;	1.02	5
1.02	5;	1.02	3;	1.02	3;	1.02	3;	1.02	3
1.02	1;	1.02	3;	1.02	3;	1.02	1;	1.02	3
1.02	3;	1.02	3;	1.02	5;	1.02	5;	1.02	5
1.02	5;	1.02	5;	1.02	5;	1.02	5;	1.02	3
1.02	5;	1.02	3;	1.02	1;	1.02	3;	1.02	3
1.02	3;	1.02	1;	1.02	1;	1.02	1;	1.02	5
1.02	5;	1.02	5;	1.02	5;	1.02	5;	1.02	5
1.02	5;	1.02	7;	1.02	5;	1.02	3;	1.02	3
1.02	3;	1.02	1;	1.02	1;	1.02	1;	1.02	3
1.02	1;	1.02	3;	1.02	3;	1.02	3;	1.02	3
1.02	5;	1.02	7;	1.02	5;	1.02	5;	1.02	7
1.02	5;	1.02	5;	1.02	5;	1.02	3;	1.02	3
1.02	1;	1.02	1;	1.02	1;	1.02	3;	1.02	1
1.02	1;	1.02	3;	1.02	3;	1.02	5;	1.02	5
1.02	5;	1.02	5;	1.02	5;	1.02	5;	1.02	5
1.02	5;	1.02	3;	1.02	3;	1.02	1;	1.02	1
1.02	1;	1.02	1;	1.02	1;	1.02	3;	1.02	3
1.02	5;	1.02	5;	1.02	5;	1.02	5;	1.02	5
1.02	7;	1.02	105;	1.02	172;	1.02	201;	1.02	217
1.02	226;	1.02	233;	];
close all;
s0=shift(res0,-mod(entries0,length(res0)));
sintv=mean(s0(:,1));slen=length(s0);blink=(0+(abs([1:slen]-slen/2)<10/sintv));
power=4*sum(blink);cs=(conv(blink,floor(s0(:,2)/64)))/power;
figure(1);[t,v]=stairs(cumsum(s0(:,1)),s0(:,2));[ax h1 h2]=plotyy(t,v,sintv*(1:length(cs)),cs);
set(h1,'linewidth',3);set(h2,'linewidth',3);
s1=shift(res1,-mod(entries1,length(res1)));
sintv=mean(s1(:,1));slen=length(s1);blink=(0+(abs([1:slen]-slen/2)<10/sintv));
power=4*sum(blink);cs=(conv(blink,floor(s1(:,2)/64)))/power;
figure(2);[t,v]=stairs(cumsum(s1(:,1)),s1(:,2));[ax h1 h2]=plotyy(t,v,sintv*(1:length(cs)),cs);
set(h1,'linewidth',3);set(h2,'linewidth',3);
valmin0, valmax0, valmin1, valmax1
