## 3 Principle and Implementation of Markov Chain Random Carrier Frequency Modulation
### Markov Chain Principle and Three-State Random Number Generation Process  
For the traditional RCFM, there exists the problem of uneven distribution of random numbers in a short period of time, which results in increased pulsation components in phase current and switching losses. In this paper, a three-state Markov chain model is introduced to optimize the effect of random number generation, and the particle swarm optimization (PSO) algorithm is applied to select the optimal transition probabilities and random gains. The Markov process is known as a memoryless process, meaning that the value of the random event sequence at the next moment (\(a_{n+1}\), \(t_{n+1}\)) is only related to the current value (\(a_{n}\), \(t_{n}\)), which is independent of previous values, and the sequence of the continuity random numbers can be expressed as  
\[ \begin{array}{c}M\{(a_{n+1},t_{n+1})|(a_{1},t_{1}),(a_{2},t_{2}),\ldots,(a_{n },t_{n})\}=\\ M\{(a_{n+1},t_{n+1})|(a_{n},t_{n})\}\end{array}  \tag{10}\]  
In the random optimization algorithm simulation and practical design, it is necessary to discretize the continuous events to form discrete Markov chains. Therefore, this paper introduces the conditional transition probability \(P_{ij}(m,n)\) at a single moment, which can be denoted as  
\[ \begin{array}{c}P_{ij}(m,n)=P\{X_{n}=a_{j}|X_{m}=a_{i}\}=\\ P\{X_{n}=j|X_{m}=i\},i,j\in S\end{array}  \tag{11}\]  
Figure 4: The simulation results of the carrier frequency in conventional RCFM. Figure 3: Schematic diagram of random PWM. where \(S\) denotes the state space, \(S=\{a_{1},a_{2},\ldots,a_{n}\}\). The transition probability \(P_{ij}\)(\(m\),\(n\)) is the conditional probability that the system is in state \(a_{i}\) at time \(m\) and transitions to state \(a_{j}\) after (\(n-m\)) time steps; it can also be interpreted as the probability that the system transitions from state \(i\) at time \(m\) to state \(j\) at time \(n\). The random number generation module only needs to consider the value of the previous moment, and it only takes one step from time \(m\) to time \(n\). This type of Markov chain is called a homogeneous Markov chain with stationary transition probabilities. \(P_{ij}\)(\(m\),\(m+1\)) is denoted as \(P_{ij}\)(\(m\)), i.e.,  
\[P_{ij}(m)=P_{ij}=P\{X_{m+1}=j|X_{m}=i\},i,j\in S \tag{12}\]  
Representing all transition probabilities in the above homogeneous Markov chain in the matrix form, the transition probability matrix \(P\) is  
\[P=\{p_{ij},i,j\in S\}= \begin{bmatrix}p_{11}&\cdots&p_{1m}\\ \vdots&\ddots&\vdots\\ p_{n1}&\cdots&p_{nm}\end{bmatrix}  \tag{13}\]  
where each element of \(P\) belongs to the value of [0,1], and the sum of the elements in each row and column is \(1\). Based on the above, it can be seen that the larger the state space, the more elements the transition matrix contains, which also means that the effect of optimized random numbers is more ideal. However, the increase in random state space will also bring additional computation to the chip processor. Considering the effect of optimized random numbers and the amount of computation, this paper chooses to introduce the three-state Markov chain into the RCFM technique. The design of three-state Markov chain random carrier frequency modulation is to divide the original carrier frequency variation interval [\(\omega_{c}-R\), \(\omega_{c}+R\)] into three parts: [\(\omega_{c}-R\), \(\omega_{c}-k\times R\)], [\(\omega_{c}-k\times R\), \(\omega_{c}+k\times R\)] and [\(\omega_{c}+k\times R\), \(\omega_{c}+R\)], with \(k\) denoting the modulation coefficient and \(k\in(0,0.33)\). The three parts correspond to states 1, 2 and 3, respectively. The state of the next carrier frequency is determined by the judgment of the state of the current carrier frequency. Figure 5 shows the state parameter transition diagram of three-state Markov chain carrier frequency.