WO2018040726A1 - 一种获取角度相关值的方法、装置及计算机存储介质 - Google Patents

一种获取角度相关值的方法、装置及计算机存储介质 Download PDF

Info

Publication number
WO2018040726A1
WO2018040726A1 PCT/CN2017/091463 CN2017091463W WO2018040726A1 WO 2018040726 A1 WO2018040726 A1 WO 2018040726A1 CN 2017091463 W CN2017091463 W CN 2017091463W WO 2018040726 A1 WO2018040726 A1 WO 2018040726A1
Authority
WO
WIPO (PCT)
Prior art keywords
angle
addressing
trigonometric function
function value
query
Prior art date
Application number
PCT/CN2017/091463
Other languages
English (en)
French (fr)
Inventor
刘振军
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2018040726A1 publication Critical patent/WO2018040726A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/544Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices for evaluating functions by calculation
    • G06F7/548Trigonometric functions; Co-ordinate transformations

Definitions

  • the present application relates to the field of information processing, and in particular, to a method, an apparatus, and a computer storage medium for acquiring an angle related value.
  • the value of the trigonometric function for calculating the angle in a system-on-chip (SoC) system generally adopts three methods:
  • the software is used to calculate the value of the trigonometric function; using this method consumes a long CPU (Central Processing Unit) time, increases the CPU load, and reduces the computational efficiency of the system; For systems that require high control accuracy, this makes the CPU difficult to respond to other things, and generally trigonometric functions are frequently calculated.
  • CPU Central Processing Unit
  • the coordinate rotation digital calculation (Cordic) algorithm requires loop iteration, whether using software or hardware to achieve, it takes a long calculation time; Cordic algorithm to calculate the trigonometric function, you want to improve the calculation accuracy, you need Increasing the number of iterations increases the computation time, and the Cordic algorithm itself is very inaccurate for small angle calculations and has certain limitations.
  • the trigonometric function is calculated by constructing an analog circuit; after the calculation of the analog circuit portion is completed by using this method, the data is transmitted to the digital portion through the analog-to-digital conversion circuit; the analog circuit
  • the accuracy of the operation is not easy to guarantee, the conversion between analog and digital will also lose a certain precision, and will increase the circuit, increase the SoC area, and increase the power consumption; and this method is for the analog designer.
  • the technical requirements are relatively high. It is necessary to master the analog circuit design and master the mathematical modeling. The design is difficult.
  • the present application is expected to provide a method, a device and a computer storage medium for acquiring an angle correlation value, which can reduce the amount of processor operations, shorten the calculation time, and quickly determine the trigonometric function value of the angle to meet different application environments.
  • the present application provides a method for obtaining an angle-related value, the method comprising: presetting a trigonometric function value corresponding to each addressing angle in an angular region; the method further includes:
  • the trigonometric function value corresponding to each addressing angle of the preset angle region includes: dividing the preset angle region into more than one addressing angle in advance, and determining the addressing angle pairs. The value of the trigonometric function.
  • the trigonometric function value corresponding to each addressing angle in the angular region includes at least one of the following:
  • the determining an addressing angle corresponding to the query angle includes:
  • An addressing angle that minimizes the absolute value of the corresponding angular difference is determined as an addressing angle corresponding to the query angle.
  • the present application also provides an apparatus for obtaining an angle correlation value, the apparatus comprising: a setting module, a first determining module, and a second determining module; wherein
  • the setting module is configured to: a trigonometric function value corresponding to each addressing angle in the preset angle region;
  • the first determining module is configured to determine an addressing angle corresponding to the query angle, obtain a trigonometric function value of the addressing angle according to the addressing angle, and determine a coordinate region to which the query angle belongs;
  • the second determining module is configured to determine, according to the coordinate region, a correspondence between a trigonometric function value of the query angle and a trigonometric function value of the addressing angle; according to the determined correspondence, and the addressing The trigonometric function value of the angle determines the trigonometric function value of the query angle.
  • the setting module is configured to divide the preset angle area into more than one addressing angle in advance, and determine a trigonometric function value corresponding to each addressing angle.
  • the trigonometric function value corresponding to each addressing angle in the angular region includes at least one of the following:
  • the first determining module is configured to determine, according to a trigonometric function relationship, an addressing angle that the corresponding angle of the query angle in the angular region is the smallest absolute value of the corresponding angular difference, and is determined to be The addressing angle corresponding to the query angle.
  • the application also provides a computer storage medium comprising a set of computer executable instructions configured to perform the steps of the aforementioned method.
  • the application also provides an apparatus for obtaining an angle-related value, comprising: a processor and a memory for storing a computer program executable on the processor,
  • processor is configured to perform the steps of the foregoing method when the computer program is run.
  • the method, device and computer storage medium for obtaining an angle correlation value provided by the present application a trigonometric function value corresponding to each addressing angle in a preset angle region; determining an addressing angle corresponding to the query angle, and obtaining according to the addressing angle a trigonometric function value of the addressing angle, and determining a coordinate region to which the query angle belongs; determining, according to the coordinate region, a correspondence between a trigonometric function value of the query angle and a trigonometric function value of the addressing angle; Determining the correspondence, and a trigonometric function value of the addressing angle, determining a trigonometric function value of the query angle.
  • the complex trigonometric function value can be quickly determined without complicated calculations, the processor operation amount is reduced, the calculation time is shortened, the application environment is satisfied, and the application range is wider.
  • FIG. 1 is a schematic flow chart of a method for obtaining an angle correlation value according to the present application
  • FIG. 2 is a schematic diagram of a sinusoidal function curve of the present application
  • FIG. 3 is a schematic diagram of a storage form of a trigonometric function value of the present application.
  • FIG. 4 is a schematic diagram of a tangent function and a cotangent function curve of the present application
  • FIG. 5 is a functional block diagram and a timing diagram of a method for obtaining an angle correlation value according to the present application
  • FIG. 6 is a schematic structural diagram of a device for acquiring an angle correlation value according to the present application.
  • a trigonometric function value corresponding to each addressing angle in the preset angle region is determined; an addressing angle corresponding to the query angle is determined, and a trigonometric function value of the addressing angle is obtained according to the addressing angle, and the a coordinate area to which the query angle belongs; determining, according to the coordinate area, a correspondence between a trigonometric function value of the query angle and a trigonometric function value of the addressing angle; according to the determined correspondence relationship and the addressing angle A trigonometric function value that determines a trigonometric function value for the query angle.
  • the method for obtaining an angle correlation value provided by the present application is as shown in FIG. 1 , and the method includes:
  • Step 101 preset a trigonometric function value corresponding to each addressing angle in the angular region
  • the trigonometric function values of any angle can be converted from trigonometric function values within a specific angular range.
  • the sine function shown in Figure 2 if you know the sine function value of each angle in the range of 0 ⁇ ⁇ /2, the other evaluation angle can find the corresponding angle in the range of 0 ⁇ ⁇ /2, and the sine value of the evaluation angle That is, the sine function value of the corresponding angle or its inverted value; similarly, the cosine function can also determine the cosine function values of other angles according to the cosine function values of the angles in the range of 0 to ⁇ /2; for the tangent function And the cotangent function, only need to take the value of the tangent function in the range of 0 ⁇ ⁇ / 4, then the tangent function and the cotangent function of all other degrees are the positive cotangent value of the corresponding angle of 0 ⁇ ⁇ / 4 or its negation Or take a value obtained by a simple operation such
  • the angle area and the addressing angle may be determined in advance, and a trigonometric function value corresponding to each addressing angle is determined by using a tool such as a computer, a trigonometric function value table is established, and the trigonometric function value table is stored in the read only memory of the SoC ( ROM, Read Only Memory), flash memory, etc.
  • each addressing angle may correspond to a memory address, and the trigonometric function value of each addressing angle is stored to the addressing angle corresponding to the memory address for subsequent table lookup; wherein the range of 0 to ⁇ /2 may be determined.
  • the range of 0 to ⁇ /4 is determined as the preset angle region of the tangent function and the cotangent function; after the preset angle region is determined, it may be determined within the preset angle region
  • the trigonometric value of each angle is determined, and each angle in the preset angle region is determined as an addressing angle, and the addressing angle can be directly searched in a subsequent table lookup operation; wherein the addressing angle may be the preset
  • the angle of the angle region corresponding to each aliquot may be an angle according to the requirement; the more the number of copies of the preset angle region is, the more accurate the trigonometric value is subsequently found; the trigonometric function
  • the form in which the value is stored in the memory can be as shown in FIG.
  • the preset angle area is equally divided into several parts, and the more the number of parts is divided, the more accurate the trigonometric function value is found, and the trigonometric function value corresponding to each addressing angle is stored in the memory of the SoC for Subsequent lookup tables are used.
  • Step 102 Determine an addressing angle corresponding to the query angle, obtain a trigonometric function value of the addressing angle according to the addressing angle, and determine a coordinate region to which the query angle belongs;
  • the addressing angle corresponding to the query angle may be determined according to the trigonometric function relationship; the trigonometric function value of the addressing angle corresponding to the query angle is found in the trigonometric function value list in the memory; here, the corresponding query angle may be determined first An addressing angle, the trigonometric function value of the addressing angle is obtained at a memory address corresponding to the addressing angle;
  • the trigonometric function value of the angle and the trigonometric function value corresponding to each addressing angle in the preset angular region have a simple mathematical operation relationship; wherein the trigonometric function relationship can be expressed by the expression (1) ⁇ (13) means:
  • represents the query angle
  • the query angle ⁇ is the angle between [ ⁇ /2, ⁇ ], the sine function value of the query angle ⁇ and the ⁇ - ⁇ in the range of 0 ⁇ ⁇ /2
  • the sine function values are consistent, therefore, ⁇ - ⁇ is the addressing angle corresponding to the query angle ⁇ ;
  • the relationship between the query angle ⁇ and the corresponding addressing angle may be as shown in Table 1; the addressing angle corresponding to the query angle may be determined according to Table 1; and the trigonometric function value of the addressing angle is found in the memory;
  • the relationship between the trigonometric function value of the query angle and the trigonometric function value corresponding to the addressing angle can be determined according to the coordinate region where the query angle is located. Therefore, the coordinate region of the query angle needs to be determined; here, the coordinate region is in the sine function and the cosine function.
  • the middle can be four quadrants in the plane coordinate axis; the coordinate region can customize [0, ⁇ /4] as the first quadrant in the tangent function and the cotangent function, and [ ⁇ /4, ⁇ /2] is the first In the second quadrant, [- ⁇ /2, - ⁇ /4] is the third quadrant, and [- ⁇ /4, 0] is the fourth quadrant; here, the coordinate region where the query angle is located may be determined after the query angle is obtained.
  • Table 2 the relationship between the trigonometric function value of the query angle and the trigonometric function value of the corresponding addressing angle can be determined by the coordinate region where the query angle is located;
  • the sine function and cosine function can limit the range of angles to the range of Table 1 or Table 2 by adding or subtracting 1 or more cycles 2 ⁇ ;
  • the tangent function and graph shown in Figure 4a The period of the cotangent function shown in 4b is ⁇ . Therefore, the tangent function and the cotangent function can limit the range of angles to the range of Table 1 or Table 2 by adding or subtracting one or more periods ⁇ ;
  • a query angle processing unit may be set, first determining an addressing angle corresponding to the query angle according to Table 1, and obtaining a trigonometric function value of the addressing angle by storing a table therein; determining a query function according to Table 2 Coordinate area; and the trigonometric value of the addressing angle And the coordinate area is sent to subsequent units for further processing.
  • Step 103 Determine, according to the coordinate region, a correspondence relationship between a trigonometric function value of the query angle and a trigonometric function value of an addressing angle; and determine, according to the determined correspondence relationship and a trigonometric function value of the addressing angle a trigonometric function value of the query angle;
  • the trigonometric function value and the addressing angle of the query angle are directly found in Table 2.
  • the trigonometric function value of the query angle can be directly obtained by a simple operation; for example, when the query angle 3 ⁇ /4 sine function value is used, the addressing angle of the query angle is first determined according to Table 2 as ⁇ /4, 3 ⁇ / 4 belongs to the second quadrant; the sine function value according to the predetermined addressing angle ⁇ /4 According to Table 2, when the query angle is in the second quadrant, the sine function value of the query angle is equal to the sine function value of the addressing angle, and therefore, the sine function of the query angle is a value.
  • the cotangent function can be obtained by the inverse of the tangent function.
  • the corresponding angle of the query angle in the preset angle region is intermediate between the two addressing angles; in this case, the angle corresponding to the query angle may be the most a close addressing angle as an addressing angle corresponding to the query angle; an absolute value of the difference between the corresponding angle and the addressing angle may be calculated, and an addressing angle corresponding to the minimum absolute value is determined as the addressing of the query angle Angle; if the preset angle area [0, ⁇ /2] is equally divided into 512 parts and the query angle is ⁇ /6, then ⁇ /6 is between 170 ⁇ /1024 and 171 ⁇ /1024 in the table, ie there is no ⁇ /6 Corresponding angle value, then only the sine value of a close angle value, that is, the sine value corresponding to 171 ⁇ /1024, that is, sin( ⁇ /6) ⁇ sin(171 ⁇ /1024).
  • the function logic includes three parts: a memory, a query angle processing unit, and a trigonometric function processing unit of an addressing angle;
  • the memory is configured to store a trigonometric function value corresponding to each addressing angle;
  • the query angle processing unit is configured to determine an addressing angle corresponding to the query angle and a coordinate region of the query angle;
  • the trigonometric function processing unit of the addressing angle is configured to correspond to the query angle
  • the trigonometric function value of the addressing angle and the coordinate region of the query angle determine the trigonometric function value of the query angle;
  • the RD_EN signal is the enable signal indicating the read memory; the general memory, such as ROM, reads very fast; the other logic in the entire block diagram only converts the angle signal, and does not consume many clock cycles. Therefore, this method can quickly get the trigonometric value.
  • the apparatus for obtaining an angle-related value includes: a setting module 61, a first determining module 62, and a second determining module 63;
  • the setting module 61 is configured to preset a trigonometric function value corresponding to each addressing angle in the angular region;
  • the trigonometric function values of any angle can be converted from trigonometric function values within a specific angular range.
  • the sine function shown in Figure 2 if you know the sine function value of each angle in the range of 0 ⁇ ⁇ /2, the other evaluation angle can find the corresponding angle in the range of 0 ⁇ ⁇ /2, and the sine value of the evaluation angle That is, the sine function value of the corresponding angle or its inverted value; similarly, the cosine function can also determine the cosine function values of other angles according to the cosine function values of the angles in the range of 0 to ⁇ /2; for the tangent function And the cotangent function, only need to take the value of the tangent function in the range of 0 ⁇ ⁇ / 4, then the tangent function and the cotangent function of all other degrees are the positive cotangent value of the corresponding angle of 0 ⁇ ⁇ / 4 or its negation Or take the value obtained by a simple operation such as
  • the angle area and the addressing angle may be determined in advance, and a trigonometric function value corresponding to each addressing angle is determined by using a tool such as a computer, a trigonometric function value table is established, and the trigonometric function value table is stored in the ROM, the flash memory, etc. of the SoC.
  • the trigonometric values of the addressing angles may respectively correspond to a memory address for subsequent lookup tables; wherein the range of 0 to ⁇ /2 may be determined as a preset angle region of the sine function and the cosine function, and will be 0.
  • the range of ⁇ /4 is determined as a preset angle area of the tangent function and the cotangent function; after determining the preset angle area, the trigonometric function value of each angle in the preset angle area may be determined, and the preset angle area is The angles are determined as the addressing angles, and the addressing angles may be directly searched for in the subsequent table lookup operations; wherein the addressing angles may be angles corresponding to the halved points after the predetermined angle regions are equally divided. It may also be an angle taken according to requirements; the more the number of copies of the preset angle region is divided, the more accurate the trigonometric function value found subsequently; the trigonometric function value storage
  • the form in the memory can be as shown in FIG.
  • the preset angle area is equally divided into several parts, and the more the number of parts is divided, the more accurate the trigonometric function value is found, and the trigonometric function value corresponding to each addressing angle is stored in the memory of the SoC for Subsequent lookup tables are used.
  • the first determining module 62 is configured to determine an addressing angle corresponding to the query angle, obtain a trigonometric function value of the addressing angle according to the addressing angle, and determine a coordinate region to which the query angle belongs;
  • the addressing angle corresponding to the query angle may be determined according to the trigonometric function relationship; the trigonometric function value of the addressing angle corresponding to the query angle is found in the trigonometric function value list in the memory; here, the corresponding query angle may be determined first An addressing angle, the trigonometric function value of the addressing angle is obtained at a memory address corresponding to the addressing angle;
  • the trigonometric function value of the angle and the trigonometric function value corresponding to each addressing angle in the preset angular region have a simple mathematical operation relationship; wherein the trigonometric function relationship can be expressed by the expression (1) ⁇ (13) indicates; where ⁇ represents the query angle; (2) As an example, the query angle ⁇ is an angle between [ ⁇ /2, ⁇ ], and the sine function value of the query angle ⁇ is consistent with the sine function value of ⁇ - ⁇ in the range of 0 to ⁇ /2, and therefore, ⁇ - ⁇ is the addressing angle corresponding to the query angle ⁇ ;
  • the relationship between the query angle ⁇ and the corresponding addressing angle can be as shown in Table 1; the addressing angle corresponding to the query angle can be determined according to Table 1; the trigonometric function value of the addressing angle is found in the memory; the trigonometric function of the query angle
  • the relationship between the value and the value of the trigonometric function corresponding to the addressing angle may be determined according to the coordinate region in which the query angle is located; therefore, the coordinate region of the query angle needs to be determined; here, the coordinate region may be a plane in the sine function and the cosine function.
  • the coordinate region can customize [0, ⁇ /4] as the first quadrant and [ ⁇ /4, ⁇ /2] as the second quadrant in the tangent function and the cotangent function, [ - ⁇ /2, - ⁇ /4] is the third quadrant, and [- ⁇ /4, 0] is the fourth quadrant; here, the coordinate region where the query angle is located may be determined after the query angle is obtained.
  • Table 2 the relationship between the trigonometric function value of the query angle and the trigonometric function value of the corresponding addressing angle can be determined by the coordinate region where the query angle is located;
  • the sine function and cosine function can limit the range of angles to the range of Table 1 or Table 2 by adding or subtracting 1 or more cycles 2 ⁇ ;
  • the tangent function and graph shown in Figure 4a The period of the cotangent function shown in 4b is ⁇ . Therefore, the tangent function and the cotangent function can limit the range of angles to the range of Table 1 or Table 2 by adding or subtracting one or more periods ⁇ ;
  • a query angle processing unit may be set, first determining an addressing angle corresponding to the query angle according to Table 1, and obtaining a trigonometric function value of the addressing angle by storing a table therein; determining a query function according to Table 2 The coordinate area; and the trigonometric value of the addressing angle and the coordinate area are sent to subsequent units for further processing.
  • the second determining module 63 determines, according to the coordinate region, a correspondence relationship between a trigonometric function value of the query angle and a trigonometric function value of the addressing angle; and the corresponding correspondence according to the determined correspondence and the corresponding search angle a trigonometric function value of the address angle, determining a trigonometric function value of the query angle;
  • the trigonometric function value and the addressing angle of the query angle are directly found in Table 2.
  • the trigonometric function value of the query angle can be directly obtained by a simple operation; for example, when the query angle 3 ⁇ /4 sine function value is used, the addressing angle of the query angle is first determined according to Table 2 as ⁇ /4, 3 ⁇ / 4 belongs to the second quadrant; the sine function value according to the predetermined addressing angle ⁇ /4 According to Table 2, when the query angle is in the second quadrant, the sine function value of the query angle is equal to the sine function value of the addressing angle, and therefore, the sine function value of the query angle is The cotangent function can be obtained by the inverse of the tangent function.
  • the corresponding angle of the query angle in the preset angle region is intermediate between the two addressing angles; in this case, the angle corresponding to the query angle may be the most a close addressing angle as an addressing angle corresponding to the query angle; an absolute value of the difference between the corresponding angle and the addressing angle may be calculated, and an addressing angle corresponding to the minimum absolute value is determined as the addressing of the query angle Angle; if the preset angle area [0, ⁇ /2] is equally divided into 512 parts and the query angle is ⁇ /6, then ⁇ /6 is between 170 ⁇ /1024 and 171 ⁇ /1024 in the table, ie there is no ⁇ /6 Corresponding angle value, then only the sine value of a close angle value, that is, the sine value corresponding to 171 ⁇ /1024, that is, sin( ⁇ /6) ⁇ sin(171 ⁇ /1024).
  • the setting module 61, the first determining module 62, and the second determining module 63 may be implemented by a processor or hardware logic or the like of the integrated circuit chip.
  • the present application also provides a computer storage medium comprising a set of computer executable instructions configured to perform:
  • the computer executable instructions are configured to perform: dividing the preset angle region into more than one addressing angle in advance, and determining a trigonometric function value corresponding to each of the addressing angles.
  • the computer executable instructions are configured to perform: determining, according to a trigonometric relationship, a corresponding angle of the query angle within the angular region;
  • An addressing angle that minimizes the absolute value of the corresponding angular difference is determined as an addressing angle corresponding to the query angle.
  • an apparatus for deinterleaving rate matching includes: a processor and a memory for storing a computer program capable of running on the processor,
  • processor configured to execute when the computer program is executed:
  • the processor is configured to: when the computer program is executed, perform: dividing a preset angle region into more than one addressing angle in advance, and determining a trigonometric function value corresponding to each addressing angle.
  • the processor When the processor is configured to run the computer program, performing: determining, according to a trigonometric function relationship, a corresponding angle of the query angle in the angular region;
  • An addressing angle that minimizes the absolute value of the corresponding angular difference is determined as an addressing angle corresponding to the query angle.
  • the integrated modules described herein may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for making a A computer device (which may be a personal computer, a network device, or a network device, etc.) performs all or part of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .
  • the application is not limited to any particular combination of hardware and software.
  • the application provides a method, a device and a computer storage medium for acquiring an angle correlation value, a trigonometric function value corresponding to each addressing angle in a preset angle region; determining an addressing angle corresponding to the query angle, according to the addressing angle, Obtaining a trigonometric function value of the addressing angle, and determining a coordinate region to which the query angle belongs; determining, according to the coordinate region, a correspondence relationship between a trigonometric function value of the query angle and a trigonometric function value of the addressing angle; And determining a trigonometric function value of the query angle according to the determined correspondence relationship and a trigonometric function value of the addressing angle. in this way, Directly through the angle conversion and table look-up operation, the complex trigonometric function value can be quickly determined without complicated calculations, the processor operation amount is reduced, the calculation time is shortened, the application environment is satisfied, and the application range is wider.

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种获取角度相关值的方法,预设角度区域内各寻址角度对应的三角函数值(101);确定查询角度对应的寻址角度,根据所述寻址角度,获取所述寻址角度的三角函数值,并确定所述查询角度所属的坐标区域(102);根据所述坐标区域确定所述查询角度的三角函数值与寻址角度的三角函数值的对应关系;根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值(103)。还提供一种获取角度相关值的装置及计算机存储介质。

