A characterization of nonhomogeneous wavelet dual frames in Sobolev spaces