function [] = spojitaMFCH()

clear all;
close all;


H=[1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 ];
h=ifft(H);
okno=hamming(31);
hp=[h(ceil(size(h,2)/2)+1:end) h(1:(ceil(size(h,2)/2)))];
ho=hp.*okno';


O=linspace(0,2*pi,15000);

%figure;
%plot(ho);
%stem(ho);
    figure;

spojitaMFCH(31,ho,O,'spojita MFCH z impulzovej charakteristiky skratenej hammingovym oknom');
hold on;
spojitaMFCH(31,hp,O,'spojita MFCH z origos impulzovej charakteristiky');

function [] = spojitaMFCH(numSamples,ImpResponse,Omega,Text)
    H=0;
    for n=1:1:numSamples
        H=H+ImpResponse(n)*exp(-j*n*Omega);
    end

    plot(abs(H));
    title(Text);
return