Description

一种获取角度相关值的方法、装置及计算机存储介质
相关申请的交叉引用
本申请基于申请号为201610793698.6、申请日为2016年08月31日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本申请涉及信息处理领域,尤其涉及一种获取角度相关值的方法、装置及计算机存储介质。
背景技术
目前,片上系统(SoC,System on Chip)中计算角度的三角函数值一般会采用三种方法:
一、采用软件计算三角函数值;采用这种方法会消耗很长的中央处理器(CPU,Central Processing Unit)时间,加大了CPU的负荷,拉低了系统的运算效率;对于实时性高和需要的控制精度高的系统来说,这会使CPU难以响应其它事物,而且一般三角函数是要频繁计算的。
二、采用坐标旋转数字计算(Cordic)算法;该算法需要循环迭代,无论使用软件还是使用硬件来实现,均需要消耗较长的计算时间;Cordic算法计算三角函数,想要提高计算精度,就需要提高迭代的次数,这就加大了运算的时间,且Cordic算法本身对小角度计算十分不准确,具有一定的局限性。
三、通过搭建模拟电路来计算三角函数;使用这种方法在模拟电路部分计算完成后,将数据通过模数转换电路传递给数字部分处理;模拟电路 的运算精度不容易保证,模拟和数字之间的转换也会丢失一定的精度,而且会额外增加电路,增大了SoC面积,功耗也会随之增加;而且这种方法对模拟设计人员的技术要求较高,要精通模拟电路设计,还要掌握数学建模,设计难度较大。
在电机控制领域、图像处理领域、导航定位等领域中,都对计算的效率有很高的要求;例如电机控制领域,运算过程越短就能在单位时间内获得更多的控制电机的次数,这样就能使电机转的更加平稳;再比如导航定位领域,对高速行驶的汽车进行定位时,计算的时间越短,获得汽车位置的次数就越多,定位效果就越好。
因此,如何减少处理器运算量,缩短运算时间,快速确定角度的三角函数值,满足不同应用环境,是亟待解决的问题。
发明内容
有鉴于此,本申请期望提供一种获取角度相关值的方法、装置及计算机存储介质,能减少处理器运算量,缩短运算时间,快速确定角度的三角函数值,满足不同应用环境。
为达到上述目的,本申请的技术方案是这样实现的:
本申请提供了一种获取角度相关值的方法,所述方法包括:预设角度区域内各寻址角度对应的三角函数值;所述方法还包括:
确定查询角度对应的寻址角度,根据所述寻址角度,获取所述寻址角度的三角函数值,并确定所述查询角度所属的坐标区域;
根据所述坐标区域确定所述查询角度的三角函数值与所述寻址角度的三角函数值的对应关系;根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值。
上述方案中,所述预设角度区域各寻址角度对应的三角函数值,包括:预先将预设角度区域分为一个以上的寻址角度,并确定所述各寻址角度对 应的三角函数值。
上述方案中,所述角度区域内各寻址角度对应的三角函数值,包括以下至少之一:
0到π/2区域内各寻址角度对应的正弦函数值;
0到π/2区域内各寻址角度对应的余弦函数值;
0到π/4区域内各寻址角度对应的正切函数值;
0到π/4区域内各寻址角度对应的余切函数值。
上述方案中,所述确定查询角度对应的寻址角度,包括;
根据三角函数关系,确定所述查询角度在所述角度区域内的对应角度;
将与所述对应角度差绝对值最小的寻址角度,确定为所述查询角度对应的寻址角度。
本申请还提供了一种获取角度相关值的装置,所述装置包括:设置模块、第一确定模块和第二确定模块;其中,
所述设置模块,配置为预设角度区域内各寻址角度对应的三角函数值;
所述第一确定模块,配置为确定查询角度对应的寻址角度,根据所述寻址角度,获取所述寻址角度的三角函数值,并确定所述查询角度所属的坐标区域;
所述第二确定模块,配置为根据所述坐标区域确定所述查询角度的三角函数值与所述寻址角度的三角函数值的对应关系;根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值。
上述方案中,所述设置模块,配置为预先将预设角度区域分为一个以上的寻址角度,并确定所述各寻址角度对应的三角函数值。
上述方案中,所述角度区域内各寻址角度对应的三角函数值,包括以下至少之一:
0到π/2区域内各寻址角度对应的正弦函数值;
0到π/2区域内各寻址角度对应的余弦函数值;
0到π/4区域内各寻址角度对应的正切函数值;
0到π/4区域内各寻址角度对应的余切函数值。
上述方案中,所述第一确定模块,配置为根据三角函数关系,确定所述查询角度在所述角度区域内的对应角度将与所述对应角度差绝对值最小的寻址角度,确定为所述查询角度对应的寻址角度。
本申请还提供了一种计算机存储介质,该计算机存储介质包括一组计算机可执行指令,所述计算机可执行指令配置为执行前述方法的步骤。
本申请还提供了一种获取角度相关值的装置,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,
其中,所述处理器用于运行所述计算机程序时,执行前述方法的步骤。
本申请所提供的获取角度相关值的方法、装置及计算机存储介质,预设角度区域内各寻址角度对应的三角函数值;确定查询角度对应的寻址角度,根据所述寻址角度,获取所述寻址角度的三角函数值,并确定所述查询角度所属的坐标区域;根据所述坐标区域确定所述查询角度的三角函数值与所述寻址角度的三角函数值的对应关系;根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值。如此,直接通过角度的转换和查表操作,无需经过复杂的运算,能快速确定角度的三角函数值,减少处理器运算量,缩短运算时间,满足不同应用环境,应用范围更广。
附图说明
图1为本申请获取角度相关值的方法的流程示意图;
图2为本申请正弦函数曲线示意图;
图3为本申请三角函数值存储形式示意图;
图4为本申请正切函数和余切函数曲线示意图;
图5为本申请获取角度相关值的方法功能框图和时序示意图;
图6为本申请获取角度相关值的装置的组成结构示意图。
具体实施方式
本申请中,预设角度区域内各寻址角度对应的三角函数值;确定查询角度对应的寻址角度,根据所述寻址角度,获取所述寻址角度的三角函数值,并确定所述查询角度所属的坐标区域;根据所述坐标区域确定所述查询角度的三角函数值与所述寻址角度的三角函数值的对应关系;根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值。
下面结合实施例对本申请再作进一步详细的说明。
本申请提供的获取角度相关值的方法,如图1所示,所述方法包括:
步骤101:预设角度区域内各寻址角度对应的三角函数值;
根据三角函数数学原理,任何角度的三角函数值都可以由特定角度范围内的三角函数值转换而来。如图2所示的正弦函数,如果知道0~π/2范围内各角度的正弦函数值,则其它求值角度可以在0~π/2范围找到对应的角度,并且求值角度的正弦值就是所述对应角度的正弦函数值或其取反后的值;同理,余弦函数同样可以根据0~π/2范围内各角度的余弦函数值来确定其它角度的余弦函数值;对于正切函数和余切函数,只需要取0~π/4范围内的正切函数值,则其它所有度数的正切函数和余切函数就是0~π/4的对应角度的正余切值或其进行取反或取倒数等简单运算后得到的值;其中,π为角度制180°的弧度制形式;
这里,可以预先确定角度区域以及寻址角度,并采用计算机等工具确定各寻址角度对应的三角函数值,建立三角函数值表,并将所述三角函数值表存储到SoC的只读存储器(ROM,Read Only Memory)、闪存等存储 器中,各寻址角度可以分别对应于一个存储器地址,将各寻址角度的三角函数值存储到寻址角度对应存储器地址,供后续查表使用;其中,可以将0~π/2范围确定为正弦函数和余弦函数的预设角度区域,将0~π/4范围确定为正切函数和余切函数的预设角度区域;确定所述预设角度区域后,可以确定在预设角度区域内各个角度的三角函数值,并将预设角度区域内各个角度确定为寻址角度,后续查表操作中可以直接查找所述寻址角度;其中,所述寻址角度可以是将所述预设角度区域进行等分后对应各等分点的角度,也可以是根据需求取的角度;将所述预设角度区域分的份数越多,则后续查找到的三角函数值越精确;三角函数值存储在存储器中的形式可以如图3所示。
实际应用中,将所述预设角度区域平均分成若干份,分的份数越多则查找到的三角函数值越精确,将各个寻址角度对应的三角函数值存储在SoC的存储器中,供后续查表使用。
步骤102:确定查询角度对应的寻址角度,根据所述寻址角度,获取所述寻址角度的三角函数值,并确定所述查询角度所属的坐标区域;
这里,可以根据三角函数关系确定查询角度对应的寻址角度;在存储器中的三角函数值列表中查得查询角度对应的寻址角度的三角函数值;这里,可以先确定所述查询角度对应的寻址角度,在寻址角度对应的存储器地址获取所述寻址角度的三角函数值;
根据三角函数关系,所述角度的三角函数值和所述预设角度区域内各寻址角度对应的三角函数值都有一个简单的数学运算关系;其中,三角函数关系可以用表达式(1)~(13)表示:
Figure PCTCN2017091463-appb-000001
Figure PCTCN2017091463-appb-000002
Figure PCTCN2017091463-appb-000003
Figure PCTCN2017091463-appb-000004
Figure PCTCN2017091463-appb-000005
Figure PCTCN2017091463-appb-000006
Figure PCTCN2017091463-appb-000007
Figure PCTCN2017091463-appb-000008
Figure PCTCN2017091463-appb-000009
Figure PCTCN2017091463-appb-000010
Figure PCTCN2017091463-appb-000011
Figure PCTCN2017091463-appb-000012
Figure PCTCN2017091463-appb-000013
其中,θ表示查询角度;以表达式(2)为例,查询角度θ为[π/2,π]之间的角度,查询角度θ的正弦函数值和0~π/2范围内π-θ的正弦函数值一致,因此,π-θ为查询角度θ对应的寻址角度;
查询角度θ与对应寻址角度的关系,可以如表1所示;可以根据表1确定查询角度对应的寻址角度;并在存储器中查得寻址角度的三角函数值;
Figure PCTCN2017091463-appb-000014
Figure PCTCN2017091463-appb-000015
表1
查询角度的三角函数值与对应寻址角度的三角函数值的关系可以根据查询角度所在的坐标区域来决定,因此,需要确定查询角度的坐标区域;这里,所述坐标区域在正弦函数和余弦函数中可以是平面坐标轴中的四个象限;所述坐标区域在正切函数和余切函数中可以自定义[0,π/4]为第一象限,[π/4,π/2]为第二象限,[-π/2,-π/4]为第三象限,[-π/4,0]为第四象限;这里,可以在获取到查询角度后确定所述查询角度所在的坐标区域;如此,如表2所示,可以通过查询角度所在坐标区域确定查询角度的三角函数值与对应寻址角度的三角函数值的关系;
Figure PCTCN2017091463-appb-000016
Figure PCTCN2017091463-appb-000017
表2
对于超出表1或表2范围内的角度,正弦函数和余弦函数可以通过加减1个或多个周期2π将角度范围限制到表1或表2范围内;图4a所示的正切函数和图4b所示余切函数的周期为π,因此,正切函数和余切函数可以通过加减1个或多个周期π将角度范围限制到表1或表2范围内;
实际应用中,可以设置一个查询角度处理单元,先根据表1确定查询角度对应的寻址角度,并通过在存储其中查表获取所述寻址角度的三角函数值;在根据表2确定查询函数的坐标区域;并将寻址角度的三角函数值 和坐标区域发送到后续单元进行进一步处理。
步骤103:根据所述坐标区域确定所述查询角度的三角函数值与寻址角度的三角函数值的对应关系;根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值;
这里,可以根据获取的所述查询角度所属的坐标区域,和所述查询角度对应的寻址角度的三角函数值,在表2中直接查得所述查询角度的三角函数值与寻址角度的三角函数值的关系,可以通过简单运算直接获取所述查询角度的三角函数值;如查询角度3π/4正弦函数值时,首先根据表2确定查询角度的寻址角度为π/4,3π/4属于第二象限;根据预先确定的寻址角度π/4的正弦函数值为
Figure PCTCN2017091463-appb-000018
则根据表2可以确定查询角度在第二象限时,所述查询角度的正弦函数值与寻址角度的正弦函数值相等,因此,查询角度的正弦函数为值
Figure PCTCN2017091463-appb-000019
余切函数可以通过正切函数的倒数来获取。
进一步的,由于实际应用中寻址角度是离散的,如此,会遇到查询角度在预设角度区域内对应角度在两个寻址角度中间的情况;这时,可以取与查询角度对应角度最接近的寻址角度作为所述查询角度对应的寻址角度;可以计算所述对应角度与寻址角度的差的绝对值,将最小绝对值对应的寻址角度确定为所述查询角度的寻址角度;如将预设角度区域[0,π/2]平均分成512份,查询角度为π/6,那么,π/6在表中170π/1024和171π/1024之间,即没有π/6对应的角度值,那么只能取接近的一个角度值的正弦值,即171π/1024对应的正弦值,即sin(π/6)≈sin(171π/1024)。
在整个查询角度的三角函数值过程中,仅仅采用了查表以及一些简单的运算和判断过程,并不涉及到复杂的三角函数算法;这样,降低了处理器的运算负载,减少处理器运算量,缩短运算时间,能够更快获取查询角度的三角函数值。
下面结合具体示例对本申请产生的积极效果作进一步详细的描述。
图5(a)和图5(b)分别为获取角度相关值的功能逻辑框图和对应的时序示意图,功能逻辑包括3部分:存储器,查询角度处理单元和寻址角度的三角函数处理单元;其中,存储器用于存储各寻址角度对应的三角函数值;查询角度处理单元用于确定查询角度对应的寻址角度和查询角度的坐标区域;寻址角度的三角函数处理单元用于根据查询角度对应的寻址角度的三角函数值和查询角度的坐标区域确定查询角度的三角函数值;
时序图中,RD_EN这个信号是表明读存储器的使能信号;一般存储器,如ROM,读取速度非常快;整个框图中的其它逻辑,也仅仅是对角度信号进行转换,不会消耗很多时钟周期,因此,这种方法能很快得到三角函数值。
比如查询正弦函数时,如果查询角度是7π/6,查询角度处理单元首先确定坐标区域是第三象限,寻址角度是7π/6-π=π/6;寻址角度的三角函数处理单元确定查询角度的三角函数值应该是-sin(π/6)=-0.5。
本申请提供的获取角度相关值的装置,如图6所示,所述获取角度相关值的装置包括:设置模块61、第一确定模块62和第二确定模块63;其中,
所述设置模块61,用于预设角度区域内各寻址角度对应的三角函数值;
根据三角函数数学原理,任何角度的三角函数值都可以由特定角度范围内的三角函数值转换而来。如图2所示的正弦函数,如果知道0~π/2范围内各角度的正弦函数值,则其它求值角度可以在0~π/2范围找到对应的角度,并且求值角度的正弦值就是所述对应角度的正弦函数值或其取反后的值;同理,余弦函数同样可以根据0~π/2范围内各角度的余弦函数值来确定其它角度的余弦函数值;对于正切函数和余切函数,只需要取0~π/4范围内的正切函数值,则其它所有度数的正切函数和余切函数就是0~π/4的对应角度的正余切值或其进行取反或取倒数等简单运算后得到的值;其中,π为角 度制180°的弧度制形式;
这里,可以预先确定角度区域以及寻址角度,并采用计算机等工具确定各寻址角度对应的三角函数值,建立三角函数值表,并将所述三角函数值表存储到SoC的ROM、闪存等存储器中,各寻址角度的三角函数值可以分别对应于一个存储器地址,供后续查表使用;其中,可以将0~π/2范围确定为正弦函数和余弦函数的预设角度区域,将0~π/4范围确定为正切函数和余切函数的预设角度区域;确定所述预设角度区域后,可以确定在预设角度区域内各个角度的三角函数值,并将预设角度区域内各个角度确定为寻址角度,后续查表操作中可以直接查找所述寻址角度;其中,所述寻址角度可以是将所述预设角度区域进行等分后对应各等分点的角度,也可以是根据需求取的角度;将所述预设角度区域分的份数越多,则后续查找到的三角函数值越精确;三角函数值存储在存储器中的形式可以如图3所示。
实际应用中,将所述预设角度区域平均分成若干份,分的份数越多则查找到的三角函数值越精确,将各个寻址角度对应的三角函数值存储在SoC的存储器中,供后续查表使用。
所述第一确定模块62,用于确定查询角度对应的寻址角度,根据所述寻址角度,获取所述寻址角度的三角函数值,并确定所述查询角度所属的坐标区域;
这里,可以根据三角函数关系确定查询角度对应的寻址角度;在存储器中的三角函数值列表中查得查询角度对应的寻址角度的三角函数值;这里,可以先确定所述查询角度对应的寻址角度,在寻址角度对应的存储器地址获取所述寻址角度的三角函数值;
根据三角函数关系,所述角度的三角函数值和所述预设角度区域内各寻址角度对应的三角函数值都有一个简单的数学运算关系;其中,三角函数关系可以用表达式(1)~(13)表示;其中,θ表示查询角度;以表达式 (2)为例,查询角度θ为[π/2,π]之间的角度,查询角度θ的正弦函数值和0~π/2范围内π-θ的正弦函数值一致,因此,π-θ为查询角度θ对应的寻址角度;
查询角度θ与对应寻址角度的关系,可以如表1所示;可以根据表1确定查询角度对应的寻址角度;并在存储器中查得寻址角度的三角函数值;查询角度的三角函数值与对应寻址角度的三角函数值的关系可以根据查询角度所在的坐标区域来决定;,因此,需要确定查询角度的坐标区域;这里,所述坐标区域在正弦函数和余弦函数中可以是平面坐标轴中的四个象限;所述坐标区域在正切函数和余切函数中可以自定义[0,π/4]为第一象限,[π/4,π/2]为第二象限,[-π/2,-π/4]为第三象限,[-π/4,0]为第四象限;这里,可以在获取到查询角度后确定所述查询角度所在的坐标区域。如此,如表2所示,可以通过查询角度所在坐标区域确定查询角度的三角函数值与对应寻址角度的三角函数值的关系;
对于超出表1或表2范围内的角度,正弦函数和余弦函数可以通过加减1个或多个周期2π将角度范围限制到表1或表2范围内;图4a所示的正切函数和图4b所示余切函数的周期为π,因此,正切函数和余切函数可以通过加减1个或多个周期π将角度范围限制到表1或表2范围内;
实际应用中,可以设置一个查询角度处理单元,先根据表1确定查询角度对应的寻址角度,并通过在存储其中查表获取所述寻址角度的三角函数值;在根据表2确定查询函数的坐标区域;并将寻址角度的三角函数值和坐标区域发送到后续单元进行进一步处理。
所述第二确定模块63,根据所述坐标区域确定所述查询角度的三角函数值与寻址角度的三角函数值的对应关系;根据确定的所述对应关系、以及所述查询角度对应的寻址角度的三角函数值,确定所述查询角度的三角函数值;
这里,可以根据获取的所述查询角度所属的坐标区域,和所述查询角度对应的寻址角度的三角函数值,在表2中直接查得所述查询角度的三角函数值与寻址角度的三角函数值的关系,可以通过简单运算直接获取所述查询角度的三角函数值;如查询角度3π/4正弦函数值时,首先根据表2确定查询角度的寻址角度为π/4,3π/4属于第二象限;根据预先确定的寻址角度π/4的正弦函数值为
Figure PCTCN2017091463-appb-000020
则根据表2可以确定查询角度在第二象限时,所述查询角度的正弦函数值与寻址角度的正弦函数值相等,因此,查询角度的正弦函数值为
Figure PCTCN2017091463-appb-000021
余切函数可以通过正切函数的倒数来获取。
进一步的,由于实际应用中寻址角度是离散的,如此,会遇到查询角度在预设角度区域内对应角度在两个寻址角度中间的情况;这时,可以取与查询角度对应角度最接近的寻址角度作为所述查询角度对应的寻址角度;可以计算所述对应角度与寻址角度的差的绝对值,将最小绝对值对应的寻址角度确定为所述查询角度的寻址角度;如将预设角度区域[0,π/2]平均分成512份,查询角度为π/6,那么,π/6在表中170π/1024和171π/1024之间,即没有π/6对应的角度值,那么只能取接近的一个角度值的正弦值,即171π/1024对应的正弦值,即sin(π/6)≈sin(171π/1024)。
在整个查询角度的三角函数值过程中,仅仅采用了查表以及一些简单的运算和判断过程,并不涉及到复杂的三角函数算法;这样,降低了处理器的运算负载,减少处理器运算量,缩短运算时间,能够更快获取查询角度的三角函数值。
在实际应用中,所述设置模块61、第一确定模块62和第二确定模块63可以由集成电路芯片的处理器或硬件逻辑等实现。
以上所述,仅为本申请的最佳实施例而已,并非用于限定本申请的保护范围,凡在本申请的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本申请的保护范围之内。
在前述实施例的基础上,本申请还提供了一种计算机存储介质,该计算机存储介质包括一组计算机可执行指令,所述计算机可执行指令配置为执行:
确定查询角度对应的寻址角度;
根据所述寻址角度,获取所述寻址角度的三角函数值,确定所述查询角度所属的坐标区域;
根据所述坐标区域,确定所述查询角度的三角函数值、与所述寻址角度的三角函数值的对应关系;
根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值。
所述计算机可执行指令配置为执行:预先将预设角度区域分为一个以上的寻址角度,并确定所述各寻址角度对应的三角函数值。
所述计算机可执行指令配置为执行:根据三角函数关系,确定所述查询角度在所述角度区域内的对应角度;
将与所述对应角度差绝对值最小的寻址角度,确定为所述查询角度对应的寻址角度。
进一步地,本申请提供的一种解交织解速率匹配的装置,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,
其中,所述处理器用于运行所述计算机程序时,执行:
确定查询角度对应的寻址角度;
根据所述寻址角度,获取所述寻址角度的三角函数值,确定所述查询角度所属的坐标区域;
根据所述坐标区域,确定所述查询角度的三角函数值、与所述寻址角度的三角函数值的对应关系;
根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值。
所述处理器用于运行所述计算机程序时,执行:预先将预设角度区域分为一个以上的寻址角度,并确定所述各寻址角度对应的三角函数值。
所述处理器用于运行所述计算机程序时,执行:根据三角函数关系,确定所述查询角度在所述角度区域内的对应角度;
将与所述对应角度差绝对值最小的寻址角度,确定为所述查询角度对应的寻址角度。
本申请所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、网络设备、或者网络设备等)执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本申请不限制于任何特定的硬件和软件结合。
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。
工业实用性
本申请提供了一种获取角度相关值的方法、装置及计算机存储介质,预设角度区域内各寻址角度对应的三角函数值;确定查询角度对应的寻址角度,根据所述寻址角度,获取所述寻址角度的三角函数值,并确定所述查询角度所属的坐标区域;根据所述坐标区域确定所述查询角度的三角函数值与所述寻址角度的三角函数值的对应关系;根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值。如此, 直接通过角度的转换和查表操作,无需经过复杂的运算,能快速确定角度的三角函数值,减少处理器运算量,缩短运算时间,满足不同应用环境,应用范围更广。

