Refine adc and dac