function [V0, V1, LV2, UV2] = SymbAnal(x,numbin,step)

Vmin = min(x);
Vmax = max(x);

Rmin = 0;
Rmax = numbin-1;

a = (Rmin-Rmax)/(Vmin-Vmax);
b = Rmax-a*Vmax;

Pos = zeros(1,length(x));

for i = 1:length(x)
    Pos(i) = round(a*x(i)+b);
end

V0 = 0;
V1 = 0;
LV2 = 0;
UV2 = 0;
for j = 1:2*step+1:length(Pos)-mod(length(x),2*step+1)
    if Pos(j) == Pos(j+1*step)
        if Pos(j) == Pos(j+2*step)
            V0 = V0+1;
        elseif Pos(j) ~= Pos(j+2*step)
            V1 = V1+1;
        end       
    elseif ((Pos(j) ~= Pos(j+1*step)) && (Pos(j+1*step) == Pos(j+2*step)))
        V1 = V1+1;
    elseif (((Pos(j) < Pos(j+1*step)) && (Pos(j+1*step) < Pos(j+2*step)))) || (((Pos(j) > Pos(j+1*step)) && (Pos(j+1*step) > Pos(j+2*step))))
        LV2 = LV2+1;
    elseif (((Pos(j) > Pos(j+1*step)) && (Pos(j+1*step) < Pos(j+2*step)))) || (((Pos(j) < Pos(j+1*step)) && (Pos(j+1*step) > Pos(j+2*step))))
        UV2 = UV2+1;
    end
end

V0 = V0/(length(1:2*step+1:length(Pos)-mod(length(x),2*step+1)))*100;
V1 = V1/(length(1:2*step+1:length(Pos)-mod(length(x),2*step+1)))*100;
LV2 = LV2/(length(1:2*step+1:length(Pos)-mod(length(x),2*step+1)))*100;
UV2 = UV2/(length(1:2*step+1:length(Pos)-mod(length(x),2*step+1)))*100;

% [V0, V1, LV2, UV2] = SymbAnal(byestData(1,:),6,round(1/ff(find(abs(fft(byestData(1,:))) == max(abs(fft(byestData(1,:)))),1,'first'))*2048))
% [V0, V1, LV2, UV2] = SymbAnal(Y(1,5000:50000),6,round(1/6.6267*2048))
% [V0, V1, LV2, UV2] = SymbAnal(Y(1,1:round(1/6.6267*2048):50000),6,1)


