Hybrid iteration acceleration calculation method based on improved CORDIC algorithm
By setting the user-defined error e, determining the switching threshold of single-step iteration and merge iteration, optimizing the CORDIC algorithm, solving the problems of low computational efficiency and difficulty in balancing accuracy and speed of traditional algorithms, and achieving flexible dynamic adjustments to adapt to diverse application scenarios.
Patent Information
- Application Number
- CN202510941979.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-08-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional CORDIC algorithm has low computational efficiency, difficulty in balancing accuracy and speed, and insufficient dynamic adjustment capabilities, making it difficult to meet the diverse needs of different application scenarios.
Using a hybrid iteration strategy, by setting the user-defined error e, the switching threshold of single-step iteration and merge iteration is determined, and the compensation factor is ignored in the merge iteration, and the calculation process is optimized.
It achieves the improvement of computing efficiency while ensuring accuracy, meets the speed and accuracy requirements of different application scenarios, and has strong dynamic adjustment capabilities.
Smart Images

Figure CN120470204A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a hybrid iterative accelerated calculation method based on an improved CORDIC algorithm, and belongs to the technical field of digital signal processing and integrated circuit design. Background Art
[0002] The CORDIC (Coordinate Rotation Digital Computer) algorithm is an iterative algorithm widely used in digital signal processing, graphics processing, and communication systems. It approximates the target angle by rotating a vector and is mainly used to calculate trigonometric functions, hyperbolic functions, and vector rotation operations. The single-step iteration formula of the traditional CORDIC algorithm is: in, x i 、 y i is the horizontal and vertical coordinates, i represents the number of iterations, i is a positive integer, and the compensation factor , z i is the remaining angle of rotation for this iteration (which can be understood as the angle that has not been rotated in this iteration), The rotation angle value for this iteration (needs to be stored in memory in hardware implementation), d i It is the judgment factor of the rotation direction, used to determine the direction of rotation: Combine the two iterations into one, and the combined formula is: Among them, the compensation factor , the two-step merge iteration parameters are: The three iterations are combined into one, and the combined formula is: Among them, the compensation factor , the three-step merge iteration parameters are: From the above, through the calculation of the compensation factor, it can be obtained that when i=3, K 2≈1.0097, K 3≈1.01002, when i=4, K 2≈1.0024, K 3≈1.0025, when i=5, K 2≈1.0006,K 3≈1.0006. Therefore, it can be seen that as i gradually increases, K 2. K The value of 3 is infinitely close to 1, which means that as i gets larger, the error between the merged iteration and the single-step iteration gets smaller.
[0003] In summary, the traditional CORDIC algorithm has the following significant problems and challenges: 1. Low computational efficiency: The core of the CORDIC algorithm is to gradually approximate the target angle through iteration. This iteration introduces a compensation factor that requires multiplication. This is especially complex when the number of iterations is high, especially in scenarios requiring high precision. This directly leads to excessive consumption of computing resources and reduced computational speed, making it difficult to meet the needs of applications with high real-time requirements.
[0004] 2. Difficulty Balancing Accuracy and Speed: In traditional CORDIC algorithms, the number of iterations is positively correlated with computational accuracy. To achieve higher accuracy, the number of iterations must be increased, further exacerbating the decline in computational efficiency. However, in many practical applications, especially those with high real-time requirements (such as graphics rendering and communication signal processing), fast computation is required within limited computing resources. Therefore, reducing the number of static merging iterations to shorten computation time often results in a decrease in computational accuracy. In other words, traditional CORDIC algorithms struggle to meet the dual demands of accuracy and speed.
[0005] 3. Insufficient dynamic adjustment capabilities: In actual applications, the requirements for accuracy and speed may vary significantly in different scenarios. In some scenarios, high accuracy is required but speed is not, while in other scenarios, fast calculations are required but lower accuracy is acceptable (for example, beamforming in 5G communications requires low latency, but a certain error in accuracy is allowed). There are also some scenarios that require both high speed and high accuracy (for example, sensor fusion for autonomous driving requires high accuracy and cannot accept long latency). However, the traditional CORDIC algorithm uses a fixed merging step size and cannot dynamically adjust according to real-time errors. For example, when merging in three steps, the deviation between the initial rotation angle error and the actual angle is large and cannot be corrected through subsequent iterations. The lack of an effective dynamic adjustment mechanism makes it impossible to adapt to the diverse needs of different scenarios. Summary of the Invention
[0006] The purpose of the present invention is to provide a hybrid iterative accelerated calculation method based on an improved CORDIC algorithm, which solves the problems of low calculation efficiency, difficulty in balancing accuracy and speed, and insufficient dynamic adjustment capability existing in the traditional CORDIC algorithm.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions: A hybrid iterative accelerated computing method based on an improved CORDIC algorithm comprises the following steps: Set the acceptable error e; Substitute the error e into the calculation formula , where: i is the number of iterations, which is a positive integer; The minimum value of i is obtained based on the calculation formula and used as the switching threshold i for switching between single-step iteration and combined iteration. th ; Perform iterative operations until the calculation result required by the user is achieved, wherein: when the number of iterations i is less than the switching threshold i th When the number of iterations i is greater than or equal to the switching threshold i th When , a two-step or three-step merge iteration is adopted, wherein the compensation factor in the two-step merge iteration and the three-step merge iteration is set to 1.
[0008] The advantages of the present invention are: The present invention adopts a hybrid iterative strategy to obtain the switching threshold i based on the user-defined error e th , to reasonably determine the switching time between single-step iteration and merged iteration, and optimize the design of the compensation factor. That is, first use single-step iteration, then use merged iteration and ignore compensation. This approach reduces calculation delay while ensuring accuracy, improves calculation efficiency, and truly achieves a balance between speed and accuracy.
[0009] In the present invention, users can customize the error e according to the actual application scenario requirements and computing resource conditions to flexibly control the switching between single-step iteration and merge iteration, and reasonably select the two-step or three-step merge strategy according to their own needs. The high flexibility and dynamic adjustment capability enable the present invention to better adapt to various application scenarios and meet the needs of different users. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a schematic diagram of the implementation process of the present invention.
[0011] Figure 2 It is a software implementation diagram. DETAILED DESCRIPTION
[0012] like Figure 1 The present invention proposes a hybrid iterative accelerated computing method based on an improved CORDIC algorithm, comprising the following steps: According to the actual application scenario requirements and computing resources, set the acceptable error e, that is, the user-defined error e; Substitute the error e into the calculation formula , where: i is the number of iterations, which is a positive integer; Based on the calculation formula, the minimum value of i is obtained and used as the switching threshold i for switching between single-step iteration and combined iteration. th ; Perform iterative operations until the user's desired calculation result (target angle) is reached, where: when the number of iterations i is less than the switching threshold i th When the number of iterations i is greater than or equal to the switching threshold i th When , a two-step or three-step merge iteration is used, wherein the compensation factor in the two-step merge iteration and the three-step merge iteration is set to 1.
[0013] In other words, the hybrid iterative acceleration calculation method proposed in this invention divides the entire process into two stages: Phase I ), use single-step iteration to ensure high accuracy and avoid excessive errors; Phase II ), enable two-step or three-step merge iteration, and ignore the compensation of the compensation factor (that is, set the compensation factor = 1), which accelerates convergence by reducing the number of iterations and eliminating compensation. This design can simplify hardware design and reduce the consumption of multipliers and storage resources.
[0014] In actual implementation, users customize the error e according to the actual application scenario requirements and computing resources to calculate the switching threshold i for switching between single-step iteration and combined iteration. th In the present invention, the error e refers to the difference between the calculated result and the theoretical value. The smaller the error e, the closer it is to the target angle that the user wants to achieve.
[0015] In the present invention, if the error that the user can accept is set to e, the actual error must be less than , so we can get The relationship between the error and e: The following calculation formula is obtained from the above relationship: Therefore, based on the above calculation formula, the switching threshold i can be obtained th , thereby starting the iteration operation. When performing the iteration operation, it should be noted that the compensation factor used in the single-step iteration is calculated according to the compensation factor calculation method used in the single-step iteration of the traditional CORDIC algorithm. The compensation factor used in the two-step and three-step combined iterations should be set to 1.
[0016] For example: Assume that the error that the user can accept is 10 -6 , then we can get , then, determine the switching threshold i this 10. This approach ensures that merge iterations are only enabled within the tolerance range. Therefore, when the number of iterations i is less than 10, single-step iteration is used, and when i is greater than or equal to 10, two-step or three-step merge iteration is used.
[0017] In practical applications, two-step and three-step combined iterations can be flexibly selected according to the user's demand for computing speed.
[0018] In the present invention, single-step iteration is performed based on the following formula: Where, x i 、 y i are the horizontal and vertical coordinates, i represents the number of iterations, i is a positive integer, is the compensation factor for single-step iteration, , z i is the remaining angle of the rotation for the i-th iteration (which can be understood as the angle that has not been rotated in this iteration), The angle value of the rotation for the i-th iteration (needs to be stored in memory in hardware implementation), d i It is the judgment factor of the rotation direction, used to determine the direction of rotation: .
[0019] In the present invention, the two-step merge iteration is performed based on the following formula: Where, x i 、 y i are the horizontal and vertical coordinates, i represents the number of iterations, i is a positive integer, is the compensation factor for the two-step merge iteration, , z i is the remaining angle of the rotation for the i-th iteration (which can be understood as the angle that has not been rotated in this iteration), The angle value of the rotation for the i-th iteration (needs to be stored in memory in hardware implementation), d i It is the judgment factor of the rotation direction, used to determine the direction of rotation. a 2. b 2 is the double-step merge iteration parameter: ; .
[0020] In the present invention, the three-step merging iteration is performed based on the following formula: Where, x i 、 y i are the horizontal and vertical coordinates, i represents the number of iterations, i is a positive integer, is the compensation factor for the three-step merging iteration, , z i is the remaining angle of the rotation for the i-th iteration (which can be understood as the angle that has not been rotated in this iteration), The angle value of the rotation for the i-th iteration (needs to be stored in memory in hardware implementation), d i It is the judgment factor of the rotation direction, used to determine the direction of rotation. a 3. b 3 is the three-step merge iteration parameter: ; .
[0021] Figure 2 The process of implementing the method of the present invention in software programming is shown as follows: start the iterative operation, input the initial values x0, y0, z0, based on the switching threshold i th Judge the iteration stage: if the number of iterations i is less than the switching threshold i th , then it is a single-step iteration stage, so through the above single-step iteration formula (the compensation factor needs to be calculated ) is calculated; if the number of iterations i is greater than or equal to the switching threshold i th , then it is a two-step or three-step combined iteration stage. The two-step or three-step combined iteration is selected according to the user's own needs. Through the above corresponding two-step and three-step combined iteration formula (compensation factor 、 After the above steps are iterated, the calculation returns to the step of iterative judgment until the calculation result required by the user is achieved.
[0022] From the actual implementation process and results, it can be seen that, on the one hand, since the error e is set by the user, the accuracy requirement is met. On the other hand, the switching threshold i obtained by the present invention based on the error e is th The entire calculation process is effectively divided into two stages. The first stage uses single-step iteration to ensure high accuracy and avoid excessive errors. The second stage uses two-step or three-step combined iterations. At the same time, measures are taken to ignore the compensation factor. By reducing the number of iterations and eliminating the compensation, convergence is accelerated. On the basis of ensuring calculation accuracy, the calculation speed is maximized. Therefore, the present invention truly achieves a balance between accuracy and speed, and has excellent dynamic adjustment capabilities.
[0023] For example: If the user-defined error e is 10 -6 , then calculate and determine the switching threshold i th If the number of iterations is 10, then executing a single-step iteration nine times and selecting a three-step combined iteration twice can achieve a result close to the user's desired result. However, if the traditional CORDIC algorithm is used, 15 single-step iterations are required to achieve a result close to the user's desired result. This shows that the present invention can effectively meet the dual requirements of accuracy and speed.
[0024] The advantages of the present invention are: The present invention adopts a hybrid iterative strategy to obtain the switching threshold i based on the user-defined error e th , to reasonably determine the switching time between single-step iteration and merged iteration, and optimize the design of the compensation factor. That is, first use single-step iteration, then use merged iteration and ignore compensation. This approach reduces calculation delay while ensuring accuracy, improves calculation efficiency, and truly achieves a balance between speed and accuracy.
[0025] In the present invention, users can customize the error e according to the actual application scenario requirements and computing resource conditions to flexibly control the switching between single-step iteration and merge iteration, and reasonably select the two-step or three-step merge strategy according to their own needs. The high flexibility and dynamic adjustment capability enable the present invention to better adapt to various application scenarios and meet the needs of different users.
[0026] The above are preferred embodiments of the present invention and the technical principles used therein. For those skilled in the art, any obvious changes such as equivalent transformations, simple replacements, etc. based on the technical solution of the present invention, without departing from the spirit and scope of the present invention, are within the scope of protection of the present invention.
Claims
1. A hybrid iterative accelerated computing method based on an improved CORDIC algorithm, characterized in that: Including steps: Set the acceptable error e; Substitute the error e into the calculation formula , where: i is the number of iterations, which is a positive integer; The minimum value of i is obtained based on the calculation formula and used as the switching threshold i for switching between single-step iteration and combined iteration. th ; Perform iterative operations until the calculation result required by the user is achieved, wherein: when the number of iterations i is less than the switching threshold i th When the number of iterations i is greater than or equal to the switching threshold i th When , a two-step or three-step merge iteration is adopted, wherein the compensation factor in the two-step merge iteration and the three-step merge iteration is set to 1.
2. The hybrid iterative accelerated computing method based on the improved CORDIC algorithm according to claim 1, characterized in that: The single-step iteration is performed based on the following formula: Where, x i 、 y i are the horizontal and vertical coordinates, i represents the number of iterations, i is a positive integer, is the compensation factor for single-step iteration, , z i is the remaining angle of rotation for the i-th iteration, is the rotation angle value of the i-th iteration, d i The factor for determining the direction of rotation: 。 3. The hybrid iterative accelerated computing method based on the improved CORDIC algorithm according to claim 1, characterized in that: The two-step merge iteration is performed based on the following formula: Where, x i 、 y i are the horizontal and vertical coordinates, i represents the number of iterations, i is a positive integer, is the compensation factor for the two-step merge iteration, , z i is the remaining angle of rotation for the i-th iteration, is the rotation angle value of the i-th iteration, d i is the factor for determining the direction of rotation, a 2. b 2 is the double-step merge iteration parameter: ; 。 4. The hybrid iterative accelerated computing method based on the improved CORDIC algorithm according to claim 1, characterized in that: The three-step merging iteration is performed based on the following formula: Where, x i 、 y i are the horizontal and vertical coordinates, i represents the number of iterations, i is a positive integer, is the compensation factor for the three-step merging iteration, , z i is the remaining angle of rotation for the i-th iteration, is the rotation angle value of the i-th iteration, d i is the factor for determining the direction of rotation, a 3. b 3 is the three-step merge iteration parameter: ; 。