function so=design(sig,p,q)
	f1=rate(sig.source);
	f2=rate(sig);
	if isfield(sig.opts,'passband')
		relpass=2*sig.opts.passband/min(f1,f2);
	elseif isfield(sig.opts,'relpass')
		relpass=sig.opts.relpass;
	elseif isfield(sig.opts,'reltrans')
		relpass=(1-sig.opts.reltrans);
	else
		relpass=nan;
	end

	if isnan(relpass) && ~isfield(sig.opts,'order')
		so=dsp.FIRRateConverter(p,q,mfilt.firsrc(p,q).Numerator);
	else
		tw = max(0.01,1-relpass)*min(f1,f2)/2;
		if isfield(sig.opts,'astop')
			fsrc=fdesign.rsrc(p,q,'Nyquist',max(p,q),'TW,Ast',tw,sig.opts.astop,p*f1);
		else
			if isfield(sig.opts,'order'), order = sig.opts.order;  else order = 12; end
			fsrc=fdesign.rsrc(p,q,'Nyquist',max(p,q),'N,TW',2*order*max(p,q),tw,p*f1);
		end
		so=design(fsrc,'kaiserwin','SystemObject',true);
	end
end
