function laba7(I)
    if I == 0
        h = [-2 -4 6 3];
        N = 32;
        r = xcorr(h, N);
        r = r(N+1:end);
        R = toeplitz(r);
        p = zeros(N+1, 1);
        k0 = round((N-length(h))/2);
        p(k0 : k0 + length(h)-1) = fliplr(h);
        w = R\p;
        subplot(1,2,1)
        impz(w)
        subplot(1,2,2)
        impz(conv(h, w))
    else if I == 1
        NoOfData = 8000;
        Order = 32;
        Mu = 0.01;
        x = randn(NoOfData, 1);
        h = rand(Order, 1);
        d = filter(h, 1, x);
        w = zeros(Order, 1);
        for n = Order : NoOfData
            D = x(n:-1:n-Order+1);
            d_hat(n) = w'*D;
            e(n) = d(n) - d_hat(n);
            w = w + Mu * e(n) * D;
            w_err(n) = norm(h - w);
        end
        subplot(1,2,1)
        plot(20*log10(abs(e)))
        subplot(1,2,2)
        semilogy(w_err)
    end
end