# An Adaptive 24 GHz PSO-Based Optimized VCO in Next-Generation Wireless Sensor Networks
## 3 The Proposed Adaptive PSO Algorithm
### Circuit Design
\[Z_{in1}=-\left(\frac{1}{g_{mMP_{cr}}}+\frac{1}{g_{mMN_{cr}}}\right), \tag{5}\]  
\[Z_{in2}=-\left(\frac{2}{g_{mMN1}}\right), \tag{6}\]  
where \(g_{mMPcr}\), \(g_{mMN_{cr}}\), and \(g_{mMN1}\) are transcontances of \(MP_{cr}\), \(MN_{cr}\), and \(MN_{transistors}\), respectively. Analyzing the small signal closed loop voltage gain (Vo/Vi) of the proposed VCO, the voltage gain Vo/Vi = 1 at any oscillating frequency is provided by Equation (7), and the oscillation frequency is shown in Equation (8). \[\frac{-g_{mMPcr}\left(sC_{1}+sC_{2}+\frac{1}{sL_{2}}+\frac{1}{R_{p2}}-g_{m MPcr}\right)-\left(g_{mMPcr}\right)^{2}}{\left(sC_{1}+\frac{1}{sL_{1}}+ \frac{1}{R_{p1}}\right)\left(g_{mMPcr}-sC_{1}-sC_{1}-\frac{1}{sL_{2}}-\frac{1 }{R_{p2}}\right)+sC_{1}(sC_{1}-g_{mMPcr})}=1, \tag{7}\]  
\[\omega\approx\sqrt{\frac{L_{1}+L_{2}}{L_{1}L_{2}(2C_{1}+C_{2})}}. \tag{8}\]For a simple phase noise analysis of the proposed VCO, the gate noises of \(MP_{CR}\), \(MN_{CR}\), \(MN_{1}\), and \(MN_{2}\) are illustrated by \(i_{8}\)[2]. The thermal noise and low frequency \(1/\)f noise of transistors \(MP_{CR}\), \(MN_{CR}\), \(MN_{1}\), and \(MN_{2}\) are represented by \(i_{(d+f)MP_{CR}}^{2}\), \(i_{(d+f)MN_{CR}}^{2}\), \(i_{(d+f)MN_{1}}^{2}\), and \(i_{(d+f)MN_{2}}^{2}\), respectively. The LC tank thermal noise is represented by \(i_{R}^{2}\). For phase noise computations of the VCO, the channel thermal noise, power densities of transistor gate noise, \(1/\)f noise [11], and LC tank thermal noise are shown in Equations (9), (10) and (11), respectively. The total phase noise of the VCO is also defined in Equation (12). \[\frac{i_{(d+f)}^{2}}{\Delta f}=\frac{4 kT\gamma_{S}d_{o}}{1+e\Big{(}-\frac{V_{ S}-V_{th}}{2 mV_{T}}\Big{)}}+\frac{2q_{D}}{1+e\Big{(}-\frac{V_{gs}-V_{th}}{2 mV_{T}} \Big{)}}, \tag{9}\]  
Figure 10:0  
Figure 10:1  
Figure 10:2  
where \(P_{sig}\) is the power of a VCO oscillating signal, and \(S_{noise}\Delta f\) is the spectral power density of the VCO noise. It is depicted in Equation (12) that the higher the VCO output signal, the lower the VCO phase noise. Figure 11 illustrates the flow chart of an optimized VCO. Adaptive PSO parameters such as the initial population size, initial position of the particle, and rate of change in position (velocity) of particles are determined using the Agilent ADS software's PSO optimization tool (v. 2022). As a result, for each optimization cycle, random generation is conducted due to the initial size of the population. Figure 10:3 Optimized VCO flowchart using an adaptive PSO. In our work, we focus our attention on phase noise, which is the most important performance parameter of VCOs. In our study, MATLAB (v.2017) and ADS keysight ADS 2022 are the software used. In the ADS software, there is a MATLAB co-simulation window that utilizes MATLAB to integrate the AD with MATLAB. Then, the ADS RF window is applied with the designed VCO and the MATLAB script with ADS. Within the MATLAB environment, adaptive PSO coding is assigned and named by separate blocks of code. During the adaptive PSO's optimization process, the phase noise's numerical value is determined by utilizing the VCO block. In the MATLAB block, all the parameters of the adaptive PSO and variables of the VCO design are initialized. In the first step, all the variables of the design are randomly created from the intended block of MATLAB. Then, a text file is saved. The first set of design variables is given to the designed VCO in the form of an ADS text file. The designed VCO sets its output, i.e., phase noise value, as the input of the second MATLAB link. First, we assign the best and worst values, respectively. Then, in the second step, the VCO is joined to the other set of design variables. Its phase noise value is computed and compared with the best value. Until we find the best solution, we continue the loop of the algorithm. Iterations of this algorithm continue until the maximum number is reached. Finally, it is possible to achieve the desired phase noise.