function [na jl jh]=pna(m,b,bigt,wl,wh)

% This code compute the degrees of freedom of each segment (nA)

na=zeros(m+1,1);
jl=zeros(m+1,1);
jh=zeros(m+1,1);

n=b(1,1);
jl(1,1)=round(wl*n/(2*pi));
jh(1,1)=round(wh*n/(2*pi));

i=2;
while i <= m
    n=b(i,1)-b(i-1,1);
    jl(i,1)=round(wl*n/(2*pi));
    jh(i,1)=round(wh*n/(2*pi));
    i=i+1;
end
n=bigt-b(m,1);
jl(m+1,1)=round(wl*n/(2*pi));
jh(m+1,1)=round(wh*n/(2*pi));
na=jh-jl;