function eval_blit()

sinc_use_lut = 0

L = 40000;
fs = 48000;
fstart = 110;
fend = 1550;
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 = 0; % phase of the first output sample in radians
        w = f*pi / fs
        ba1 = 2.0 * cos(w)
        bb1 = 2.0 * cos(w)
        
	end;
    
    if sinc_use_lut == 1
        xi = fix((x+0.5)*nsin)+1
        if  aa(xi) ~= 0
            blit = fraq*sinc_m(m, xi)  * Hw(fix((x+0.5)*nhw)+1);;
        else
            blit = fraq;
        end
    else
        b = fraq*sin(m*x*pi);
        a = sin(x*pi);
        if (a ~= 0)
            blit = b/a * Hw(fix((x+0.5)*nhw)+1);
        else
            blit = fraq;
        end
    end
    
	saw = saw + blit;
	sqr = sqr + z*blit;
	vsaw(n) = 2*(saw - c3);
	vsqr(n) = 2*(sqr - 0.5);
	vblit(n) = blit;
    vc3(n) = c3;
	x = x + fraq;
	c3 = c3 + fraq;
	f = f + df;
    c4 = c4 + fraq - blit;
    vc4(n) = c4;
end;
		

close all

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

figure;
plot(vblit); grid;

figure;
plot(vc3); grid;

if sinc_use_lut == 1
    figure;
    plot(sinc_m(nharm, :)); grid;
end;

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');

