CN109814836A - A kind of trigonometric function calculation method and device based on interval division and CORDIC - Google Patents
A kind of trigonometric function calculation method and device based on interval division and CORDIC Download PDFInfo
- Publication number
- CN109814836A CN109814836A CN201811623843.1A CN201811623843A CN109814836A CN 109814836 A CN109814836 A CN 109814836A CN 201811623843 A CN201811623843 A CN 201811623843A CN 109814836 A CN109814836 A CN 109814836A
- Authority
- CN
- China
- Prior art keywords
- angle
- section
- trigonometric function
- mapping
- obtains
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Complex Calculations (AREA)
Abstract
The invention discloses a kind of trigonometric function calculation method and device based on interval division and CORDIC, the method includes period section (0,2 π) is carried out eight equal parts;Section (0, π/4) are carried out 2kEqual part, and obtain the initial angle of each angular interval;The trigonometric function value of each section start angle is calculated, and is stored;Angle to be solved is received, by the angle map to period section (0,2 π), obtains the first mapping angle;First mapping angle is mapped to section (0, π/4), obtains the second mapping angle;Angular interval belonging to judging second mapping angle in section (0, π/4);According to the start angle of the angular interval, since kth time iteration, trigonometric function is executed based on CODIC algorithm and is calculated;Based on calculated result, amendment obtains the trigonometric function value of the angle to be solved.Present invention incorporates loop up table and CORDIC iterative calculation method, can improve computational efficiency while reducing the number of iterations, save computing resource.
Description
Technical field
The disclosure belongs to digital signal processing technique field more particularly to a kind of triangle based on interval division and CORDIC
Function calculation method and device.
Background technique
The digital signal of frequency needed for traditional arbitrary waveform generator is generated using Direct Digital Frequency Synthesizer Technology (DDS), DDS
There are two ways to digital waveform is generated in module, one is the methods using look-up table to generate the corresponding amplitude of out of phase,
One is the amplitudes that the phase is directly calculated according to current phase.It is needed in advance using the method for look-up table by a large amount of Wave datas
It is stored, when needing the data of a certain phase, the waveform of storage is addressed to search respective amplitude, what this method needed
Memory headroom is very big, and the ROM of large capacity the drawbacks of there are high power consumption, Gao Chengben, low reliabilities, and due to the truncation of accumulator
Error brings biggish phase error.And use and calculate the corresponding amplitude of certain phase in real time, it can avoid LUT Method bring
Drawback, wherein cordic algorithm commonly uses calculation method for it.
Cordic algorithm is proposed by J.Volder earliest, and rudimentary algorithm is revolved by continuous coordinate transform or angle
Turn to the advantage is that angle calculated constantly close to angle to be solved, which only needs simply to shift, add, subtract
The calculating of the higher-order functions such as trigonometric function can be realized in operation, and the algorithm is easy to execute using pipeline organization.The subsequent calculation
Method is more widely used, including QR decomposition, FFT transform, DCT/IDCT transformation, plane coordinates and polar conversion,
DDS etc..It is applied in DDS technology from cordic algorithm, digital waveform generation technique is got rid of needs excessive ROM Space in the past
And caused by the truncation error of address procedures it is spuious the disadvantages of, pipeline organization using FPGA it is easy to accomplish, relative to biography
System DDS has saved vast resources.The range value for calculating a certain phase in real time using cordic algorithm, to each phase being addressed to
An amplitude is calculated, without storing a large amount of Wave datas, does not also need that Wave data truncation is truncated,
But traditional algorithm still has deficiency, as angular coverage is limited, loop iteration number is too long, computational accuracy compared with
It is low, cause computational efficiency to decline, to increasingly be unable to satisfy the double requirements of speed and precision.Traditional CORDIC is calculated
Method, angle calculation range need the calculating of other angles range to carry out angular transition within the scope of -98 ° to 98 °;It calculates
Speed depends on the number of iterations, and the number of iterations is more, and as a result more accurate, each iterative process terminates in preceding iteration
Afterwards, current iteration is carried out using last result, therefore the number of iterations limits calculating speed to a certain extent.Therefore certainly
Since the algorithm proposes, much also occur in succession to the improvement project of this method.
Its algorithm structure is improved to pipeline iterative structure from loop iteration structure first, so that iterative process difference every time
It executes, no longer progress loop control, iteration at different levels can be worked at the same time in a cycle, and system working efficiency is improved.Secondly,
Since the requirement to precision is higher, the number of iterations needed is necessarily increased, and the realization structure of hardware is also more complicated, to make entire
The speed of iterative process reduces, and solves the problems, such as this, people analyze from algorithm, improve.2005
Maharatna proposes the SF cordic algorithm of no scalar gain, each step of the algorithm based on the first approximation theorem of sine series
Loop iteration be corresponded to by initial rotation angle the position complement of two's two's complement control, and be no longer by angle-data path sign bit into
Row control, so that no data relies between different loop iterations, although SF cordic algorithm eliminates scaling compensation logic and angle
Data path is spent, but there are still loop iteration number is excessive and the deficiencies such as computational accuracy is low.Adaptive coding ARC algorithm exists
The number of iterations is shortened using self-adaptive encoding method on the basis of SF cordic algorithm.ARC algorithm reduces answering for hardware configuration
Miscellaneous degree, but flowing water station level number is not improved.In order to further decrease ARC algorithm pipeline series, occur improving
Adaptive coding EARC algorithm.Different innovatory algorithm purposes are optimized in hardware configuration or iterative manner to improve and calculate
Speed and precision knows cordic algorithm from (N-log from mathematical proof23)/3+1 later each iteration direction can be with
Look-ahead, therefore, operation later are not required to iteration, and only carry out the operations such as displacement plus-minus.
When the existing improvement to cordic algorithm includes to n times iterative operation, (N-log23)/3+1 iteration is later
Precomputation is realized in operation, i.e., is realized by certain coding mode from (N-log23) parallel output of/3+1 to N grades, will
Multi-stage iteration merges into an iteration, and from 1 to (N-log2/ 3 grade 3) there is still a need for solved step by step by interative computation calculating.
Summary of the invention
To overcome above-mentioned the deficiencies in the prior art, present disclose provides a kind of triangle letter based on interval division and CORDIC
Number calculating method and device, the method combine on the basis of existing method with loop up table, by existing solution interval
It is divided into 2kEqual portions, and the trigonometric function value of each section initial angle is stored.By angle map, by any angle
Range is mapped to (0, π/4) section, and is modified to mapping angle using two groups of matrixes, obtains practical trigonometric function to be asked
Value.The method can reduce existing cordic algorithm the number of iterations k times, improve operation efficiency, save calculation resources.
To achieve the above object, one or more other embodiments of the present disclosure provide following technical solution:
A kind of trigonometric function calculation method based on interval division and CORDIC,
Period section (0,2 π) is subjected to eight equal parts;Section (0, π/4) are carried out 2kEqual part, and obtain each angular interval
Initial angle;The trigonometric function value of each section start angle is calculated, and is stored;The calculation method includes:
Angle to be solved is received, by the angle map to period section (0,2 π), obtains the first mapping angle;
First mapping angle is mapped to section (0, π/4), obtains the second mapping angle;
Angular interval belonging to judging second mapping angle in section (0, π/4);
According to the start angle of the angular interval, since kth time iteration, trigonometric function is executed based on CODIC algorithm
It calculates;
Based on calculated result, amendment obtains the trigonometric function value of the angle to be solved.
Further, the first mapping angle calculation method are as follows: θMOD1=mod (θ, 2 π), wherein θ indicates to be solved
Angle, mod () indicate complementation.
Further, the second mapping angle calculation method are as follows: θMOD2=mod (θMOD1,π/4)。
Further, described that the rotation side that trigonometric function calculating includes: each iteration of precomputation is executed based on CODIC algorithm
To merging into primary calculating.
Further, described to be based on calculated result, the trigonometric function value that amendment obtains the angle to be solved includes:
When calculating the second mapping angle, the quotient θ of the first mapping angle Yu π/4 is also calculatedceil;
According to θceilValue, the calculated result of section (0, π/4) is expanded to (0,2 π), the angle to be solved is obtained
Trigonometric function value.
Further, described according to θceilValue, the calculated result of section (0, π/4) expanded to (0,2 π) include:
SIN function and cosine function is stored in advance to expand from the calculated result of section (0, π/4) to the conversion square of (0,2 π)
Battle array A and B and transition matrix and θceilCorresponding relationship;
According to θceilValue search corresponding transition matrix, three based on angle to be solved described in the transform matrix calculations
Angle function value.
Further, the trigonometric function value based on angle to be solved described in the transform matrix calculations includes:
Cos θ=[cos θMOD2,sinθMOD2]×A
Wherein, θ indicates angle to be solved, and A and B are 2 × 1 transition matrix.
One or more embodiments provide a kind of computing device, including memory and processor, institute on the memory
It states memory to be stored in advance: section (0, π/4) 2kThe trigonometric function value for each angular interval initial angle that equal part obtains, and
The computer program that can be run on a processor, the processor are realized when executing described program:
Angle to be solved is received, by the angle map to period section (0,2 π), obtains the first mapping angle;
First mapping angle is mapped to section (0, π/4), obtains the second mapping angle;
Angular interval belonging to judging second mapping angle in section (0, π/4);
According to the start angle of the angular interval, since kth time iteration, trigonometric function is executed based on CODIC algorithm
It calculates;
Based on calculated result, amendment obtains the trigonometric function value of the angle to be solved.
Further, the memory is also stored in advance for expanding the calculated result of section (0, π/4) to (0,2 π)
Transition matrix.
One or more embodiments provide a kind of computer readable storage medium, are stored thereon with section (0, π/4) 2k
The trigonometric function value and computer program for each angular interval initial angle that equal part obtains, the program are executed by processor
Shi Zhihang following steps:
Angle to be solved is received, by the angle map to period section (0,2 π), obtains the first mapping angle;
First mapping angle is mapped to section (0, π/4), obtains the second mapping angle;
Angular interval belonging to judging second mapping angle in section (0, π/4);
According to the start angle of the angular interval, since kth time iteration, trigonometric function is executed based on CODIC algorithm
It calculates;
Based on calculated result, amendment obtains the trigonometric function value of the angle to be solved.
The above one or more technical solution there are following the utility model has the advantages that
The present invention uses interval division preconditioning technique, on the one hand, according to the periodicity of trigonometric function, symmetry and mutually remaining
Property any angle is mapped to (0, π/4) section, and finally result is modified calculating, obtain reality of the angle just more than
String value;It on the one hand is 2 by (0, π/4) interval divisionkEqual portions utilize the triangle of a small amount of each section initial angle of memory storage
Function data is iterated calculating according still further to existing cordic algorithm later.Therefore the present invention is relative to existing CORDIC technology,
By pre-processing preceding k iteration, reduce the number of iterations k times.
In summary, present invention incorporates DDS digital waveform before generate in loop up table and CORDIC iterative calculation
Method is led to the angular interval that too small amount of lookup table addressing divides, then is lacked by existing cordic algorithm to the section
Number iterative calculation can solve the trigonometric function of arbitrary angle, and this method improves meter while reducing the number of iterations
Efficiency is calculated, while if utilizing hardware realization, it may also reduce the complexity of system saves raw material and energy consumption.
Detailed description of the invention
The Figure of description for constituting a part of this disclosure is used to provide further understanding of the present application, and the application's shows
Meaning property embodiment and its explanation are not constituted an undue limitation on the present application for explaining the application.
Fig. 1 is that the vector angle in traditional cordic algorithm rotates schematic diagram;
Fig. 2 is the relational graph of calculation times and max calculation angle in traditional cordic algorithm;
Fig. 3 is the flow chart of trigonometric function calculation method of the embodiment of the present disclosure one based on interval division and CORDIC;
Fig. 4 is that the process of trigonometric function calculation method of the embodiment of the present disclosure one based on interval division and CORDIC is illustrated
Figure;
Fig. 5 is the example using one method of the embodiment of the present disclosure: the trigonometric function for solving 30 ° of angles (does not carry out section to draw
Point);
Fig. 6 is the example using one method of the embodiment of the present disclosure: solving the trigonometric function (interval division 2 at 30 ° of angles5It is secondary);
Fig. 7 is the example using one method of the embodiment of the present disclosure: solving the trigonometric function (segmentation 2 of 8 angles5It is secondary);
Fig. 8 is the example using one method of the embodiment of the present disclosure: solving the trigonometric function (segmentation 2 of 8 angles8It is secondary).
Specific embodiment
It is noted that described further below be all exemplary, it is intended to provide further instruction to the application.Unless another
It indicates, all technical and scientific terms used herein has usual with the application person of an ordinary skill in the technical field
The identical meanings of understanding.
It should be noted that term used herein above is merely to describe specific embodiment, and be not intended to restricted root
According to the illustrative embodiments of the application.As used herein, unless the context clearly indicates otherwise, otherwise singular
Also it is intended to include plural form, additionally, it should be understood that, when in the present specification using term "comprising" and/or " packet
Include " when, indicate existing characteristics, step, operation, device, component and/or their combination.
In the absence of conflict, the features in the embodiments and the embodiments of the present application can be combined with each other.
The basic ideas of traditional cordic algorithm are:
According to the changes in coordinates relationship of rotation front and back in rotating coordinate system, it is iterated operation, the angle rotated every time is
tan-12-(k-1), wherein k is the number of rotation, and k is 0 to N;
The positive and negative of remaining angle is judged after rotation every time, continues rotation counterclockwise if it is canonical, it is suitable if being negative
Hour hands rotation.Until the sine and cosine value approximation to sufficiently high precision by required angle.
As shown in Figure 1, vector (x0, y0) rotates to vector (x1, y1), two vectorial coordinates and the relationship of rotation angle can lead to
Following relational expressions are crossed to be described:
Solving sin θ or cos θ can be solved by by vector (1,0) rotation to (x1, y1) by solving x1 and y1
Two trigonometric functions.And two trigonometric functions do not have to directly calculate in practical solution procedure, but by rotating tan every time-12-(k-1)Greatly
Small angle iteration realization, i.e.,
It defines angle to be positive counterclockwise, be negative clockwise, solve the trigonometric function value that angle is θ, then the pass of kth time rotation
It is that formula is
zk=zk-1-dkarctan[2-(k-1)]
Wherein d_k is 1 or -1, positive and negative to depend on kth -1 time postrotational residue angle z_ (k-1), i.e.,
dk=sign (zk-1)
The primary condition of iteration is x0=A, y0=0, i.e. initial vector is (A, 0), and initial vector guarantees in x-axis here
On, the angular range of trigonometric function to be solved-between pi/2 and pi/2.Following table is to be asked by traditional CORDIC Rotation Algorithm
The angular range of solution, it is known that this method cannot achieve angle in all standing of four quadrants, and each iteration is in last iteration
After just start iteration, efficiency is lower.
1 the number of iterations of table and the relationship that maximum angle can be calculated
Embodiment one
The trigonometric function calculation method based on interval division and CORDIC that present embodiment discloses a kind of, as shown in Figure 3-4,
The following steps are included:
Step 1: input any angle θ maps that section (0,2 π) according to the periodicity of trigonometric function;
Specific practice is that angle is taken its remainder, i.e. θ divided by 2 πMOD1=mod (θ, 2 π);
Step 2: a cycle section being carried out by 8 equal parts according to the symmetry of trigonometric function, and by θMOD1It is mapped to section
(0, π/4);
Concrete operations are, by θMOD1Divided by π/4, quotient θ is obtainedceil=ceil (θMOD1, π/4) and remainder θMOD2=MOD
(θMOD1,π/4);
Step 3: section (0, π/4) are divided into 2kPart, the angular range in each section isEach section
Start angle is
Step 4: because the angle of each iterative cycles is tan-12-n, therefore pass through the rotation angle of each iteration known to table 2
Degree.Assuming that number of iterations N=16, then according to table 3, the relationship between initial iteration number k and computable angular range, i.e., from
Kth time iteration starts to carry out the computable angular range of CORDIC operation, and when k is bigger, computable angular range is smaller, and counts
It calculates precision to be limited by total the number of iterations N, N is constant, and then precision is constant.Table 4 indicates section (0, π/4) being divided into 2kAfter part,
Every part of angular range.By table 3 and table 4 it is found that iterative calculation can be iterated i.e. since k+1 times when k parts of interval division
Can, and preceding k iteration can reach expected computational accuracy without executing.
The relationship of 2 the number of iterations of table and current iteration rotation angle
n | 0 | 1 | 2 | 3 | 4 |
atan2^-n | 45 | 26.56505 | 14.03624 | 7.125016 | 3.576334 |
n | 5 | 6 | 7 | 8 | 9 |
atan2^-n | 1.789911 | 0.895174 | 0.447614 | 0.223811 | 0.111906 |
n | 10 | 11 | 12 | 13 | 14 |
atan2^-n | 0.055953 | 0.027976 | 0.013988 | 0.006994 | 0.003497 |
n | 15 | 16 | 17 | 18 | 19 |
atan2^-n | 0.001749 | 0.000874 | 0.000437 | 0.000219 | 0.000109 |
3 initial iteration number k of table and angular range can be calculated
Initial iteration number k | 0 | 1 | 2 | 3 | 4 | 5 |
Can calculate angular range/° | 99.88209 | 54.88209 | 28.31704 | 14.2808 | 7.155781 | 3.579446 |
Initial iteration number k | 6 | 7 | 8 | 9 | 10 | 11 |
Can calculate angular range/° | 1.789536 | 0.894362 | 0.446748 | 0.222937 | 0.111032 | 0.055079 |
Initial iteration number k | 12 | 13 | 14 | 15 | ||
Can calculate angular range/° | 0.027102 | 0.013114 | 0.00612 | 0.002623 |
The relationship of table 4 angular divisions section number and angular range
Demarcation interval number 2^k | K=4 | K=5 | K=6 | K=7 | K=8 |
Angular range/° | 2.8125 | 1.4063 | 0.7031 | 0.3516 | 0.1758 |
Step 5: calculating the trigonometric function value of each angular interval start angle in advance, and stored;
Step 6: angle place to be solved section after judgement initialization;
Step 7: according to the start angle in the section since kth time iteration CODIC algorithm or each iteration of precomputation
Direction of rotation, last iteration is merged into primary calculating.
Step 8: obtained calculated result being modified, i.e., according to θceilValue, to the calculating knot of section (0, π/4)
Fruit is expanded to (0,2 π).Concrete operations are as follows:
Cos θ=[cos θMOD2,sinθMOD2]×A
The wherein matrix that A and B is 2 × 1, while the matrix and θceilIt is related, the relationship of value such as table 5
5 θ of tableceilValue and correction matrix relationship
Matlab simulating, verifying:
The conditional curve of Fig. 2 and Fig. 3 each loop iteration when being to calculate 30 ° of angles respectively, Fig. 2 are indicated not to section
(0, π/4) it divides, the number of iterations is shown as 16 times.By interval division 2 in Fig. 35It is secondary, it is then iterated, the number of iterations 11 times,
And computational accuracy is constant.
Fig. 4 and Fig. 5 calculates separately 30 °, 88 °, 131 °, 175 °, 210 °, -75 °, -100 °, -20 ° eight different zones
It is as shown in the figure to calculate iterative process, in the case where k=5, iterates to n=16 from n=6, totally ten times, and computational accuracy is repeatedly
16 situations of generation.In k=8, from iteration totally eight times from n=9 to n=16, and the feelings that computational accuracy is iteration 16 times
Condition.
Above-mentioned MATLAB simulation result it will be evident that influence of the interval division number to the number of iterations, meanwhile, to calculating
Precision will not have an impact.Likewise, if carrying out the iteration of same number using method of the invention and existing method,
Computational accuracy of the invention is higher than existing method, and precision is related with the number of interval division.
Embodiment two
The purpose of the present embodiment is to provide a kind of computing device.
A kind of computing device, including memory and processor,
The memory is stored in advance on the memory: section (0, π/4) 2kAt the beginning of each angular interval that equal part obtains
The trigonometric function value of beginning angle, and the computer program that can be run on a processor, when the processor executes described program
It realizes:
Angle to be solved is received, by the angle map to period section (0,2 π), obtains the first mapping angle;
First mapping angle is mapped to section (0, π/4), obtains the second mapping angle;
Angular interval belonging to judging second mapping angle in section (0, π/4);
According to the start angle of the angular interval, since kth time iteration, trigonometric function is executed based on CODIC algorithm
It calculates;
Based on calculated result, amendment obtains the trigonometric function value of the angle to be solved.
Further, the memory is also stored in advance for expanding the calculated result of section (0, π/4) to (0,2 π)
Transition matrix.
Embodiment three
The purpose of the present embodiment is to provide a kind of computer readable storage medium.
A kind of computer readable storage medium is stored thereon with section (0, π/4) 2kEach angular interval that equal part obtains
The trigonometric function value and computer program of initial angle, the program execute following steps when being executed by processor:
Angle to be solved is received, by the angle map to period section (0,2 π), obtains the first mapping angle;
First mapping angle is mapped to section (0, π/4), obtains the second mapping angle;
Angular interval belonging to judging second mapping angle in section (0, π/4);
According to the start angle of the angular interval, since kth time iteration, trigonometric function is executed based on CODIC algorithm
It calculates;
Based on calculated result, amendment obtains the trigonometric function value of the angle to be solved.
Further, the storage medium is also stored in advance for expanding the calculated result of section (0, π/4) to (0,2
Transition matrix π).
Each step involved in upper embodiment two and three is corresponding with embodiment of the method one, and specific embodiment can be found in reality
Apply the related description part of example one.Term " computer readable storage medium " is construed as including one or more instruction set
Single medium or multiple media;It should also be understood as including any medium, any medium can be stored, encodes or be carried
Instruction set for being executed by processor simultaneously makes processor either execute in the disclosure method.
The above one or more embodiment has following technical effect that
The present invention uses interval division preconditioning technique, on the one hand, according to the periodicity of trigonometric function, symmetry and mutually remaining
Property any angle is mapped to (0, π/4) section, and finally result is modified calculating, obtain reality of the angle just more than
String value;It on the one hand is 2 by (0, π/4) interval divisionkEqual portions utilize the triangle of a small amount of each section initial angle of memory storage
Function data is iterated calculating according still further to existing cordic algorithm later.Therefore the present invention is relative to existing CORDIC technology,
By pre-processing preceding k iteration, reduce the number of iterations k times.
In summary, present invention incorporates DDS digital waveform before generate in loop up table and CORDIC iterative calculation
Method is led to the angular interval that too small amount of lookup table addressing divides, then is lacked by existing cordic algorithm to the section
Number iterative calculation can solve the trigonometric function of arbitrary angle, this method while reducing the number of iterations, improve
Computational efficiency, while if utilizing hardware realization, it may also reduce the complexity of system saves raw material and energy consumption.
It will be understood by those skilled in the art that each module or each step of above-mentioned the application can be filled with general computer
It sets to realize, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored
Be performed by computing device in the storage device, perhaps they are fabricated to each integrated circuit modules or by they
In multiple modules or step be fabricated to single integrated circuit module to realize.The application be not limited to any specific hardware and
The combination of software.
The foregoing is merely preferred embodiment of the present application, are not intended to limit this application, for the skill of this field
For art personnel, various changes and changes are possible in this application.Within the spirit and principles of this application, made any to repair
Change, equivalent replacement, improvement etc., should be included within the scope of protection of this application.
Although above-mentioned be described in conjunction with specific embodiment of the attached drawing to the application, model not is protected to the application
The limitation enclosed, those skilled in the art should understand that, on the basis of the technical solution of the application, those skilled in the art are not
Need to make the creative labor the various modifications or changes that can be made still within the protection scope of the application.
Claims (10)
1. a kind of trigonometric function calculation method based on interval division and CORDIC, which is characterized in that
Period section (0,2 π) is subjected to eight equal parts;Section (0, π/4) are carried out 2kEqual part, and obtain the first of each angular interval
Beginning angle;The trigonometric function value of each section start angle is calculated, and is stored;The calculation method includes:
Angle to be solved is received, by the angle map to period section (0,2 π), obtains the first mapping angle;
First mapping angle is mapped to section (0, π/4), obtains the second mapping angle;
Angular interval belonging to judging second mapping angle in section (0, π/4);
According to the start angle of the angular interval, since kth time iteration, trigonometric function is executed based on CODIC algorithm and is calculated;
Based on calculated result, amendment obtains the trigonometric function value of the angle to be solved.
2. a kind of trigonometric function calculation method based on interval division and CORDIC as described in claim 1, which is characterized in that
The first mapping angle calculation method are as follows: θMOD1=mod (θ, 2 π), wherein θ indicates angle to be solved, and mod () expression takes
Remaining operation.
3. a kind of trigonometric function calculation method based on interval division and CORDIC as claimed in claim 2, which is characterized in that
The second mapping angle calculation method are as follows: θMOD2=mod (θMOD1,π/4)。
4. a kind of trigonometric function calculation method based on interval division and CORDIC as described in claim 1, which is characterized in that
It is described that the direction of rotation that trigonometric function calculating includes: each iteration of precomputation is executed based on CODIC algorithm, merge into primary meter
It calculates.
5. a kind of trigonometric function calculation method based on interval division and CORDIC as described in claim 1, which is characterized in that
Described to be based on calculated result, the trigonometric function value that amendment obtains the angle to be solved includes:
When calculating the second mapping angle, the quotient θ of the first mapping angle Yu π/4 is also calculatedceil;
According to θceilValue, the calculated result of section (0, π/4) is expanded to (0,2 π), the three of the angle to be solved are obtained
Angle function value.
6. a kind of trigonometric function calculation method based on interval division and CORDIC as claimed in claim 5, which is characterized in that
It is described according to θceilValue, the calculated result of section (0, π/4) expanded to (0,2 π) include:
SIN function and cosine function is stored in advance to expand from the calculated result of section (0, π/4) to the transition matrix A of (0,2 π)
And B and transition matrix and θceilCorresponding relationship;
According to θceilValue search corresponding transition matrix, the triangle letter based on angle to be solved described in the transform matrix calculations
Numerical value.
7. a kind of trigonometric function calculation method based on interval division and CORDIC as claimed in claim 6, which is characterized in that
Trigonometric function value based on angle to be solved described in the transform matrix calculations includes:
Cos θ=[cos θMOD2,sinθMOD2]×A
Wherein, θ indicates angle to be solved, and A and B are 2 × 1 transition matrix.
8. a kind of computing device, including memory and processor, which is characterized in that the memory is deposited in advance on the memory
Storage: section (0, π/4) 2kThe trigonometric function value for each angular interval initial angle that equal part obtains, and can transport on a processor
Capable computer program, the processor are realized when executing described program:
Angle to be solved is received, by the angle map to period section (0,2 π), obtains the first mapping angle;
First mapping angle is mapped to section (0, π/4), obtains the second mapping angle;
Angular interval belonging to judging second mapping angle in section (0, π/4);
According to the start angle of the angular interval, since kth time iteration, trigonometric function is executed based on CODIC algorithm and is calculated;
Based on calculated result, amendment obtains the trigonometric function value of the angle to be solved.
9. a kind of computing device as described in claim 1, which is characterized in that the memory is also stored in advance for by section
The calculated result of (0, π/4) is expanded to the transition matrix of (0,2 π).
10. a kind of computer readable storage medium, which is characterized in that be stored thereon with section (0, π/4) 2kEqual part each of obtains
The trigonometric function value and computer program of angular interval initial angle, the program execute following steps when being executed by processor:
Angle to be solved is received, by the angle map to period section (0,2 π), obtains the first mapping angle;
First mapping angle is mapped to section (0, π/4), obtains the second mapping angle;
Angular interval belonging to judging second mapping angle in section (0, π/4);
According to the start angle of the angular interval, since kth time iteration, trigonometric function is executed based on CODIC algorithm and is calculated;
Based on calculated result, amendment obtains the trigonometric function value of the angle to be solved.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811623843.1A CN109814836A (en) | 2018-12-28 | 2018-12-28 | A kind of trigonometric function calculation method and device based on interval division and CORDIC |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811623843.1A CN109814836A (en) | 2018-12-28 | 2018-12-28 | A kind of trigonometric function calculation method and device based on interval division and CORDIC |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109814836A true CN109814836A (en) | 2019-05-28 |
Family
ID=66601848
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811623843.1A Pending CN109814836A (en) | 2018-12-28 | 2018-12-28 | A kind of trigonometric function calculation method and device based on interval division and CORDIC |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109814836A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111580784A (en) * | 2020-04-10 | 2020-08-25 | 科大讯飞股份有限公司 | Power function calculation device and power function calculation method |
CN111949934A (en) * | 2020-08-20 | 2020-11-17 | 桂林电子科技大学 | CORDIC optimization method based on FPGA |
CN111984226A (en) * | 2020-08-26 | 2020-11-24 | 南京大学 | Cube root solving device and solving method based on hyperbolic CORDIC |
CN112836170A (en) * | 2019-11-22 | 2021-05-25 | 航天信息股份有限公司 | Data coordinate conversion method and device |
CN114707110A (en) * | 2022-06-07 | 2022-07-05 | 中科亿海微电子科技(苏州)有限公司 | Trigonometric function and hyperbolic function extended instruction computing device and processor core |
CN117348685A (en) * | 2023-10-25 | 2024-01-05 | 灿芯半导体(成都)有限公司 | Signal processing method of high-precision DDS generator |
-
2018
- 2018-12-28 CN CN201811623843.1A patent/CN109814836A/en active Pending
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112836170A (en) * | 2019-11-22 | 2021-05-25 | 航天信息股份有限公司 | Data coordinate conversion method and device |
CN112836170B (en) * | 2019-11-22 | 2023-10-31 | 航天信息股份有限公司 | Data coordinate conversion method and device |
CN111580784A (en) * | 2020-04-10 | 2020-08-25 | 科大讯飞股份有限公司 | Power function calculation device and power function calculation method |
CN111580784B (en) * | 2020-04-10 | 2023-07-25 | 科大讯飞股份有限公司 | Power function calculation device and power function calculation method |
CN111949934A (en) * | 2020-08-20 | 2020-11-17 | 桂林电子科技大学 | CORDIC optimization method based on FPGA |
CN111984226A (en) * | 2020-08-26 | 2020-11-24 | 南京大学 | Cube root solving device and solving method based on hyperbolic CORDIC |
CN111984226B (en) * | 2020-08-26 | 2024-02-09 | 南京大学 | Cube root solving device and solving method based on hyperbolic CORDIC |
CN114707110A (en) * | 2022-06-07 | 2022-07-05 | 中科亿海微电子科技(苏州)有限公司 | Trigonometric function and hyperbolic function extended instruction computing device and processor core |
CN117348685A (en) * | 2023-10-25 | 2024-01-05 | 灿芯半导体(成都)有限公司 | Signal processing method of high-precision DDS generator |
CN117348685B (en) * | 2023-10-25 | 2024-05-10 | 灿芯半导体(成都)有限公司 | Signal processing method of DDS generator |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109814836A (en) | A kind of trigonometric function calculation method and device based on interval division and CORDIC | |
CN106888088B (en) | Elliptic curve cipher Fast implementation and its device | |
CN101109973A (en) | Waveform generator based on direct numerical frequency synthesizer | |
CN110781446A (en) | Method for rapidly calculating average vorticity deviation of ocean mesoscale vortex Lagrange | |
CN102750669B (en) | Image rotation processing method | |
CN106027045B (en) | Based on the Direct Digital Frequency Synthesizers for improving cordic algorithm | |
CN110796246A (en) | Hardware implementation circuit and method of activation function based on linear segmentation | |
CN102129419B (en) | Based on the processor of fast fourier transform | |
Rekha et al. | FPGA implementation of exponential function using cordic IP core for extended input range | |
CN109284528A (en) | Phase array antenna beam control code calculation method and system based on the pipeline design | |
CN113342310A (en) | Serial parameter configurable fast number theory transformation hardware accelerator applied to lattice password | |
CN105553913A (en) | SCMA (sparse code multiple access) codebook searching method based on maximized minimum product distance criterion | |
CN108508426B (en) | SAR echo signal generation method based on multi-core DSP and echo simulator | |
CN108008665B (en) | Large-scale circular array real-time beam former based on single-chip FPGA and beam forming calculation method | |
CN103699518A (en) | Approximate calculation method for triangle functions | |
CN104753530B (en) | Phase only pupil filter and non-homogeneous phase width conversion method and device in DDS | |
Shende et al. | New migratory memory algorithm for implicit finite volume solvers | |
Li et al. | CORDIC based algorithm for frequency offset estimation | |
CN106708469B (en) | A kind of radar simulation signal acquiring method based on cordic algorithm | |
CN105866483A (en) | Implementation method for generating sine wave signals through DSP controller | |
CN108319804B (en) | 8192 point base 2 DIT ASIC design method for low resource call | |
CN108416311A (en) | A kind of azimuth acquisition methods based on programmable gate array and coordinate rotation processing | |
CN104636632B (en) | The small amount of storage computation of table lookup method of high-precision phase position | |
Huang et al. | FPGA Implementation of a Novel Type DDS Based on CORDIC Algorithm | |
Mohanty et al. | Design and Implementation of High Frequency Functional Signal Generator using DDFS based on 16-stage pipelined CORDIC architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190528 |