Method for automatically determining maximum harmonic number of radio frequency circuit
Through the automation method, the harmonic parameters are gradually adjusted according to the cycle and transient analysis results of the circuit, and the problem of difficulty in selecting the maximum harmonic number in the existing technology is solved, and efficient and accurate RF circuit simulation is achieved.
Patent Information
- Application Number
- CN202510068883.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-16
AI Technical Summary
When determining the maximum harmonic number of RF circuits, the prior art depends on the experience of designers, which can easily lead to inaccurate simulation results or low simulation efficiency.
Through the automation method, the harmonic parameters are gradually adjusted according to the cycle and transient analysis results of the circuit until the compliance conditions are met, thereby determining the maximum harmonic number of the radio frequency circuit.
It ensures the accuracy of simulation results and improves simulation efficiency without manually setting the maximum harmonic number, and reduces simulation time consumption.
Smart Images

Figure CN119886019A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of integrated circuit computer-aided design, and in particular, the present invention relates to a method for automatically determining the maximum harmonic number of a radio frequency circuit. Background Art
[0002] RF circuits are a special type of analog circuits that are widely used in wireless signal transmission and communication fields, such as Bluetooth, WiFi, radar, navigation, etc. The operating frequency of RF circuits is higher than that of ordinary analog circuits, and their design indicators are calculated based on the periodic invariant results of the steady state after the circuit reaches a steady state, that is, a periodic state. Therefore, the primary task of RF simulation is to find the steady state of the circuit, that is, to find the periodic waveform of all circuit signals.
[0003] like Figure 1 As shown, the operating frequency of RF circuits is generally high, and the time to reach steady-state operation is difficult to predict, usually requiring tens of thousands or even millions of cycles. If the transient analysis of a general SPICE simulator is used to find the circuit steady state, the simulation time will reach weeks or even months, which is unbearable for circuit design.
[0004] Harmonic balance is a commonly used method for calculating the steady state of RF circuits. It is a spectral method that uses Fourier transform to transform the periodic signal and circuit equation in the time domain into the frequency domain, and uses the frequency domain signal as the unknown variable to solve the circuit equation in the frequency domain, such as Figure 2 , Figure 3 According to Fourier theory, any curve x(t) with a period of T in the time domain can be expanded into the following Fourier series:
[0005]
[0006] Where angular frequency ω=2π / T,k=0,±1,±2,…,X k is the Fourier coefficient, that is, the unknown number of the circuit equation in the frequency domain, and t is the time.
[0007] The Fourier series is an infinite series. Based on the assumption that higher-order harmonics have smaller energy, in actual calculations and solutions, the series is truncated to K items, and the coefficients after the Kth item are ignored. This way, the problem becomes finite-dimensional, and software can be written on a computer to solve it and complete the RF simulation. The number of items K that the series is truncated to is called the maximum harmonic number.
[0008] There are many types and functions of RF circuits. The working status of each node signal in the circuit is different. The selection of the maximum harmonic number often depends on the experience of the designer, but this will bring two problems. If the maximum harmonic number is too small, some signals will be excessively truncated, resulting in the energy at high frequencies being ignored and the simulation results being inaccurate. If the maximum harmonic number is too large, the length of the Fourier coefficients and the number of unknowns will increase, resulting in a large number of redundant calculations and reduced simulation efficiency. Summary of the invention
[0009] To solve the above problems, the present invention proposes a method for automatically determining the maximum harmonic number of a radio frequency circuit, so as to avoid the problem of inaccurate simulation results or low simulation efficiency that may be caused by manually setting the maximum harmonic number, and improve the usability of the simulation software.
[0010] A first aspect of the present invention provides a method for automatically determining the maximum number of harmonics in a radio frequency circuit, comprising:
[0011] Step S1, obtaining the period T of the circuit according to the circuit excitation frequency, performing transient analysis with a length of [0, t], and initializing parameters;
[0012] Step S2, traverse each node of the circuit, and execute steps S3 to S5 for each circuit node i in turn, until the last circuit node is terminated and step S6 is executed;
[0013] Step S3, setting the harmonic parameter h=3, and calculating the time domain square integral A of the circuit voltage v(t) of the circuit node i in the interval [tT, t];
[0014] Step S4, calculate the first h+1 Fourier coefficients V of v(t) 0 ,…,V h , get the value of base value B;
[0015] Step S5, determine whether the standard condition is met. If the standard condition is met, set m = max(m, h) and go to step S2 for execution; if the standard condition is met, set h = h+1 and go to step S4 for execution;
[0016] Step S6, the harmonic order m value is determined to be the maximum harmonic number, and the process ends;
[0017] The parameter initialization includes setting: harmonic order m=0, harmonic number upper limit M is a preset value, and tolerance Q is a preset value;
[0018] m and M are integers; t is time.
[0019] Further, in step S1, performing transient analysis with a length of [0, t] includes calling general SPICE simulation software to perform 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 V 0 , …, 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 V 0 , …, V h ;
[0024] The calculation formula for the base value B is B = |V 0 | 2 + 2|V 1 | 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 the second aspect of the present invention, an electronic device is provided, 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 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 the first aspect of the present invention.
[0030] In the third aspect of the present invention, a computer-readable storage medium is provided, and the computer-readable storage medium stores a computer program that 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 effects of the present invention compared with the prior art are:
[0032] The present invention can automatically determine the maximum harmonic number of a radio frequency circuit and has the following advantages:
[0033] First, the user does not need to set the maximum harmonic number of the circuit, which improves the usability of the software;
[0034] Secondly, the method of the present invention determines the maximum harmonic number based on the circuit time domain behavior, which can ensure the accuracy of the maximum harmonic number;
[0035] Finally, the present invention can avoid selecting an excessively large maximum harmonic number and the resulting expansion of the problem scale and extra calculations, thereby reducing the time consumption of simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a schematic diagram of the time when the operating frequency of the radio frequency circuit in the prior art reaches steady-state operation.
[0037] Figure 2 It is a schematic diagram of a time domain periodic signal in the prior art.
[0038] Figure 3 It is a schematic diagram of the Fourier transform spectrum of the prior art.
[0039] Figure 4 The present invention provides a method flow chart of a method for automatically determining the maximum harmonic number of a radio frequency circuit.
[0040] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0042] Method Embodiment
[0043] The purpose of the present invention is to provide a method for automatically determining the maximum harmonic number of a radio frequency circuit, so as to avoid the problem of inaccurate simulation results or low simulation efficiency caused by manually setting the maximum harmonic number, and to improve the usability of the simulation software. To solve the above problems, the first aspect of the present invention provides a method based on automatically determining the maximum harmonic number of a radio frequency circuit, such as Figure 4 shown.
[0044] A method for automatically determining the maximum harmonic number of a radio frequency circuit, comprising:
[0045] S1, obtain the circuit period T according to the circuit excitation frequency, perform transient analysis with a length of [0, t], and initialize parameters, where t is time.
[0046] The parameter initialization includes: setting the harmonic order m=0, the upper limit M of the harmonic number as a preset value, and the tolerance Q as a preset value.
[0047] Where m and M are integers. t is time, which is a multiple of the circuit period T and is adjusted according to the speed at which the circuit reaches an approximate steady state.
[0048] Preferably, t is 50 times, 100 times, 150 times, 200 times, or 50-100 times, 100-150 times, 150-200 times, or 50-200 times the circuit period T.
[0049] Preferably, the preset value of the upper limit M of the harmonic number is selected between 100 and 200, and the preset value of the tolerance Q is selected between 1e-3 and 1e-4.
[0050] The transient analysis with execution length [0, t] is to call the general SPICE simulation software to perform transient analysis on the current circuit.
[0051] Parameter initialization refers to initializing the parameters of general SPICE simulation software.
[0052] SPICE simulation software is circuit simulation software. Transient analysis is a common function of SPICE simulation software. Through transient analysis, the waveform of the voltage change of each node in the circuit with respect to time, that is, the voltage data V(t), can be obtained.
[0053] S2, traverse each node of the circuit, and execute steps S3 to S5 for each circuit node i in turn, until the last circuit node is terminated and step S6 is executed.
[0054] In this step, step S2 is performed together with steps S3 to S5 to calculate the A value and B value of the voltage signal v(t) of each node i in the circuit starting from h=3.
[0055] S3, setting the harmonic parameter h=3, and calculating the time domain square integral A of the circuit voltage v(t) of the circuit node i in the interval [tT, t].
[0056] In this step, based on the circuit period T, the circuit voltage v(t) of the circuit node i in the interval [tT, t] is extracted, and the time domain square integral A of v(t) in the last period of transient analysis is calculated, where A is given by the formula get.
[0057] S4, calculate the first h+1 Fourier coefficients V of v(t) 0 ,…,Vh , obtain the value of the base value B.
[0058] Calculate the first h + 1 Fourier coefficients V of v(t) 0 , …, V h , specifically, perform a Fourier transform expansion on the circuit voltage v(t) of circuit node i, and take the first h + 1 Fourier coefficients V in the expansion 0 , …, V h .
[0059] Among them, the calculation formula for the base value B is B = |V 0 | 2 + 2|V 1 | 2 + … + 2|V h | 2 .
[0060] S5, determine whether the compliance condition is met. If yes, let m = max(m, h), and go to step S2 to execute; if no, let h = h + 1, and go to step S4 to execute.
[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 period T of the circuit according to the fundamental frequency of the 100 MHz circuit, and call the general SPICE simulation software to perform a transient analysis of [0, 2000 ns]. Extract the circuit voltage signals v(t) of each node.
[0068] For the first node, obtain A = 12.35 through calculation.
[0069] Set h = 3 and calculate the first 4 terms of the Fourier series V 0 , …, V 3 .
[0070] Calculate to obtain B = |V 0 | 2 + 2|V 1 | 2 … + 2|V 3 | 2 = 10.5.
[0071] At this time, the first condition |A - B| < Q * A is not satisfied. Therefore, let h = 3 + 1 = 4, and calculate the first 5 terms of the Fourier series and B = |V 0 | 2 + 2|V 1 | 2 … + 2|V 4 | 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, by calculation, A = 8.54 is obtained. Similar to the calculation process, the B values at h = 3, 4, and 5 are calculated to be 2.35, 6.56, and 8.53 respectively. Therefore, the first condition is satisfied at h = 5, 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, and the process exits.
[0075] Embodiment of the 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 5Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a microprocessor (Microprocessor Unit, referred to as MPU) or a programmable logic device (Programmable logic device, referred to as PLD)) and a memory 104 for storing data. In an exemplary embodiment, the electronic device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only and does not limit the structure of the above terminal device. Figure 5 More or fewer components as shown, or with Figure 5 Equivalent functions or comparisons shown Figure 5 A different configuration with more features is shown.
[0080] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the methods in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, to implement the above-mentioned methods. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0081] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the switching device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0082] Computer Readable Storage Medium Embodiments
[0083] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program can be loaded and executed by a processor to implement the method for automatically determining the maximum harmonic number of a radio frequency circuit as described in the first aspect.
[0084] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for automatically determining the maximum number of harmonics in 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 perform parameter initialization; 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 h , get the value of base value B; Step S5: Determine whether the compliance condition is met. If the compliance condition is yes, let m = max(m, h), and go to Step S2 for execution; if the compliance condition is no, let h = h + 1, and go to Step S4 for execution; Step S6: Determine the value of the harmonic order m as the maximum harmonic number and terminate; wherein, the parameter initialization includes setting: the harmonic order 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.
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 cycle T, the circuit voltage v(t) of the 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 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, the circuit voltage v(t) at the circuit node i is expanded by Fourier transform, and the first h+1 Fourier coefficients V0,…,V h ; The calculation formula of the base value B is B = |V0| 2 +2|V1| 2 +…+2|V h | 2 .
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, the compliance condition is |A - B| < Q × A or h = M.
6. A method for automatically determining the maximum harmonic number of a radio frequency circuit according to claim 5, characterized in that: In Step S5, 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 upper limit M of the harmonic number: yes means compliance, no means non-compliance.
7. 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 6.
8. 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 6.
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
Analyzer and analysis method
JP2019074350A
Automatic harmonic number identification for harmonic balance analysis
US9507894B1