Claims (10)

  1. 一种获取角度相关值的方法,所述方法包括:预设角度区域内各寻址角度对应的三角函数值;所述方法还包括:
    确定查询角度对应的寻址角度;
    根据所述寻址角度,获取所述寻址角度的三角函数值,确定所述查询角度所属的坐标区域;
    根据所述坐标区域,确定所述查询角度的三角函数值、与所述寻址角度的三角函数值的对应关系;
    根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值。
  2. 根据权利要求1所述的方法,其中,所述预设角度区域各寻址角度对应的三角函数值,包括:预先将预设角度区域分为一个以上的寻址角度,并确定所述各寻址角度对应的三角函数值。
  3. 根据权利要求1或2所述的方法,其中,所述角度区域内各寻址角度对应的三角函数值,包括以下至少之一:
    0到π/2区域内各寻址角度对应的正弦函数值;
    0到π/2区域内各寻址角度对应的余弦函数值;
    0到π/4区域内各寻址角度对应的正切函数值;
    0到π/4区域内各寻址角度对应的余切函数值。
  4. 根据权利要求1所述的方法,其中,所述确定查询角度对应的寻址角度,包括;
    根据三角函数关系,确定所述查询角度在所述角度区域内的对应角度;
    将与所述对应角度差绝对值最小的寻址角度,确定为所述查询角度对应的寻址角度。
  5. 一种获取角度相关值的装置,所述装置包括:设置模块、第一确定模块和第二确定模块;其中,
    所述设置模块,配置为预设角度区域内各寻址角度对应的三角函数值;
    所述第一确定模块,配置为确定查询角度对应的寻址角度,根据所述寻址角度,获取所述寻址角度的三角函数值,并确定所述查询角度所属的坐标区域;
    所述第二确定模块,配置为根据所述坐标区域确定所述查询角度的三角函数值与所述寻址角度的三角函数值的对应关系;根据确定的所述对应关系、以及所述寻址角度的三角函数值,确定所述查询角度的三角函数值。
  6. 根据权利要求5所述的装置,其中,所述设置模块,配置为预先将预设角度区域分为一个以上的寻址角度,并确定所述各寻址角度对应的三角函数值。
  7. 根据权利要求5或6所述的装置,其中,所述角度区域内各寻址角度对应的三角函数值,包括以下至少之一:
    0到π/2区域内各寻址角度对应的正弦函数值;
    0到π/2区域内各寻址角度对应的余弦函数值;
    0到π/4区域内各寻址角度对应的正切函数值;
    0到π/4区域内各寻址角度对应的余切函数值。
  8. 根据权利要求5所述的装置,其中,
    所述第一确定模块,配置为根据三角函数关系,确定所述查询角度在所述角度区域内的对应角度将与所述对应角度差绝对值最小的寻址角度,确定为所述查询角度对应的寻址角度。
  9. 一种计算机存储介质,该计算机存储介质包括一组计算机可执行指令,所述计算机可执行指令配置为执行权利要求1至4任一项所述的方法的步骤。
  10. 一种获取角度相关值的装置,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,
    其中,所述处理器用于运行所述计算机程序时,执行权利要求1至4任一项所述方法的步骤。
