function ref=get_ref(id)

limits=[1,152,309,429,784,1247,1331,1394,...
        457,1519,1673,2014,2224,2292,2354,...
        2417,2482,2692,2812];
ref1=find(limits<=id);
ref2=find(id < limits);
if ~isempty(ref1) & ~isempty(ref2)
    ref=ref1(end);
else
    res=[];
end
end

