function eval_blit4()

L = 4000;
fs = 48000;
fstart = 110;
fend = 110;
df = (fend-fstart)/L;

nhw = 4096;
Hw = kaiser(nhw, 8)';

ya = zeros(3,1);
yb = zeros(3,1);

x = 0.5;
z = -1;
f = fstart;
sqr = 0.0;
c4 = 0;

for n = 1:L,

    
	if x >= 0.5,
		x = x - 1;
		p = fs/f;
		fraq  = 1.0/p;
		m = fix((p/2.0)) + 1
		saw = 0.0;
		c3 = 0.0;
		z = -z;
        ip = -pi/2; % phase of the first output sample in radians
        w = f*pi / fs;
        ba1 = 2.0 * cos(w);
        bb1 = 2.0 * cos(m*w);
        ya(2)=sin(ip-w);
        ya(3)=sin(ip-2*w);
        yb(2)=sin(ip-m*w);
        yb(3)=sin(ip-2*m*w);
	end;
    
    ya(1) = ba1*ya(2) - ya(3);
    ya(3) = ya(2);
    ya(2) = ya(1);

    yb(1) = bb1*yb(2) - yb(3);
    yb(3) = yb(2);
    yb(2) = yb(1);

    b = fraq*yb(1);
    a = ya(1);
    if (a ~= 0)
        blit = b/a * Hw(fix((x+0.5)*nhw)+1);
    else
        blit = fraq;
    end
    
	saw = saw + blit;
	sqr = sqr + z*blit;
	vsaw(n) = 2*(saw - c3);
	vsqr(n) = 2*(sqr - 0.5);
	vblit(n) = blit;
    vc3(n) = b;
	x = x + fraq;
	c3 = c3 + fraq;
	f = f + df;
    c4 = c4 + fraq - blit;
    vc4(n) = a;
end;
		

close all

figure;
plot(1:L, vsaw, 1:L, vc4, 1:L, vblit); grid;

figure;
plot(vc4); grid;

figure;
plot(vc3); grid;

wavwrite(0.5*vc4, fs, 'c4.wav');
wavwrite(0.5*vc3, fs, 'c3.wav');
wavwrite(0.5*vsqr, fs, 'sqr.wav');
wavwrite(0.5*vsaw, fs, 'saw.wav');
wavwrite(0.5*vblit, fs, 'blit.wav');

