## 2 The Lockhart Wavefolder
### Model Discretization and Evaluation  
The voltages inside the Lockhart wavefolder are time-dependent. Therefore, we can describe the continuous-time model defined by Equation (26) as being of the form  
\[V_{\text{out}}(t)=f(V_{\text{in}}(t)), \tag{27}\]  
where \(f()\) is the transfer function of the system and \(t\) is time. In the synthesis literature, the term \"transfer function\" is commonly used to denote the waveshaping function [4]. It should not be confused with the s- and z-domain transfer functions used in linear system analysis. As previously mentioned, [PERSON]'s circuit features an inverting stage before the output which can be modeled by inverting the polarity of the right-hand side of Equation (26):  
\[V_{\text{out}}=\alpha V_{\text{in}}-\lambda\eta V_{\text{T}}W\left(\Delta\exp \left(\lambda\beta V_{\text{in}}\right)\right). \tag{28}\]  
While including this step is not strictly necessary, we have chosen to do so, as it will facilitate the evaluation of the model. Now, given the form described by Equation (27), the [PERSON] model can be discretized trivially by replacing all continuous-time signals with their discrete-time equivalents, i.e.,  
\[V_{\text{out}}[n]=f(V_{\text{in}}[n]), \tag{29}\]  
where \(n\) is the sample index. The time-domain behavior of the proposed circuit model was validated by comparing it against a reference simulation obtained using the SPICE (Simulation Program with Integrated Circuit Emphasis) software LTspice (Version IV, Linear Technology, Milpitas, CA, USA, 2016) [61]. The results of this simulation are shown in Figure 2a for values of \(V_{\text{in}}\) between \(-1.5\) and \(1.5\) V. Figure 2b shows the transfer function of the proposed model implemented in MATLAB (Version R2017a, MathWorks, Natick, MA, USA, 2017) using Equation (28) and MATLAB's native \"lambertw\" function. In both cases, four different values of \(R_{\text{L}}\) were simulated: 1, 5, 10 and \(50\) k\(\Omega\). From these figures, we can observe the general behavior of the Lockhart wavefolder. At low input values, the system behaves linearly, whereas for high input values the circuit inverts the slope of the driving signal. The transition between non-folded and folded portions of the signal is gradual, which responds to the characteristic soft saturating behavior of p-n junctions. The region where the transfer function folds the input signal is indicated with a blue arrow in Figure 2b for the case when \(R_{\text{L}}=50\) k\(\Omega\). As shown in these Figures, increasing the value of \(R_{\text{L}}\) sharpens the shape of the transfer function. The curves shown in Figure 2a,b indicate a good match between the SPICE simulations and the proposed digital model. Figure 3 shows the absolute value (in mV) of the difference between both simulations. From this plot, we can observe that the difference between the curves is indeed very small, below \(1\) mV for all values of \(V_{\text{in}}\) measured. These small differences are perceptually insignificant and can be attributed to the simplifications made during the analysis of the circuit and to the way in which SPICE computes currents flowing through semiconductor devices. For example, SPICE introduces a small fictitious conductance in parallel with each p-n junction in order to aid the convergence of its iterative solvers. Additionally, the SPICE diode model will account for the small reverse current that flows when the voltage across the diode is negative [61]. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Name** & **Value** & **Name** & **Value** & **Name** & **Value** \\ \hline \(R\) & \(15\) k\(\Omega\) & \(l_{\text{s}}\) & \(10^{-17}\) A & \(V_{\text{T}}\) & \(25.864\) mV \\ \(R_{\text{L}}\) & \(1\)–\(50\) k\(\Omega\) & \(\eta\) & \(1\) & – & – \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameter values for the Lockhart wavefolder described by Equation (26).