Analysis on the Performance of a Second-order and a Third-order RLC Circuit of PRBS Generator

A pseudo-binary random signal (PRBS) has been widely utilized for system identification in complex signals to develop an experimental approach. PRBS generator is a circuit that generates pseudo-random numbers. This work aims to analyze the best fit value of the PRBS generator with second-order and third-order under-damped black-box RLC circuit of the estimated model. The procedures conducting here can be divided into three parts. First, to design two black boxes using the RLC circuit representing a critically under-damped second-order and third-order system. PRBS generated with maximum-length sequence (MLS) equals 127 bits by using seven shift registers. Second, simulate the PRBS generator using MATLAB software and validate the estimated model from the simulation using the System Identification Tool in MATLAB. Next, connecting hardware RLC circuit and reading input and output signals using an oscilloscope. Finally, 2500 samples of captured data were used for estimation. Then, analyze and compare the best fit of the simulation and experiment with second-order and third-order under-damped black-box RLC circuit. Furthermore, analyze and compare best fit using different sample time. The results showed that the best fit of the second-order model with under-damped black-box RLC circuit was autoregressive with the exogenous term (ARX) 211, where the best fit of the simulation was 99.88%, and the best fit of the experiment was 96.04%. And the results showed that the best fit of the third-order model with an under-damped black-box RLC circuit was ARX 331, where the best fit of the simulation was 99%, and the best fit of the experiment was 94.28%. It was concluded that the best fit value of the second-order was better than the third order. What’s more, the results showed that when the select range is the same, the bigger the sample time, the better the best fit. This is an open-access article under the CC BY-SA license


INTRODUCTION
Random white noise is the term given to completely random unpredictable noise. It has the property of having components at every frequency [1]. PRBS can also have this property [2]. It allows producing high-quality random sequences at low costs making it very useful in cryptography [3]. It is rather like a long recurring decimal number, but it repeats itself every desired bit [4]. PRBS is not a truly random sequence but with long sequence lengths and the most important point is its generation is rather simple [5]. Besides, it uses very little randomness to produce very long random sequences. PRBS can be generated with shift registers and an exclusive-OR(XOR) gate. XOR gate is a digital logic gate that gives a true output when the number of true inputs is odd. XOR gate connecting the outputs of two stages of the shift register and then feeding the result back into the input of the shift register [6]. Some combinations of outputs produce longer PRBSs than others-the longest one called MLS. MLS contains all possible combinations of a binary sequence [7]. The relationship between the number of generated PRBS signals and the number of shift-register stages shown in (1).
where m is the length of the MLS and n is the number of shift-register stages. MLS-based PRBS can be easily generated using a simple shift register circuit with proper feedback. This allows it to be incorporated into multiple signal generators as a normal function and is widely used in the dynamic testing of systems. Additionally, PRBS is the forcing functions most widely used in statistical system testing [8]. In this paper, theories about PRBS, system identification, ARX model will be discussed.
System identification is gaining more attention due to the widespread use of sophisticated, efficient algorithms and advances in digital processing. It has been an active area of research due to its numerous applications in various domains like signal processing, control, and fault detection tasks [9,10,11,12,13,14,15]. It uses statistical methods to build a dynamical system's mathematical models from measured input and output data [16]. The simplest way to get started on a parametric estimation routine is to build a state-space model where the modelorder is automatically determined [17].
Procedures for system identification can be divided into four parts, namely detection, characterization, and parameter estimation [18]. First, to select the choice of the model set, there are three types of models used in system identification, including the white box requiring physical law modeling, the black box, which does not require prior knowledge. And the gray box has characteristics of both white box and black box [19]. In this research, parametric and linear black boxes were chosen as the model set. Parametric means using a limited number of model features to describe the system [20]. Second, we choose the second-order and third-order RLC circuit in this research to choose the structure and order estimation. The third part is parameter estimation, and the final part is the performance analysis of the estimation model.

METHOD
Instruments for hardware and software and methods to explore the simulation and experiment have been shown in this chapter.

Material
In this research, both simulation and hardware experiments have been investigated. In the simulation part, System Identification Toolbox was used in MATLAB, results for best fit, zeros, and poles, noise spectrum transient and frequency responses can be deduced from this toolbox. In the experiment part, besides the connection with the RLC circuit and Arduino Uno, an oscilloscope was utilized to capture the input and output signal of the RLC circuit.

Methods
Firstly, a straightforward 7-bit PRBS generator was designed to generate a 127-bit MLS. PRBS signal generated by using the MATLAB SIMULINK. In this SIMULINK, Auto Correlator, Power Spectral Density, Scope, Clock Pulse, D Flip-Flop, and XOR blocks are being used. The design of the PRBS generator with a black box shown in Figure 1. The input signal was a clock pulse, then the clock signal fed into seven stages of D-flip fops and output signals of PRBS generator from fourth and seventh D-flip flops' feedback to the first D flip flop by the two-input XOR gate.
Second, designing RLC circuit black boxes for second-order and third order. The design of RLC circuit black boxes for second-order shown in Figure 2 (a) and for third-order shown as Figure 2 (b). Parameters of the RLC circuit, such as inductance, resistance, and capacitance, should be checked to stabilise it. From the design of the RLC circuit, the output of the second-order RLC circuit was the voltage of C, and the output of the third-order RLC circuit was the voltage of C1.
The relationship between an input voltage and output voltage for the second-order written in transfer function was as in (2).
However, when relating to the third-order RLC circuit black box shown in Figure 2 (b), it is not easy to write into the transfer function format. Assuming that the input voltage vi is 2 volts step input when time is smaller than 0, the input voltage is 0 while time more than 0, the input voltage is 2 volts. The relationship between output and input voltage can be written in a matrix format (3). The Eigenvalues of the matrix of the RLC circuit calculated by MATLAB code.
where R1 and R2 were resistance, L1 and L2 were inductance, C1 was capacitance used in Figure  2 (b). Eigenvalues of the transfer function of the black box should be negative to make sure the designs of the black box were stable [21]. Additionally, the best fit of the PRBS generator with the black box must higher than 99%, which checked by the system identification toolbox. However, once models have been identified, the estimated model and the actual output data from the experiment need to be validated. The data format for signals chosen time-domain signal and adjusted sample time. Then, removed the means of input and output signals and selected the range of samples to divide the samples into two parts, one for estimating the model, the other for validating the model which System Identification Toolbox deduced.
Polynomial models were chosen. In the system identification toolbox, the selection of structure of ARX type polynomial model can be estimated using the estimate button. The recommended ARX model structure can be applied to get the best fit number of the ARX model. In another way, the quick start button also can be chosen to check the maximum best fit model. Finally, selected the select range option from the preprocess popup menu in the ident figure. The data length is 2500 samples. The first 1250 for estimation and the remaining 1250 for validation.

