function [] = LOKACE_pitch(F, prah) %input F  

    %prah = 100;

    for n = 1:1:numel(F)
        if F(n) >= prah
            Y(n) = 1;
        else
            Y(n) = 0;
            F(n) = 0;
        end
    end

    [vyznacene_useky, pocet_useku] = bwlabel(Y);

    for n = 1:pocet_useku
        [~, c] = find(vyznacene_useky == n);
        index = c(1);
        delka_rady = numel(c);
        c = [];
    
        usek = reshape(F(:,index:index+delka_rady-1),1,[]); 
 
        save(['Intonace_useky/usek_' num2str(n) '.mat'],'usek')
 
    end
    
end

