function [j,q]=find_quadrant(Jmin,Jmax,x,y)

J=zeros(2^Jmax);
Q=zeros(2^Jmax);

[selx,sely] = compute_quadrant_selection(Jmin,0);
J(sely,selx)=Jmin;
Q(sely,selx)=0;

for j=Jmin:Jmax
for q=1:3
[selx,sely] = compute_quadrant_selection(j,q);
J(sely,selx)=j;
Q(sely,selx)=q;
end
end

j=J(y,x);
q=Q(y,x);