A method for automatically determining the maximum harmonic number of an RF circuit
By automatically determining the maximum harmonic number of the radio frequency circuit, the problem of inaccurate simulation results and low efficiency caused by reliance on experience in the existing technology is solved, and efficient and accurate simulation results are achieved, improving software usability and simulation efficiency.
Patent Information
- Application Number
- CN202510068883.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-01-16
AI Technical Summary
Existing technologies rely on the designer's experience when determining the maximum harmonic number of RF circuits, which leads to inaccurate simulation results or low simulation efficiency. Furthermore, manually setting the maximum harmonic number may result in redundant calculations and excessive time consumption.
A method for automatically determining the maximum harmonic number of a radio frequency circuit is provided. By traversing the circuit nodes, calculating the time-domain square integral and Fourier coefficients of the voltage, and using the compliance conditions, the maximum harmonic number is automatically determined, avoiding manual settings and improving the ease of use and accuracy of the simulation software.
It enables automatic determination of the maximum harmonic number of the RF circuit, improves the ease of use of the simulation software, ensures the accuracy of the simulation results, reduces redundant calculations, and shortens the simulation time.
Smart Images

Figure CN119886019B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer-aided design technology for integrated circuits. Specifically, this invention relates to a method for automatically determining the maximum harmonic number of a radio frequency circuit. Background Technology
[0002] Radio frequency (RF) circuits are a special type of analog circuit widely used in wireless signal transmission and communication, such as Bluetooth, WiFi, radar, and navigation. RF circuits operate at higher frequencies than ordinary analog circuits, and their design specifications are calculated based on the steady-state periodicity of the circuit after it reaches a steady state. Therefore, the primary task of RF simulation is to find the steady state of the circuit, that is, to find the periodic waveforms of all circuit signals.
[0003] like Figure 1 As shown, radio frequency circuits generally operate at high frequencies, and the time to reach steady-state operation is difficult to predict, usually requiring tens of thousands or even millions of cycles. If transient analysis using a general-purpose SPICE simulator is used to find the circuit's steady state, the simulation time can reach several weeks or even months, which is unacceptable for circuit design.
[0004] Harmonic balance is a commonly used method for calculating the steady state of radio frequency (RF) circuits. It is a spectral method that uses Fourier transform to transform the periodic signal and circuit equations in the time domain to the frequency domain. The frequency domain signal is then treated as an unknown, and the circuit equations are solved in the frequency domain. Figure 2 , Figure 3 As shown. According to Fourier theory, any curve x(t) with period T in the time domain can be expanded into the following Fourier series:
[0005]
[0006] Where the angular frequency ω = 2π / T, k = 0, ±1, ±2, ..., X k These are the Fourier coefficients, which are the unknowns in the circuit equations in the frequency domain, and t is time.
[0007] The Fourier series is an infinite series. Based on the assumption that the higher the harmonic energy, the smaller it is, in actual calculation and solution, the above series is truncated to K terms, and the coefficients after the Kth term are ignored. In this way, the problem becomes finite-dimensional, and software can be written on a computer to solve it and complete radio frequency simulation. The number of terms truncated, K, is called the maximum harmonic number.
[0008] Radio frequency circuits come in many types and functions, and the operating states of signals at each node in the circuit are not the same. The selection of the maximum harmonic number often depends on the designer's experience, but this will bring two problems. If the maximum harmonic number is too small, some signals will be over-truncated, resulting in the energy at high frequencies being ignored and the simulation results being inaccurate. If the maximum harmonic number is too large, it will increase the length of the Fourier coefficients and the number of unknowns, resulting in a lot of redundant calculations and reducing simulation efficiency. Summary of the Invention
[0009] To address the aforementioned issues, this invention proposes a method for automatically determining the maximum harmonic number of a radio frequency circuit. This avoids the problems of inaccurate simulation results or low simulation efficiency that may result from manually setting the maximum harmonic number, thereby improving the usability of the simulation software.
[0010] A first aspect of the present invention provides a method for automatically determining the maximum harmonic number of a radio frequency circuit, comprising:
[0011] Step S1: Obtain the circuit period T based on the circuit excitation frequency, perform transient analysis of length [0,t], and initialize the parameters;
[0012] Step S2: Traverse each node of the circuit, and sequentially execute steps S3 to S5 for each circuit node i until the last circuit node is terminated and step S6 is executed.
[0013] Step S3: Set the harmonic parameter h = 3, and calculate the time-domain square integral A of the circuit voltage v(t) at circuit node i over the interval [tT,t].
[0014] Step S4, calculate the first h+1 Fourier coefficients V0,…,V of v(t). h To obtain the value of base value B;
[0015] Step S5: Determine whether the target condition is met. If the target condition is met, set m = max(m, h) and proceed to step S2. If the target condition is not met, set h = h + 1 and proceed to step S4.
[0016] Step S6: The harmonic order m is determined to be the maximum harmonic number, and the process terminates.
[0017] The parameter initialization includes setting: harmonic order m = 0, upper limit of harmonic number M as a preset value, and tolerance Q as a preset value;
[0018] m and M are integers; t is time.
[0019] Furthermore, in step S1, performing a transient analysis of length [0,t] includes calling the general SPICE simulation software to perform the transient analysis.
[0020] Further, step S3 specifically includes:
[0021] Based on the circuit period T, extract the circuit voltage v(t) of circuit node i in the interval [t - T, t], and calculate the time-domain square integral A of v(t) in the last period of the transient analysis, where A is obtained by the formula obtained.
[0022] Further, in step S4:
[0023] Calculate the first h + 1 Fourier coefficients V0, …, V h , specifically, perform a Fourier transform expansion on the circuit voltage v of circuit node i, and take the first h + 1 Fourier coefficients V0, …, V h ;
[0024] The calculation formula for the base value B is B = |V0| 2 + 2|V1| 2 + … + 2|V h | 2 .
[0025] Further, in step S5, the compliance condition is |A - B| < Q × A or h = M.
[0026] Further, in step S5, use |A - B| < Q × A in the compliance condition to determine: yes for compliance, no for non-compliance; at the same time, use h = M in the compliance condition to determine whether h reaches the harmonic number upper limit M: yes for compliance, no for non-compliance.
[0027] In a second aspect of the present invention, there is provided an electronic device, including:
[0028] At least one processor; and a memory communicatively connected to the at least one processor; wherein,
[0029] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute a method for automatically determining the maximum harmonic number of a radio frequency circuit according to the first aspect of the present invention.
[0030] In a third aspect of the present invention, there is provided a computer-readable storage medium, on which a computer program is stored, and the computer program can be loaded and executed by a processor to execute a method for automatically determining the maximum harmonic number of a radio frequency circuit according to the first aspect of the present invention.
[0031] The beneficial effect of the present invention compared with the prior art is:
[0032] The present invention can automatically determine the maximum harmonic number of a radio frequency circuit and has the following advantages:
[0033] Firstly, it eliminates the need for users to set the maximum harmonic count of the circuit, thus improving the ease of use of the software;
[0034] Secondly, the method of the present invention determines the maximum harmonic number based on the time-domain behavior of the circuit, which can guarantee the accuracy of the maximum harmonic number;
[0035] Finally, this invention avoids selecting an excessively large maximum harmonic number, and the resulting expansion of the problem size and additional calculations, thus reducing the simulation time consumption. Attached Figure Description
[0036] Figure 1 This is a schematic diagram showing the time it takes for the operating frequency of a current-technical radio frequency circuit to reach steady-state operation.
[0037] Figure 2 This is a schematic diagram of a time-domain periodic signal in the prior art.
[0038] Figure 3 This is a schematic diagram of the Fourier transform spectrum of existing technology.
[0039] Figure 4 This is a flowchart of a method for automatically determining the maximum harmonic number of a radio frequency circuit, provided in an embodiment of the present invention.
[0040] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0041] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0042] Method Implementation Examples
[0043] The purpose of this invention is to provide a method for automatically determining the maximum harmonic number of a radio frequency (RF) circuit, thereby avoiding inaccurate simulation results or low simulation efficiency that may result from manually setting the maximum harmonic number, and improving the usability of simulation software. To solve the above problems, a first aspect of this invention provides a method for automatically determining the maximum harmonic number of an RF circuit, such as... Figure 4 As shown.
[0044] A method for automatically determining the maximum harmonic number of a radio frequency circuit includes:
[0045] S1: Obtain the circuit period T based on the circuit excitation frequency, perform transient analysis of length [0, t], and initialize the parameters, where t is time.
[0046] The parameter initialization includes setting the harmonic order m=0, the upper limit of the harmonic number M to a preset value, and the tolerance Q to a preset value.
[0047] Where m and M are integers. t is time, which takes the value of several times the circuit period T, and is adjusted according to the speed at which the circuit reaches an approximate steady state.
[0048] Preferably, t is taken as 50 times, 100 times, 150 times, or 200 times the circuit period T, or 50 to 100 times, 100 to 150 times, 150 to 200 times, or 50 to 200 times.
[0049] Preferably, the upper limit of harmonic number M is selected between 100 and 200, and the tolerance Q is selected between 1e-3 and 1e-4.
[0050] Performing a transient analysis with a length of [0,t] involves calling the general-purpose SPICE simulation software to perform a transient analysis on the current circuit.
[0051] Parameter initialization refers to initializing the parameters of the general-purpose SPICE simulation software.
[0052] SPICE simulation software is a circuit simulation software. Transient analysis is a commonly used function of SPICE simulation software. Through transient analysis, the waveforms of voltage changes at various nodes in the circuit with respect to time can be obtained, i.e., voltage data V(t).
[0053] S2, traverse each node of the circuit, and sequentially execute steps S3 to S5 for each circuit node i until the last circuit node is terminated and step S6 is executed.
[0054] In this step, step S2 is executed in conjunction with steps S3 to S5 to calculate the A and B values of the voltage signal v(t) at each node i in the circuit, starting from h=3.
[0055] S3, set the harmonic parameter h = 3, and calculate the time-domain square integral A of the circuit voltage v(t) at circuit node i over the interval [tT,t].
[0056] In this step, based on the circuit period T, the circuit voltage v(t) at circuit node i in the interval [tT,t] is extracted, and the time-domain square integral A of v(t) in the last cycle of the transient analysis is calculated, where A is obtained from the formula... get.
[0057] S4, calculate the first h+1 Fourier coefficients V0,…,V of v(t). h , and obtain the value of the base value B.
[0058] Calculate the first h+1 Fourier coefficients V0,…,V of v(t).h , specifically, the circuit voltage v(t) of circuit node i is expanded by Fourier transform, and the first h + 1 Fourier coefficients V0, …, V h .
[0059] Among them, the calculation formula of the base value B is B = |V0| 2 + 2|V1| 2 + … + 2|V h | 2 .
[0060] S5. Determine whether the compliance condition is satisfied. If yes, let m = max(m, h), and go to step S2 for execution; if no, let h = h + 1, and go to step S4 for execution.
[0061] In this step, the compliance condition means: |A - B| < Q × A or h = M.
[0062] Specifically, use |A - B| < Q × A in the compliance condition to determine: yes means compliance, no means non - compliance. At the same time, use h = M in the compliance condition to determine whether h reaches the harmonic number upper limit M: yes means compliance, no means non - compliance.
[0063] If compliant, let m = max(m, h) and return to step S2 to execute the next circuit node. If non - compliant, increase h, let h = h + 1, and return to step S4 to continue calculating B.
[0064] m = max(m, h) ensures that the value of m always takes the maximum harmonic order among all nodes.
[0065] S6. Determine the value of the harmonic order m as the maximum harmonic number, and terminate.
[0066] The following takes a circuit with two nodes and an excitation frequency of 100 MHz as an example to illustrate the present invention.
[0067] Set the tolerance Q = 1e - 3, t = 2000 ns, calculate the circuit period T according to the fundamental frequency of the 100 MHz circuit, and call the general SPICE simulation software to perform transient analysis for [0, 2000 ns]. Extract the circuit voltage signal v(t) of each node.
[0068] For the first node, A = 12.35 is obtained through calculation.
[0069] Set h = 3, and calculate the first 4 Fourier series V0, …, V3.
[0070] Calculate B = |V0| 2 + 2|V1| 2 … + 2|V3| 2 = 10.5.
[0071] At this time, the first condition |A - B| < Q * A is not satisfied, so let h = 3 + 1 = 4, calculate the first 5 terms of the Fourier series, and B = |V0| 2 + 2|V1| 2 … + 2|V4| 2 = 12.28
[0072] At this time, the first condition is satisfied, so the maximum harmonic number m of this node is 4
[0073] For the second node, A = 8.54 is obtained through calculation. Similar to the calculation process, the values of B at h = 3, 4, and 5 are calculated to be 2.35, 6.56, and 8.53 respectively. So when h = 5, the first condition is satisfied and the maximum harmonic number m = 5
[0074] At this time, all nodes of the circuit have been traversed, and the maximum harmonic number of the circuit is determined to be 5, then exit
[0075] Embodiment of an electronic device
[0076] In a second aspect of the present invention, an electronic device is provided, including:
[0077] At least one processor; and a memory communicatively connected to the at least one processor; wherein,
[0078] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute a method for automatically determining the maximum harmonic number of a radio frequency circuit according to the first aspect of the present invention
[0079] Figure 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. As Figure 5 shown, the electronic device may include one or more ( Figure 5 only one is shown in Figure 5 ) processors 102 (the processor 102 may include but is not limited to a microprocessor (abbreviated as MPU) or a programmable logic device (abbreviated as PLD)) and a memory 104 for storing data. In an exemplary embodiment, the above electronic device may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 5 the structure shown in Figure 5 is only schematic and does not limit the structure of the above terminal device. For example, the terminal device may further include more or fewer components than Figure 5 shown in or have different configurations with the same functions as
[0080] shown in or more functions than
[0081] shown in shown
[0080] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to terminal devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0081] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the switching device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0082] Computer-readable storage medium embodiments
[0083] A third aspect of the invention provides a computer-readable storage medium having a computer program stored thereon, the computer program being loadable and executed by a processor for a method for automatically determining the maximum harmonic number of a radio frequency circuit as described in the first aspect.
[0084] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for automatically determining the maximum harmonic number of a radio frequency circuit, characterized in that, including: Step S1: Obtain the period T of the circuit according to the circuit excitation frequency, perform a transient analysis with a length of [0, t], and initialize parameters. Step S2: Traverse each node of the circuit. For each circuit node i in sequence, loop through steps S3 to S5 until the last circuit node terminates and step S6 is executed. Step S3: Set the harmonic parameter h = 3, and calculate the time-domain square integral A of the circuit voltage v(t) of circuit node i in the interval [t - T, t]. Step S4, calculate the first h+1 Fourier coefficients V0,…,V of v(t). h The base value B is obtained; the formula for calculating the base value B is B = |V0|. 2 +2|V1| 2 +…+2|V h | 2 Where V0,…,V h The first h+1 terms of the Fourier coefficients of v(t); Step S5: Determine whether the compliance condition is met. If so, let m = max(m, h), and go to step S2 for execution. If not, let h = h + 1, and go to step S4 for execution. Step S6: Determine the value of the harmonic number m as the maximum harmonic number, and terminate. Among them, the parameter initialization includes setting: the harmonic number m = 0, the upper limit M of the harmonic number is a preset value, and the tolerance Q is a preset value. m and M are integers; t is time. The compliance condition is |A - B| < Q × A or h = M.
2. The method for automatically determining the maximum harmonic number of a radio frequency circuit according to claim 1, characterized in that: In step S1, performing a transient analysis with a length of [0, t] includes calling a general SPICE simulation software to perform a transient analysis.
3. The method for automatically determining the maximum harmonic number of a radio frequency circuit according to claim 2, characterized in that, Step S3 specifically includes: Based on the circuit period T, the circuit voltage v(t) at circuit node i in the interval [tT,t] is extracted, and the time-domain square integral A of v(t) in the last cycle of the transient analysis is calculated, where A is given by the formula get.
4. The method for automatically determining the maximum harmonic number of a radio frequency circuit according to claim 3, characterized in that, In step S4: Calculate the first h+1 Fourier coefficients V0,…,V of v(t). h Specifically, this involves performing a Fourier transform on the circuit voltage v(t) at circuit node i, and taking the first h+1 Fourier coefficients V0,…,V from the expansion. h .
5. The method for automatically determining the maximum harmonic number of a radio frequency circuit according to claim 4, characterized in that, In step S5, use |A - B| < Q × A in the compliance condition to determine: yes for compliance, no for non-compliance; at the same time, use h = M in the compliance condition to determine whether h reaches the upper limit M of the harmonic number: yes for compliance, no for non-compliance.
6. An electronic device, characterized in that, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method for automatically determining the maximum harmonic number of a radio frequency circuit according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program thereon, and the computer program can be loaded and executed by a processor to execute a method for automatically determining the maximum harmonic number of a radio frequency circuit according to any one of claims 1 to 5.
Citation Information
Patent Citations
Harmonic balance method and device based on neural network and medium
CN116205181A
Constant-amplitude oscillation solving method, device and equipment based on harmonic balance and medium
CN116937618A