## 4 Error Analysis and Processing  
### Amplitude Error Analysis and Digital Pre-Processing  
In the case of a single DAC sampling output, the gain offset error of the DAC can be found by querying the data sheet of the DAC, which is a relatively fixed parameter. In general, there is a relationship between the input digital quantity and the output analog quantity of the DAC:  
\[V_{out}=\frac{D}{2^{N}}\cdot V_{ref} \tag{1}\]  
In the formula, \(N\) represents the resolution of the DAC, \(V_{ref}\) represents the DAC reference voltage, \(D\) represents the input digital quantity and \(V_{out}\) represents the output analog quantity.  
Figure 6: Block diagram of signal generation circuit based on TIDAC.  
In this circuit, there is a relationship between the output analog quantity of the four DAC outputs and the input digital quantity of the DAC after passing through the channel amplitude control circuit and the different channels of the multiplexer:  
\[\begin{split} V_{out1}&=A_{1}\cdot\frac{D}{2^{N}}\cdot V _{ref};\ V_{out2}=A_{2}\cdot\frac{D}{2^{N}}\cdot V_{ref}\\ V_{out3}&=A_{3}\cdot\frac{D}{2^{N}}\cdot V_{ref};\ V _{out4}=A_{4}\cdot\frac{D}{2^{N}}\cdot V_{ref}\end{split} \tag{2}\]  
In the formula, \(V_{out1}\), \(V_{out2}\), \(V_{out3}\) and \(V_{out4}\) are, respectively, the output voltage value after the output of DAC1 to DAC4 switched by the multiplexer. \(A_{1}\), \(A_{2}\), \(A_{3}\) and \(A_{4}\) are different. Therefore, it can be found that when the same digital quantity is given to four DACs, the output analog quantity is not the same. In addition, because of the slight difference in the gain of each channel of the multiplexer, the same input analog quantity enters different channels of the multiplexer, and there may be slight differences after the output. Therefore, in order to ensure that when the same digital quantity is input, the same analog quantity can be output after passing through different channels and, finally, after the multiplexer, it is necessary to calibrate and process the gain errors of different channels. When we give the prestored standard sine wave digital quantities to the four DACs, the output of the blocking multiplexer is shown in Figure 7.  
We can represent the four curves separately, namely:  
\[\begin{split} x_{1}(t)&=A_{1}\cdot\sin\left(2\cdot \pi\cdot\frac{1}{5\cdot T}\cdot t\right)\\ x_{2}(t)&=A_{2}\cdot\sin\left(2\cdot\pi\cdot\frac{1 }{5\cdot T}\cdot t\right)\\ x_{3}(t)&=A_{3}\cdot\sin\left(2\cdot\pi\cdot\frac{1 }{5\cdot T}\cdot t\right)\\ x_{4}(t)&=A_{4}\cdot\sin\left(2\cdot\pi\cdot\frac{1 }{5\cdot T}\cdot t\right)\end{split} \tag{3}\]  
Assuming that the output waveform of DAC1 is used as the standard sine wave. So, only the waveform data of DAC2, DAC3 and DAC4 need to be modified so that the waveform data of them can meet the value of the waveform data of DAC1. To make the output waveforms of the remaining DACs match the output waveforms of DAC1, the outputs of the remaining DACs can be multiplied by the corresponding coefficients \(k\). For the \(k\), there are the following formulas:  
\[k_{2}=\frac{x_{1}(t)}{x_{2}(t)}=\frac{A_{1}}{A_{2}};\ k_{3}=\frac{x_{1}(t)}{x_{ 3}(t)}=\frac{A_{1}}{A_{3}};\ k_{4}=\frac{x_{1}(t)}{x_{4}(t)}=\frac{A_{1}}{A_{4}} \tag{4}\]  
Figure 7: Multiplexer output waveform when the amplitude is not calibrated.  
Therefore, after the corresponding coefficient is obtained by measurement, the digital quantity can be multiplied by the corresponding coefficient through the relationship in Formula (1), and then the amplitude error calibration can be realized by giving the corresponding DAC.  
Through experimental testing and verification, the output waveform result is shown in Figure 8:  
Comparing the two graphs in Figure 8, it is obvious that the output waveform after amplitude calibration is smoother and conforms to the standard sine wave.