ARX model
The ARX model was chosen as it was the simplest model incorporating the stimulus signal [22]. The general linear polynomial can be described using the following equation, as in (4) where u(k) and y(k) are the input and output of the system, e(k) is the error of the system. G(z -1 ) is the transfer function of the deterministic part of the system, H(z -1 ) is the transfer function of the stochastic part of the system. The term z -1 is the backward shift operator, the algorithm shown as in (5) G(z -1 ) and H(z -1 ) are rational polynomials defined as in (6) and (7) [23].
The general linear polynomial model described in (8) and (9).
when C(z), D(z), and F(z) equal 1, the general linear polynomial model is reduced to an ARX model. The ARX model described as in (10) and (11) ( ) ( ) = − ( ) ( ) + ( ) (10) The signal flow graph of an ARX model shown in Figure 3. The identification method for the ARX model is the least-squares method [24] [25]. To study the characteristics of the ARX model. The response curves, correlation function (ACF and CCF), and power spectral density for systems forced by PRBS generator were observed [26]. ACF of the input signal and CCF between input and output signal was used to estimate the transfer function model of the system [27]. In 2015, Ismail, et al. compared ARX and ARMAX model performance using data from SDEOE, found that model fit for ARXs was between 95.77% and 95.06%, and the model fit for ARMAXs was between 95.68% and 95.05% [28].

RESULTS AND DISCUSSION
ACF of the input signal and CCF between input and output signal was performed using Dynamic Signal Analyzer. The correlograms of these two functions were used to determine the transfer function model of the second-order and third-order RLC circuit black boxes. Parameters were chosen for the second-order and third-order RLC circuits shown in Table 1. The transfer function model equation shows the locations of the zeroes and poles of the dynamic system. The transfer function of the second-order RLC circuit, as in (12).
( ) = 1 8 2 + 3000 + 1 8 The number of eigenvalues depends on the order of the transfer function. For example, there are two eigenvalues from the equation. The first is -3000, second is 0.
The transfer function of the third-order RLC circuit, as in (13).
Analysis by system identification toolbox, the maximum best fit number was deduced by comparing different ARX models. Finally, the maximum best fit number for the second-order ARX model was ARX211 and for the third-order was ARX331. Validation results of the desired black box for hardware experiments shown in Figure 4.
The maximum best fit number of the ARX model for the second-order was 96.09 %, and the third-order was 94.28%. It is found that the maximum best fit number for both MATLAB simulation and hardware experiments is higher than 90%. Besides, in the same order, the maximum best fit of simulation is higher than the maximum best fit of the experiment. Additionally, with the order of the black box increase, the maximum best fit number decrease. To study more on the performance of the PRBS generator with the black box, the third-order black box was chosen to compare the best fit, FPE, and MSE with different sample times 25 ms and 50 ms when using an oscilloscope. The results of the Auto-correlation of residuals and Cross-correlation are shown in Figure 5.
It is found that analysis of residuals was performed on each identification sets to investigate the confidence limits (95%) of auto and cross-correlations. Auto-correlation performed on residuals should show a correlation only when residuals have no relative temporal delays. The ACF within the 95% confidence levels indicates that the residuals and model output were uncorrelated and lent validity to the model were shown in Figure 5. CCF was performed between residuals and the normalized inputs. The CCF within the 95% confidence interval levels indicates that the residuals are uncorrelated to the input.
Besides, FPE and MSE result also deduced when sample time was 25 ms, FPE equal to 0.007338, MSE equal to 0.007233, and when sample time was 50 ms, FPE equal to 0.00657, MSE equal to 0.006476. Furthermore, the best fit of the system with different sample times, 10 ms, 25 ms, 50 ms, and 100 ms shown in Table 2. The select range for the input for 10 ms, 25 ms, and 50 ms sample time was the same, which was 2500, while the select range for 100 ms was different.  It was found that with the increment of the sample time, the best fit number also increased. However, when sample time equals 100 ms, some sample data cannot be used. Therefore, the select range changed from 2500 to 2000. Except for the best fit number of 100 ms sample time, the best fit number increase with the increase of the sample time.

CONCLUSION
The comparison between second-order and third-order RLC circuit black box using the data from the PRBS generator has been presented in this study. The result showed that both secondorder and third-order RLC circuit black box can be implemented for PRBS since it passes all the validation criteria in this study. The best fit of the second-order RLC Circuit of PRBS Generator was more accurate than the third order. What's more, the comparison between different sample times also has been presented in this study. The result showed that the bigger the sample time, the bigger the best fit when the select range is the same. The finding in this study is significant as it will benefit future work in cryptography. However, increasing the model order can change some dynamic characteristics of the model, such as the stability of the model.