## 5 Simulation of the f/N Converter Working in Adaptive Mode  
The simulator's task developed by the author is to perform partial simulations for individual elements of the measurement channel with a frequency carrier of information and to present the final effect of the f/N conversion using the previously discussed processing method. During the simulator operation, the following steps are carried out:  
1. Simulator configuration, setting simulation parameters and test signal parameters;
2. Simulation of the operation of the X/f converter, preparation of the \(T_{xi}\) period table representing the given test signal;
3. F/N processing using the discussed method;
4. The reconstruction of the \(x(t)\) waveform from the collected numerical values \(N_{xi}\);
5. Using the numerical representations of the test signal and the reconstructed signal to calculate the absolute error and relative information processing;
6. Saving the simulation results under unique names in the form of a text file with data and a graphic file with the visualization of the simulator work results. Figure 10 shows the fragment of the application diagram with the presentation of the subroutines that perform the following sequence: creation of the \(T_{xi}\) period table, f/N processing, reconstruction of the \(x(t)\) waveform, and creation of a unique name of data files containing information about the test signal parameters and simulator application configuration. Figure 11 shows the fragment of the diagram that realizes the setting of the \(N_{xi}\) threshold values that trigger the change of the clock signal frequency controlling the operation of the f/N converter counter. The upper Case structure [21] is activated if the current value of \(N_{xi}\) is greater than the value of \(N_{xi}\) max set in the application panel (Figure 12). Then, the frequency change factor Prec Lo is set (Figures 11 and 12). The middle Case structure handles the case where the current numerical value of \(N_{xi}\) is between the set values of \(N_{xi}\) min and \(N_{xi}\) max. Lastly, the lower Case structure handles the signal if the current \(N_{xi}\) is less than the given value of \(N_{xi}\) min. Then, the change factor Presc Hi is set. In addition, on the application panel shown in Figure 12, one can directly read the maximum and minimum numerical values of \(N_{xi}\) and check the parameters of the test signal, the setpoint value of the \(K\) conversion constant of the X/f converter, and the minimum and maximum value of the relative error of the test signal processing. The colors of the curves on the charts denote: black--set waveform, blue--reconstructed waveform, orange--absolute error, purple--relative error. The operation of an adaptive method for improving the conversion parameters of a \"frequency-to-code\" converter is discussed using an example of a selected design implementing continuous digital period measurement using a single counter. However, this is not the only possible structure to be used. The method can also be used in alternative structures, realizing measurement with two counters [8], the method of dependent counting [35], or any other method [3; 25; 34] realizing digital period measurement based on determining the product of the numerical value representing the length of the measured period and the length of the period T0 of the clock signal from the reference generator. In these cases,  
Figure 10: The fragment of the diagram showing the implementation of the simulation process, recreating the input waveform and creating a unique name for the data file. decreasing the T0 will increase the accuracy of determining the period \(T_{xi}\), while decreasing the T0 will extend the measuring range of the \"frequency-to-code\" converter in the range of large values of \(T_{xi}\).