Built-in self-test and self-calibration for analog and mixed signal circuits