PCT/CN2017/091463 2016-08-31 2017-07-03 一种获取角度相关值的方法、装置及计算机存储介质 WO2018040726A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610793698.6A CN107783756A (zh) 2016-08-31 2016-08-31 一种获取角度相关值的方法和装置
CN201610793698.6 2016-08-31

Publications (1)

Publication Number Publication Date
WO2018040726A1 true WO2018040726A1 (zh) 2018-03-08

Family

ID=61299920

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/091463 WO2018040726A1 (zh) 2016-08-31 2017-07-03 一种获取角度相关值的方法、装置及计算机存储介质

Country Status (2)

Country Link
CN (1) CN107783756A (zh)
WO (1) WO2018040726A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783761A (zh) * 2019-01-25 2019-05-21 武汉轻工大学 三重积分计算方法、装置、终端设备及可读存储介质
CN111402873A (zh) * 2020-02-25 2020-07-10 北京声智科技有限公司 语音信号处理方法、装置、设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109547761A (zh) * 2018-11-14 2019-03-29 新视家科技(北京)有限公司 一种色相转换电路和色彩空间转换电路
CN114845023A (zh) * 2022-04-26 2022-08-02 杭州海康威视数字技术股份有限公司 一种驱动方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1983103A (zh) * 2006-06-15 2007-06-20 华为技术有限公司 三角函数值确定装置、方法及应用其的通信装置
CN102034260A (zh) * 2010-12-27 2011-04-27 北京像素软件科技股份有限公司 3d图形渲染中的三角函数计算方法
CN103077155A (zh) * 2012-12-27 2013-05-01 华自科技股份有限公司 一种电力系统相量角度的计算方法
CN105262400A (zh) * 2015-11-13 2016-01-20 四川长虹电器股份有限公司 一种提高电机死区补偿控制精度的控制方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102650983B (zh) * 2011-02-25 2016-06-15 西安邮电大学 基于查找表采用三次Bezier函数的基本三角函数求值器
CN103365827A (zh) * 2013-06-27 2013-10-23 北京航空航天大学 一种高精度正弦/余弦函数的计算方法
CN104536720B (zh) * 2014-12-22 2017-11-28 浙江中控研究院有限公司 基于fpga的待测角三角函数值的测算方法及系统
CN105138305B (zh) * 2015-09-25 2018-11-27 上海兆芯集成电路有限公司 高精度的三角函数计算方法以及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1983103A (zh) * 2006-06-15 2007-06-20 华为技术有限公司 三角函数值确定装置、方法及应用其的通信装置
CN102034260A (zh) * 2010-12-27 2011-04-27 北京像素软件科技股份有限公司 3d图形渲染中的三角函数计算方法
CN103077155A (zh) * 2012-12-27 2013-05-01 华自科技股份有限公司 一种电力系统相量角度的计算方法
CN105262400A (zh) * 2015-11-13 2016-01-20 四川长虹电器股份有限公司 一种提高电机死区补偿控制精度的控制方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783761A (zh) * 2019-01-25 2019-05-21 武汉轻工大学 三重积分计算方法、装置、终端设备及可读存储介质
CN109783761B (zh) * 2019-01-25 2023-08-01 武汉轻工大学 三重积分计算方法、装置、终端设备及可读存储介质
CN111402873A (zh) * 2020-02-25 2020-07-10 北京声智科技有限公司 语音信号处理方法、装置、设备及存储介质
CN111402873B (zh) * 2020-02-25 2023-10-20 北京声智科技有限公司 语音信号处理方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN107783756A (zh) 2018-03-09

Similar Documents

Publication Publication Date Title
WO2018040726A1 (zh) 一种获取角度相关值的方法、装置及计算机存储介质
US11023206B2 (en) Dot product calculators and methods of operating the same
CN109062540A (zh) 一种基于cordic算法的可重构浮点运算装置
KR102359265B1 (ko) 프로세싱 장치 및 프로세싱 장치에서 연산을 수행하는 방법
WO2017186016A1 (zh) 图像形变处理的方法和装置、计算机存储介质
Moussalli et al. Fast and flexible conversion of geohash codes to and from latitude/longitude coordinates
KR20190058537A (ko) 동적 가변 정밀도 계산
Xu et al. A computational geometry method for localization using differences of distances
WO2022111609A1 (zh) 一种网格编码方法及计算机系统
Liu et al. $\pi $ π-BA: Bundle Adjustment Hardware Accelerator Based on Distribution of 3D-Point Observations
Masselli et al. A new geometric approach for faster solving the perspective-three-point problem
US20150134677A1 (en) Amorphous data preparation for efficient query formulation
WO2018120933A1 (zh) 一种数据库的存储、查询方法及装置
US20170139948A1 (en) Systems, Apparatuses, and Methods for K Nearest Neighbor Search
CN110998514B (zh) 可中断的三角运算
WO2021056450A1 (zh) 图像模板的更新方法、设备及存储介质
TWI567367B (zh) 用於電子裝置之磁力計單元
US9626334B2 (en) Systems, apparatuses, and methods for K nearest neighbor search
CN104536720B (zh) 基于fpga的待测角三角函数值的测算方法及系统
CN113805974A (zh) 基于应用程序的数据类型选择
Li et al. HcveAcc: A high-performance and energy-efficient accelerator for tracking task in VSLAM system
WO2016121998A1 (ja) 情報マッチング装置及びその方法
CN105976314B (zh) 顾及相同中央投影经线的不同参考椭球投影平面坐标系统转换方法
CN109887013A (zh) 基于pca的点云配准最终确定方法及系统
US20240078691A1 (en) Model alignment method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17845029

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17845029

Country of ref document: EP

Kind code of ref document: A1