WO2020155224A1 - Method and device for calculating modulus of complex number based on modem - Google Patents

Method and device for calculating modulus of complex number based on modem Download PDF

Info

Publication number
WO2020155224A1
WO2020155224A1 PCT/CN2019/075687 CN2019075687W WO2020155224A1 WO 2020155224 A1 WO2020155224 A1 WO 2020155224A1 CN 2019075687 W CN2019075687 W CN 2019075687W WO 2020155224 A1 WO2020155224 A1 WO 2020155224A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
complex number
modulus
preset
atan
Prior art date
Application number
PCT/CN2019/075687
Other languages
French (fr)
Chinese (zh)
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 WO2020155224A1 publication Critical patent/WO2020155224A1/en

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/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L27/00Modulated-carrier systems
    • H04L27/26Systems using multi-frequency codes

Definitions

  • This application relates to the field of digital signal processing, in particular to a modem-based complex number modulus method, device, computer equipment and storage medium.
  • the main purpose of this application is to provide a modem-based method, device, computer equipment, and storage medium for modulating a complex number, which aims to reduce computing resources while ensuring the accuracy of the modulus of the complex number.
  • This application proposes a modem-based complex number modulus method, including the following steps:
  • the modulus of the complex number I+jQ is calculated according to the preset modulus formula.
  • This application provides a modem-based complex number modulus device, including:
  • the complex number generating unit is used to obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as the real part and the other as the imaginary part to generate a complex number I+ jQ;
  • the rotation processing unit is used to convert the complex number I+jQ into coordinate points (I, Q) in a rectangular coordinate system, and use a preset algorithm to rotate the coordinate points to obtain a rotating coordinate point ( I1,Q1);
  • the preset angle range judgment unit judges whether the value of atan (Q1/I1) is within the preset angle range
  • the complex modulus calculation unit is configured to calculate the modulus of the complex number I+jQ according to the preset modulus formula if the value of atan(Q1/I1) is within the preset angle range.
  • the present application provides a computer device including a memory and a processor, the memory stores a computer program, and the processor implements the steps of any one of the foregoing methods when the computer program is executed.
  • the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above methods are implemented.
  • the modem-based complex modulus method, device, computer equipment and storage medium provided in the present application obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and One of the cosine value and the sine value is used as the real part, and the other is used as the imaginary part to generate a complex number I+jQ;
  • the complex number I+jQ is correspondingly converted into a coordinate point (I, Q), and use a preset algorithm to rotate the coordinate points to obtain the rotated coordinate points (I1, Q1); determine whether the value of atan(Q1/I1) is within the preset angle range; if atan(Q1/ If the value of I1) is within the preset angle range, the modulus of the complex number I+jQ is calculated according to the preset modulus formula. Therefore, under the premise of ensuring the accuracy of the modulus of the complex number, the consumption of computational resources is reduced.
  • FIG. 1 is a schematic flowchart of a modem-based complex number modulus method according to an embodiment of this application;
  • FIG. 2 is a schematic block diagram of the structure of a modem-based complex number modulus apparatus according to an embodiment of the application;
  • FIG. 3 is a structural block diagram of a storage medium according to an embodiment of the application.
  • Fig. 4 is a structural block diagram of a computer device according to an embodiment of the application.
  • an embodiment of the present application provides a modem-based complex number modulus method, including the following steps:
  • step S1 obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as the real part, and the other as the imaginary part to generate a complex number I +jQ.
  • a modem is a kind of computer hardware that can translate the digital signal of the computer into an analog signal, and these analog signals can be received by another modem at the other end and translated into a language that the computer can recognize. This simple process completes the communication between the two computers. Among them, in the process of processing the signal, it is often necessary to calculate the modulus of the complex number.
  • the signal transmission generally uses a radio frequency carrier to transmit the radio frequency carrier signal.
  • the received radio frequency carrier signal can come from another modem.
  • the cosine value and the sine value of the radio frequency carrier signal to be processed and use one of the cosine value and the sine value as a real part and the other as an imaginary part to generate a complex number I+jQ.
  • the only parameters that can be changed for the RF carrier signal are cosine, frequency and sine. And sine is related to frequency. Therefore, the cosine and sine in the carrier signal are generally used as the two main modulation variables. Accordingly, the values of cosine and sine in the radio frequency carrier signal are extracted and recorded as complex numbers I+jQ.
  • I is the cosine in the radio frequency carrier signal
  • Q is the sine in the radio frequency carrier signal
  • I is the sine in the radio frequency carrier signal
  • Q is the all The cosine in the radio frequency carrier signal is acceptable.
  • the complex number I+jQ is correspondingly converted into coordinate points (I, Q) in a rectangular coordinate system, and a preset algorithm is used to rotate the coordinate points to obtain a rotated coordinate point (I1, Q1).
  • the preset algorithm for rotation processing can be any algorithm, preferably the CORDIC algorithm (Coordinate Rotation Digital Computer), where the CORDIC algorithm is the coordinate rotation digital calculation method, which replaces the multiplication operation by the basic addition and shift operation to make the vector rotation
  • the calculation of sum orientation no longer needs functions such as trigonometric function, multiplication, square root, inverse trigonometry, and exponent.
  • the CORDIC algorithm has multiple modes, among which the vector mode refers to the mode in which the direction of rotation is determined by judging the positive or negative of the Y axis of the coordinate point. Specifically, the CORDIC algorithm is used to perform rotation processing on the coordinate point (I, Q), so that the angle between the rotated coordinate point and the X axis of the planar rectangular coordinate system is reduced.
  • the X axis reading of the coordinate point is the modulus of the complex number I+jQ, that is Wherein, In is the X-axis direction reading of the coordinate point when the angle between the coordinate point and the X-axis approaches 0.
  • I+jQ the complex number
  • In the X-axis direction reading of the coordinate point when the angle between the coordinate point and the X-axis approaches 0.
  • the coordinate point at this time can be used as a basis for approximately calculating the modulus of the complex number I+jQ, and the computer resources consumed are greatly reduced.
  • the preset angle is, for example, (0, atan0.3), (0, atan0.25).
  • atan is the arctangent function, that is, the inverse function of the tangent function.
  • the modulus of the complex number I+jQ is calculated according to the preset modulus formula.
  • the preset modulus formula can be any formula, preferably:
  • alpha ⁇ max(
  • alpha ⁇ max(
  • ) can use appropriate parameters alpha, beta, predict
  • the parameters alpha and beta are obtained by querying the correspondence between the prestored angle and the parameter.
  • the corresponding relationship between the pre-stored angle and the parameter is, for example, (0,A) corresponding to the parameters alpha and beta are a1, b1, respectively, and [A, B) corresponding to the parameters alpha and beta are a2, b2, respectively.
  • the setting angle (0, atan0.25) corresponding to alpha and beta are 0.864458929403047 and 0.106419757324935 respectively.
  • this embodiment first uses a preset algorithm to perform rotation processing on the coordinate points corresponding to the complex number. After the rotation, if the value of atan(Q1/I1) is within the preset angle range, then the preset modulus formula is used to calculate Calculate the modulus of the complex number. Therefore, the number of rotations of the CORDIC algorithm is reduced under the premise of ensuring the accuracy of the modulus of the complex number.
  • the method includes:
  • the cosine value and the sine value of the radio frequency carrier signal to be processed are obtained, and one of the cosine value and the sine value is used as the real part, and the other is used as the imaginary part to generate a complex number I+jQ
  • the step S1 includes:
  • the complex number I+jQ is generated.
  • the smaller value of the absolute value of cosine and sine is recorded as Q, and the larger value is recorded as I.
  • the initial complex number I+jQ is transformed into the line between the coordinate point and the origin in the rectangular coordinate system, and the angle with the X axis is smaller, thereby reducing the number of rotations of the subsequent CORDIC algorithm.
  • sine may be negative, the absolute value is compared.
  • the complex number I+jQ is correspondingly converted into coordinate points (I, Q) in a plane rectangular coordinate system, and a preset algorithm is used to rotate the coordinate points to obtain a rotated coordinate point
  • Step S2 of (I1, Q1) includes:
  • x i+1 K i [x i -y i ⁇ d i ⁇ 2 -i ]
  • Ki cos( ⁇ i)
  • i is the number of rotations
  • ⁇ i is the angle of rotation during the i-th rotation
  • di -sign(yi).
  • the computer can use shift operations to perform rotation operations, which eliminates more multiplication operations and saves computing power compared to other rotation angles.
  • ⁇ atan 2 -i respectively represent clockwise rotation atan 2 -i degrees and counterclockwise rotation atan 2 -i degrees.
  • the CORDIC algorithm has multiple modes, among which the vector mode refers to the mode of determining the direction of rotation by judging the positive or negative of the Y axis of the coordinate point, that is, judging the direction of rotation by the positive or negative of the Q value.
  • the vector mode using the CORDIC algorithm performs rotation processing on the coordinate point (I, Q) around the origin to obtain the rotated coordinate point (I1, Q1) after the rotation processing, wherein the rotation processing
  • the step S202 where the single rotation angle of is ⁇ atan 2 -i includes:
  • the vector mode using the CORDIC algorithm is implemented to rotate the coordinate point (I, Q) around the origin. If the Q value is positive, the coordinate point (I, Q) should be rotated clockwise, that is, the rotation angle of atan 2 -i should be performed around the origin, so that the coordinate point (I, Q) is close to the X axis; if the Q value is negative, the coordinate point (I, Q) should be rotated counterclockwise, that is, the rotation angle of -atan 2 -i is performed around the origin to make The coordinate point (I, Q) is close to the X axis.
  • the step S4 of calculating the modulus of the complex number I+jQ according to a preset modulus formula includes:
  • alpha ⁇ max(
  • ) is used to calculate the modulus of the complex number. If the value of atan(Q1/I1) is within the preset angle range, it indicates that the values of the parameters alpha and beta can be obtained according to the corresponding relationship between the prestored angle and the parameters, and then the values of the parameters alpha and beta are inserted into the formula
  • alpha ⁇ max(
  • the step S4 of calculating the modulus of the complex number I+jQ according to a preset modulus formula includes:
  • the calculation accuracy of the modulus of the complex number is further improved.
  • the more the number of rotations of the preset algorithm such as CORDIC algorithm the higher the precision of the complex number modulus obtained by the subsequent processing. If the number of rotations of the rotation processing is greater than the preset rotation threshold, it indicates that sufficient computing resources have been consumed, and the rotation should not be continued to consume computing resources.
  • the preset modulus formula can already be used, for example, the formula:
  • alpha ⁇ max(
  • the rotation threshold is, for example, 3-10 times.
  • the modem-based complex number modulus method of the present application obtains the cosine value and the sine value of the radio frequency carrier signal to be processed, and uses one of the cosine value and the sine value as the real part and the other as the imaginary part.
  • the part generates a complex number I+jQ; correspondingly transforms the complex number I+jQ into a coordinate point (I, Q) in a rectangular coordinate system, and uses a preset algorithm to rotate the coordinate point to obtain a rotated coordinate point (I1,Q1); Determine whether the value of atan(Q1/I1) is within the preset angle range; if the value of atan(Q1/I1) is within the preset angle range, calculate the value according to the preset modulus formula The modulus of the complex number I+jQ. Therefore, under the premise of ensuring the accuracy of the modulus of the complex number, the consumption of computational resources is reduced.
  • an embodiment of the present application provides a modem-based complex number modulus device, including:
  • the complex number generating unit 1 is used to obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as the real part and the other as the imaginary part to generate a complex number I +jQ;
  • the rotation processing unit 2 is configured to correspondingly convert the complex number I+jQ into coordinate points (I, Q) in a plane rectangular coordinate system, and use a preset algorithm to rotate the coordinate points to obtain a rotating coordinate point (I1,Q1);
  • the preset angle range judgment unit 3 judges whether the value of atan (Q1/I1) is within the preset angle range
  • the complex modulus calculation unit 4 is configured to calculate the modulus of the complex number I+jQ according to the preset modulus formula when the value of atan(Q1/I1) is in the preset angle range.
  • a modem is a kind of computer hardware that can translate the digital signal of the computer into an analog signal, and these analog signals can be received by another modem at the other end and translated into a language that the computer can recognize. This simple process completes the communication between the two computers. Among them, in the process of processing the signal, it is often necessary to calculate the modulus of the complex number.
  • the signal transmission generally uses a radio frequency carrier to transmit the radio frequency carrier signal. The received radio frequency carrier signal can come from another modem.
  • the cosine value and the sine value of the radio frequency carrier signal to be processed and use one of the cosine value and the sine value as a real part and the other as an imaginary part to generate a complex number I+jQ.
  • the only parameters that can be changed for the RF carrier signal are cosine, frequency and sine. And sine is related to frequency. Therefore, the cosine and sine in the carrier signal are generally used as the two main modulation variables. Accordingly, the values of cosine and sine in the radio frequency carrier signal are extracted and recorded as complex numbers I+jQ.
  • I is the cosine in the radio frequency carrier signal
  • Q is the sine in the radio frequency carrier signal
  • I is the sine in the radio frequency carrier signal
  • Q is the all The cosine in the radio frequency carrier signal is acceptable.
  • the complex number I+jQ is correspondingly converted into coordinate points (I, Q) in a rectangular coordinate system, and the coordinate points are rotated by a preset algorithm to obtain the rotated coordinate points (I1, Q1).
  • the preset algorithm for rotation processing can be any algorithm, preferably the CORDIC algorithm (Coordinate Rotation Digital Computer), where the CORDIC algorithm is the coordinate rotation digital calculation method, which replaces the multiplication operation by the basic addition and shift operation to make the vector rotation
  • the calculation of sum orientation no longer needs functions such as trigonometric function, multiplication, square root, inverse trigonometry, and exponent.
  • the CORDIC algorithm has multiple modes, among which the vector mode refers to the mode in which the direction of rotation is determined by judging the positive or negative of the Y axis of the coordinate point. Specifically, the CORDIC algorithm is used to perform rotation processing on the coordinate point (I, Q), so that the angle between the rotated coordinate point and the X axis of the planar rectangular coordinate system is reduced.
  • the X axis reading of the coordinate point is the modulus of the complex number I+jQ, that is Wherein, In is the X-axis direction reading of the coordinate point when the angle between the coordinate point and the X-axis approaches 0.
  • I+jQ the complex number
  • In the X-axis direction reading of the coordinate point when the angle between the coordinate point and the X-axis approaches 0.
  • the coordinate point at this time can be used as a basis for approximately calculating the modulus of the complex number I+jQ, and the computer resources consumed are greatly reduced.
  • the preset angle is, for example, (0, atan0.3), (0, atan0.25).
  • atan is the arctangent function, that is, the inverse function of the tangent function.
  • the modulus of the complex number I+jQ is calculated according to the preset modulus formula.
  • the preset modulus formula can be any formula, preferably:
  • alpha ⁇ max(
  • alpha ⁇ max(
  • ) can use appropriate parameters alpha, beta, predict
  • the parameters alpha and beta are obtained by querying the correspondence between the prestored angle and the parameter.
  • the corresponding relationship between the pre-stored angle and the parameter is, for example, (0,A) corresponding to the parameters alpha and beta are a1, b1, respectively, and [A, B) corresponding to the parameters alpha and beta are a2, b2, respectively.
  • the setting angle (0, atan0.25) corresponding to alpha and beta are 0.864458929403047 and 0.106419757324935 respectively.
  • this embodiment first uses a preset algorithm to perform rotation processing on the coordinate points corresponding to the complex number. After the rotation, if the value of atan(Q1/I1) is within the preset angle range, then the preset modulus formula is used to calculate Find the modulus of the complex number. Therefore, the number of rotations of the CORDIC algorithm is reduced under the premise of ensuring the accuracy of the modulus of the complex number.
  • the device includes:
  • the continuous rotation unit is configured to continue to use the preset algorithm to perform rotation processing on the coordinate points (I1, Q1) when the value of the atan(Q1/I1) is not within the preset angle range.
  • the complex number generating unit 1 includes:
  • An absolute value judging subunit for judging whether the absolute value of the cosine value is greater than the absolute value of the sine value
  • the first complex number generating subunit is configured to use I as the cosine value in the radio frequency carrier signal and Q as the cosine value in the radio frequency carrier signal when the absolute value of the cosine value is greater than the absolute value of the sine value.
  • the second complex number generating subunit is used for when the absolute value of the cosine value is not greater than the absolute value of the sine value, using I as the sine value in the radio frequency carrier signal and Q as the radio frequency carrier signal The sine value of, thereby generating a complex number I+jQ.
  • the complex number I+jQ is generated.
  • the smaller value of the absolute value of cosine and sine is recorded as Q, and the larger value is recorded as I.
  • the initial complex number I+jQ is transformed into the line between the coordinate point and the origin in the rectangular coordinate system, and the angle with the X axis is smaller, thereby reducing the number of rotations of the subsequent CORDIC algorithm.
  • sine may be negative, the absolute value is compared.
  • the rotation processing unit 2 includes:
  • the plane rectangular coordinate establishment subunit is used to establish a plane rectangular coordinate system, with the cosine or the sine as the X axis, the sine or the cosine as the Y axis, and correspondingly transform the complex number I+jQ into the The coordinate point (I, Q) in the plane rectangular coordinate system;
  • the rotation processing subunit is used to perform rotation processing on the coordinate point (I, Q) around the origin using the vector mode of the CORDIC algorithm to obtain the rotation coordinate point (I1, Q1) after the rotation processing, wherein the rotation processing
  • the single rotation angle of is ⁇ atan 2 -i , and the number of rotations is recorded as i times.
  • x i+1 K i [x i -y i ⁇ d i ⁇ 2 -i ]
  • Ki cos( ⁇ i)
  • i is the number of rotations
  • ⁇ i is the angle of rotation during the i-th rotation
  • di -sign(yi).
  • the computer can use shift operations to perform rotation operations, which eliminates more multiplication operations and saves computing power compared to other rotation angles.
  • ⁇ atan 2 -i respectively represent clockwise rotation atan 2 -i degrees and counterclockwise rotation atan 2 -i degrees.
  • the CORDIC algorithm has multiple modes, among which the vector mode refers to the mode of determining the direction of rotation by judging the positive or negative of the Y axis of the coordinate point, that is, judging the direction of rotation by the positive or negative of the Q value.
  • the rotation processing sub-unit includes:
  • the Q value judgment module is used to judge whether the Q value is a positive number
  • the first rotation processing module is used for when the Q value is positive, the vector mode of the CORDIC algorithm is used to rotate the coordinate point (I, Q) around the origin by a rotation angle of atan 2 -i to obtain The rotation coordinate point (I1, Q1) after the rotation processing;
  • the second rotation processing module is used for when the Q value is not a positive number, the vector mode of the CORDIC algorithm is used to perform rotation processing on the coordinate point (I, Q) around the origin by an angle of -atan 2 -i , Obtain the rotation coordinate point (I1, Q1) after the rotation processing.
  • the vector mode using the CORDIC algorithm is implemented to rotate the coordinate point (I, Q) around the origin. If the Q value is positive, the coordinate point (I, Q) should be rotated clockwise, that is, the rotation angle of atan 2 -i should be performed around the origin, so that the coordinate point (I, Q) is close to the X axis; if the Q value is negative, the coordinate point (I, Q) should be rotated counterclockwise, that is, the rotation angle of -atan 2 -i is performed around the origin to make The coordinate point (I, Q) is close to the X axis.
  • the complex number modulus calculation unit 4 includes:
  • alpha ⁇ max(
  • ) is used to calculate the modulus of the complex number. If the value of atan(Q1/I1) is within the preset angle range, it indicates that the values of the parameters alpha and beta can be obtained according to the corresponding relationship between the prestored angle and the parameters, and then the values of the parameters alpha and beta are inserted into the formula
  • alpha ⁇ max(
  • the complex number modulus calculation unit 4 includes:
  • the number of rotations threshold judging subunit is used to determine whether the number of rotations of the rotation processing is greater than the preset number of rotations threshold when the value of atan(Q1/I1) is within the preset angle range;
  • the complex modulus calculation subunit is configured to calculate the modulus of the complex number I+jQ according to the preset modulus calculation formula when the rotation number of the rotation processing is greater than a preset rotation number threshold.
  • the calculation accuracy of the modulus of the complex number is further improved.
  • the more the number of rotations of the preset algorithm such as CORDIC algorithm the higher the precision of the complex number modulus obtained by the subsequent processing. If the number of rotations of the rotation processing is greater than the preset rotation threshold, it indicates that sufficient computing resources have been consumed, and the rotation should not be continued to consume computing resources.
  • the preset modulus formula can already be used, for example, the formula:
  • alpha ⁇ max(
  • the rotation threshold is, for example, 3-10 times.
  • the modem-based complex number modulus device of the present application obtains the cosine value and the sine value of the radio frequency carrier signal to be processed, and uses one of the cosine value and the sine value as the real part and the other as the imaginary part.
  • the part generates a complex number I+jQ; correspondingly transforms the complex number I+jQ into a coordinate point (I, Q) in a rectangular coordinate system, and uses a preset algorithm to rotate the coordinate point to obtain a rotated coordinate point (I1,Q1); Determine whether the value of atan(Q1/I1) is within the preset angle range; if the value of atan(Q1/I1) is within the preset angle range, calculate the value according to the preset modulus formula The modulus of the complex number I+jQ. Therefore, under the premise of ensuring the accuracy of the modulus of the complex number, the consumption of computational resources is reduced.
  • the present application also provides a computer-readable storage medium 10 on which a computer program 11 is stored.
  • the computer program 11 is executed by a processor, the modem-based complex number request as described in the above embodiment is implemented.
  • the steps of the model method are described in the above embodiment.
  • the present application also provides a computer device 20, including a memory 22 and a processor 21, the memory stores a computer program 221, the processor executes the computer program 221 as described in the above embodiment Describe the steps of the modem-based complex number modulus method.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a storage medium, or transmitted from one storage medium to another storage medium.
  • the computer instructions may be sent from a website, computer, server, or data center through wired (such as coaxial cable, optical fiber) , Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website site, computer, server or data center.
  • wired such as coaxial cable, optical fiber
  • DSL Digital Subscriber Line
  • wireless such as infrared, wireless, microwave, etc.
  • the storage medium may be any available medium that can be stored by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Digital Transmission Methods That Use Modulated Carrier Waves (AREA)

Abstract

Disclosed are a method and a device for calculating the modulus of a complex number based on a modem, the method comprising: acquiring the cosine value and sine value of a radio frequency carrier signal to be processed and generating a complex number I+jQ; correspondingly converting the complex number I+jQ into coordinate points (I, Q), and rotating the coordinate points to obtain the rotated coordinate points (I1, Q1); and if the value of atan(Q1/I1) falls within a preset angle range, calculating the modulus of the complex number I+jQ, so that the consumption of computing resources is reduced while ensuring the precise of the module.

Description

基于调制解调器的复数求模方法和装置Modem-based complex number modulus method and device 技术领域Technical field
本申请涉及到数字信号处理领域,特别是涉及到一种基于调制解调器的复数求模方法、装置、计算机设备和存储介质。This application relates to the field of digital signal processing, in particular to a modem-based complex number modulus method, device, computer equipment and storage medium.
背景技术Background technique
在通讯领域中,例如在数字信号处理过程中,例如在调制解调器的数字信号处理,经常需要对复数进行求模运算,一般对于复数的求模运算,需要2次乘法和1平方根运算,耗费的计算资源很大。作为代替,现有技术使用近似算法以减少计算量,但仍存在问题:需要耗费大量的计算资源,或者计算出的模的精度不高。例如,采用CORDIC算法求出复数的模,通常需要多次旋转处理(例如16次),需要耗费大量的计算资源;采用alpha*max(|x|,|y|)+beta*min(|x|,|y|)计算复数x+jy的模,虽然计算量变小了,但是计算出的模的精度较低。In the communication field, such as in the digital signal processing process, such as the digital signal processing of the modem, it is often necessary to perform modulo operation on complex numbers. Generally, the modulo operation of complex numbers requires 2 multiplications and 1 square root operation, which is costly calculation Resources are great. Instead, the prior art uses approximate algorithms to reduce the amount of calculation, but there are still problems: it needs to consume a lot of calculation resources, or the accuracy of the calculated modulus is not high. For example, using the CORDIC algorithm to find the modulus of a complex number usually requires multiple rotations (for example, 16 times), which requires a lot of computing resources; using alpha*max(|x|, |y|)+beta*min(|x |, |y|) Calculate the modulus of the complex number x+jy. Although the amount of calculation becomes smaller, the accuracy of the calculated modulus is lower.
技术问题technical problem
本申请的主要目的为提供一种基于调制解调器的复数求模方法、装置、计算机设备和存储介质,旨在保证复数的模的精度的前提下,减少计算资源。The main purpose of this application is to provide a modem-based method, device, computer equipment, and storage medium for modulating a complex number, which aims to reduce computing resources while ensuring the accuracy of the modulus of the complex number.
技术解决方案Technical solutions
本申请提出一种基于调制解调器的复数求模方法,包括以下步骤:This application proposes a modem-based complex number modulus method, including the following steps:
获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ;Obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as a real part and the other as an imaginary part to generate a complex number I+jQ;
将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1);Correspondingly convert the complex number I+jQ into coordinate points (I, Q) in a rectangular coordinate system, and use a preset algorithm to rotate the coordinate points to obtain a rotated coordinate point (I1, Q1);
判断atan(Q1/I1)的值是否处于预设角度范围内;Determine whether the value of atan(Q1/I1) is within the preset angle range;
若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模。If the value of atan(Q1/I1) is within the preset angle range, the modulus of the complex number I+jQ is calculated according to the preset modulus formula.
本申请提供一种基于调制解调器的复数求模装置,包括:This application provides a modem-based complex number modulus device, including:
复数生成单元,用于获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ;The complex number generating unit is used to obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as the real part and the other as the imaginary part to generate a complex number I+ jQ;
旋转处理单元,用于将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1);The rotation processing unit is used to convert the complex number I+jQ into coordinate points (I, Q) in a rectangular coordinate system, and use a preset algorithm to rotate the coordinate points to obtain a rotating coordinate point ( I1,Q1);
预设角度范围判断单元,判断atan(Q1/I1)的值是否处于预设角度范围内;The preset angle range judgment unit judges whether the value of atan (Q1/I1) is within the preset angle range;
复数的模计算单元,用于若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模。The complex modulus calculation unit is configured to calculate the modulus of the complex number I+jQ according to the preset modulus formula if the value of atan(Q1/I1) is within the preset angle range.
本申请提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现上述任一项所述方法的步骤。The present application provides a computer device including a memory and a processor, the memory stores a computer program, and the processor implements the steps of any one of the foregoing methods when the computer program is executed.
本申请提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的方法的步骤。The present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above methods are implemented.
有益效果Beneficial effect
本申请与现有技术相比,有益效果在于:本申请提供的基于调制解调器的复数求模方法、装置、计算机设备和存储介质,获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ;将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1);判断atan(Q1/I1)的值是否处于预设角度范围内;若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模。从而在保证复数的模的精度的前提下,减少了耗费的计算资源。Compared with the prior art, the present application has the beneficial effects that: the modem-based complex modulus method, device, computer equipment and storage medium provided in the present application obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and One of the cosine value and the sine value is used as the real part, and the other is used as the imaginary part to generate a complex number I+jQ; the complex number I+jQ is correspondingly converted into a coordinate point (I, Q), and use a preset algorithm to rotate the coordinate points to obtain the rotated coordinate points (I1, Q1); determine whether the value of atan(Q1/I1) is within the preset angle range; if atan(Q1/ If the value of I1) is within the preset angle range, the modulus of the complex number I+jQ is calculated according to the preset modulus formula. Therefore, under the premise of ensuring the accuracy of the modulus of the complex number, the consumption of computational resources is reduced.
附图说明Description of the drawings
图1为本申请一实施例的基于调制解调器的复数求模方法的流程示意图;FIG. 1 is a schematic flowchart of a modem-based complex number modulus method according to an embodiment of this application;
图2为本申请一实施例的基于调制解调器的复数求模装置的结构示意框图;2 is a schematic block diagram of the structure of a modem-based complex number modulus apparatus according to an embodiment of the application;
图3为本申请一实施例的存储介质的结构框图;3 is a structural block diagram of a storage medium according to an embodiment of the application;
图4为本申请一实施例的计算机设备的结构框图。Fig. 4 is a structural block diagram of a computer device according to an embodiment of the application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the drawings.
本申请的最佳实施方式The best implementation of this application
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the application, and not to limit the application.
参照图1,本申请实施例提供一种基于调制解调器的复数求模方法,包括以下步骤:1, an embodiment of the present application provides a modem-based complex number modulus method, including the following steps:
S1、获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余 弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ;S1. Obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as the real part and the other as the imaginary part to generate a complex number I+jQ;
S2、将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1);S2. Convert the complex number I+jQ into coordinate points (I, Q) in a rectangular coordinate system, and use a preset algorithm to rotate the coordinate points to obtain a rotated coordinate point (I1, Q1) ;
S3、判断atan(Q1/I1)的值是否处于预设角度范围内;S3. Determine whether the value of atan(Q1/I1) is within the preset angle range;
S4、若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模。S4. If the value of atan(Q1/I1) is within the preset angle range, calculate the modulus of the complex number I+jQ according to the preset modulus formula.
如上述步骤S1所述,获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ。调制解调器是一种计算机硬件,它能把计算机的数字信号翻译成模拟信号,而这些模拟信号又可被另一端的另一个调制解调器接收,并译成计算机可识别的语言。这一简单过程完成了两台计算机间的通信。其中,在对信号进行处理的过程中,经常需要采用对复数的模的计算。其中,信号的传递一般采用射频载波,以传递射频载波信号。其中接收的射频载波信号可以来自另一个调制解调器。获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ。射频载波信号可供改变的参数只有余弦、频率和正弦三种。而正弦与频率相关。因此一般以载波信号中的余弦和正弦,作为两个主要的调制变量。据此,提取所述射频载波信号中的余弦和正弦的数值,记为复数I+jQ。由于本实施方式用于计算复数的模,因此I为所述射频载波信号中的余弦,Q为所述射频载波信号中的正弦,或者,I为所述射频载波信号中的正弦,Q为所述射频载波信号中的余弦,均可行。As described in step S1 above, obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as the real part, and the other as the imaginary part to generate a complex number I +jQ. A modem is a kind of computer hardware that can translate the digital signal of the computer into an analog signal, and these analog signals can be received by another modem at the other end and translated into a language that the computer can recognize. This simple process completes the communication between the two computers. Among them, in the process of processing the signal, it is often necessary to calculate the modulus of the complex number. Among them, the signal transmission generally uses a radio frequency carrier to transmit the radio frequency carrier signal. The received radio frequency carrier signal can come from another modem. Obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as a real part and the other as an imaginary part to generate a complex number I+jQ. The only parameters that can be changed for the RF carrier signal are cosine, frequency and sine. And sine is related to frequency. Therefore, the cosine and sine in the carrier signal are generally used as the two main modulation variables. Accordingly, the values of cosine and sine in the radio frequency carrier signal are extracted and recorded as complex numbers I+jQ. Since this embodiment is used to calculate the modulus of a complex number, I is the cosine in the radio frequency carrier signal, Q is the sine in the radio frequency carrier signal, or I is the sine in the radio frequency carrier signal, and Q is the all The cosine in the radio frequency carrier signal is acceptable.
如上述步骤S2所述,将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1)。其中,进行旋转处理的预设算法可以为任意算法,优选CORDIC算法(Coordinate Rotation Digital Computer),其中CORDIC算法即坐标旋转数字计算方法,通过基本的加和移位运算代替乘法运算,使得矢量的旋转和定向的计算不再需要三角函数、乘法、开方、反三角、指数等函数。CORDIC算法具有多种模式,其中的矢量模式指,通过判断坐标点的Y轴的正负,以确定旋转方向的模式。具体地,采用CORDIC算法对所述坐标点(I,Q)进行旋转处理,使旋转后的坐标点与平面直角坐标系的X轴的夹角变小。As described in step S2 above, the complex number I+jQ is correspondingly converted into coordinate points (I, Q) in a rectangular coordinate system, and a preset algorithm is used to rotate the coordinate points to obtain a rotated coordinate point (I1, Q1). Among them, the preset algorithm for rotation processing can be any algorithm, preferably the CORDIC algorithm (Coordinate Rotation Digital Computer), where the CORDIC algorithm is the coordinate rotation digital calculation method, which replaces the multiplication operation by the basic addition and shift operation to make the vector rotation The calculation of sum orientation no longer needs functions such as trigonometric function, multiplication, square root, inverse trigonometry, and exponent. The CORDIC algorithm has multiple modes, among which the vector mode refers to the mode in which the direction of rotation is determined by judging the positive or negative of the Y axis of the coordinate point. Specifically, the CORDIC algorithm is used to perform rotation processing on the coordinate point (I, Q), so that the angle between the rotated coordinate point and the X axis of the planar rectangular coordinate system is reduced.
如上述步骤S3所述,判断atan(Q1/I1)的值是否处于预设角度范围内。预设算法例如CORDIC算法旋转次数足够多,能够使坐标点与X轴的夹角趋近于0,此时的坐标点的X轴方向读数即为复数I+jQ的模,即
Figure PCTCN2019075687-appb-000001
Figure PCTCN2019075687-appb-000002
其中,In是坐标点与X轴的夹角趋近于0时所述坐标点的X轴方向读数。但是要使坐标点与X轴的夹角趋近于0,需要旋转次数过多,需要大量的计算机资源。而若atan(Q1/I1)的值处于预设角度范围内,此时的坐标点已能做为近似计算出复数I+jQ的模的依据,耗费的计算机资源大大减少。其中预设角度例如为(0,atan0.3)、(0,atan0.25)。其中,atan是反正切函数,即正切函数的反函数。
As described in the above step S3, it is determined whether the value of atan(Q1/I1) is within the preset angle range. The preset algorithm such as the CORDIC algorithm has enough rotation times to make the angle between the coordinate point and the X axis approach 0. At this time, the X axis reading of the coordinate point is the modulus of the complex number I+jQ, that is
Figure PCTCN2019075687-appb-000001
Figure PCTCN2019075687-appb-000002
Wherein, In is the X-axis direction reading of the coordinate point when the angle between the coordinate point and the X-axis approaches 0. However, to make the angle between the coordinate point and the X axis approach 0, too many rotations are required, and a lot of computer resources are required. If the value of atan(Q1/I1) is within the preset angle range, the coordinate point at this time can be used as a basis for approximately calculating the modulus of the complex number I+jQ, and the computer resources consumed are greatly reduced. The preset angle is, for example, (0, atan0.3), (0, atan0.25). Among them, atan is the arctangent function, that is, the inverse function of the tangent function.
如上述步骤S4所述,若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模。其中,预设求模公式可为任意公式,优选为:|I+jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|)。其中,公式|I+jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|)能够利用合适的参数alpha、beta,预估所述复数的模的数值,参数alpha、beta通过查询预存的角度与参数对应关系获得。预存的角度与参数对应关系例如为,(0,A)对应参数alpha、beta分别为a1、b1,[A,B)对应参数alpha、beta分别为a2、b2……。优选地,设置角度(0,atan0.25)对应alpha、beta分别为0.864458929403047、0.106419757324935。As described in step S4, if the value of atan(Q1/I1) is within the preset angle range, the modulus of the complex number I+jQ is calculated according to the preset modulus formula. Among them, the preset modulus formula can be any formula, preferably: |I+jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1 |). Among them, the formula |I+jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|) can use appropriate parameters alpha, beta, predict To estimate the value of the modulus of the complex number, the parameters alpha and beta are obtained by querying the correspondence between the prestored angle and the parameter. The corresponding relationship between the pre-stored angle and the parameter is, for example, (0,A) corresponding to the parameters alpha and beta are a1, b1, respectively, and [A, B) corresponding to the parameters alpha and beta are a2, b2, respectively. Preferably, the setting angle (0, atan0.25) corresponding to alpha and beta are 0.864458929403047 and 0.106419757324935 respectively.
综上,本实施方式通过先对复数对应的坐标点,采用预设算法进行旋转处理,在旋转后若atan(Q1/I1)的值处于预设角度范围内,再采用预设求模公式求出所述复数的模。从而在保证复数的模的值的精度的前提下,减少了CORDIC算法的旋转次数。In summary, this embodiment first uses a preset algorithm to perform rotation processing on the coordinate points corresponding to the complex number. After the rotation, if the value of atan(Q1/I1) is within the preset angle range, then the preset modulus formula is used to calculate Calculate the modulus of the complex number. Therefore, the number of rotations of the CORDIC algorithm is reduced under the premise of ensuring the accuracy of the modulus of the complex number.
一个实施方式中,所述判断atan(Q1/I1)的值是否处于预设角度范围内的步骤S3之后,包括:In one embodiment, after the step S3 of judging whether the value of atan(Q1/I1) is within the preset angle range, the method includes:
S31、若所述atan(Q1/I1)的值不处于预设角度范围内,则继续采用所述预设算法对所述坐标点(I1,Q1)进行旋转处理。S31. If the value of atan(Q1/I1) is not within a preset angle range, continue to use the preset algorithm to perform rotation processing on the coordinate points (I1, Q1).
如上所述,实现了继续旋转处理。若所述atan(Q1/I1)的值不处于预设角度范围内,表明所述CORDIC算法行旋转处理的旋转次数不够,不足以采用后续的预设求模公式求出所述复数的模。因此还需要继续采用所述预设算法对所述坐标点(I1,Q1)进行旋转处理。As described above, continuous rotation processing is realized. If the value of atan(Q1/I1) is not within the preset angle range, it indicates that the number of rotations of the CORDIC algorithm for rotation processing is insufficient, and the subsequent preset modulus formula is not enough to obtain the modulus of the complex number. Therefore, it is also necessary to continue to use the preset algorithm to perform rotation processing on the coordinate points (I1, Q1).
一个实施方式中,获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ的步骤S1,包括:In one embodiment, the cosine value and the sine value of the radio frequency carrier signal to be processed are obtained, and one of the cosine value and the sine value is used as the real part, and the other is used as the imaginary part to generate a complex number I+jQ The step S1 includes:
S101、判断所述余弦数值的绝对值是否大于所述正弦数值的绝对值;S101. Determine whether the absolute value of the cosine value is greater than the absolute value of the sine value;
S102、若所述余弦数值的绝对值大于所述正弦数值的绝对值,则将I作为所述射频载波信号中的余弦数值,将Q作为所述射频载波信号中的正弦数值,从而生成复数I+jQ;S102. If the absolute value of the cosine value is greater than the absolute value of the sine value, use I as the cosine value in the radio frequency carrier signal and Q as the sine value in the radio frequency carrier signal, thereby generating a complex number I +jQ;
S103、若所述余弦数值的绝对值不大于所述正弦数值的绝对值,则将I作为所述射频载波信号中的正弦数值,将Q作为所述射频载波信号中的正弦数值,从而生成复数I+jQ。S103. If the absolute value of the cosine value is not greater than the absolute value of the sine value, use I as the sine value in the radio frequency carrier signal and Q as the sine value in the radio frequency carrier signal, thereby generating a complex number I+jQ.
如上所述,实现了生成复数I+jQ。为了减少后续的预设算法的旋转次数,将余弦和正弦的绝对值中较小的数值记为Q,较大的数值记为I。从而使初始的复数I+jQ转化为平面直角坐标系中的坐标点与原点的连线,与X轴的角度更小,进而减少后续的CORDIC算法的旋转次数。其中,由于正弦可能为负数,因此进行绝对值的大小比较。As described above, the complex number I+jQ is generated. In order to reduce the number of rotations of the subsequent preset algorithm, the smaller value of the absolute value of cosine and sine is recorded as Q, and the larger value is recorded as I. In this way, the initial complex number I+jQ is transformed into the line between the coordinate point and the origin in the rectangular coordinate system, and the angle with the X axis is smaller, thereby reducing the number of rotations of the subsequent CORDIC algorithm. Among them, since sine may be negative, the absolute value is compared.
一个实施方式中,所述将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1)的步骤S2,包括:In one embodiment, the complex number I+jQ is correspondingly converted into coordinate points (I, Q) in a plane rectangular coordinate system, and a preset algorithm is used to rotate the coordinate points to obtain a rotated coordinate point Step S2 of (I1, Q1) includes:
S201、建立平面直角坐标系,以所述余弦或者所述正弦作为X轴,所述正弦或者所述余弦作为Y轴,将所述复数I+jQ对应转化为所述平面直角坐标系中的坐标点(I,Q);S201. Establish a planar rectangular coordinate system, use the cosine or the sine as the X axis, and the sine or the cosine as the Y axis, and convert the complex number I+jQ into coordinates in the planar rectangular coordinate system. Point (I, Q);
S202、采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1),其中所述旋转处理的单次旋转角度为±atan 2 -i,其中进行旋转的次数记为i次。 S202. Use the vector mode of the CORDIC algorithm to perform rotation processing on the coordinate point (I, Q) around the origin to obtain the rotation coordinate point (I1, Q1) after the rotation processing, wherein the single rotation angle of the rotation processing is Is ±atan 2 -i , where the number of rotations is recorded as i times.
如上所述,实现了获得旋转处理后的坐标点(I1,Q1)。As mentioned above, the coordinate point (I1, Q1) after the rotation processing is obtained.
Cordic算法的迭代公式为:The iterative formula of Cordic algorithm is:
x i+1=K i[x i-y i·d i·2 -i] x i+1 =K i [x i -y i ·d i ·2 -i ]
y i+1=K i[y i+x i·d i·2 -i] y i+1 =K i [y i +x i ·d i ·2 -i ]
其中,Ki=cos(θi),i为旋转的次数,θi为第i次旋转时旋转的角度值,di=-sign(yi)。其中sign函数的功能是取某个数的符号(正或负):当x>0,sign(x)=1;当x=0,sign(x)=0;当x<0,sign(x)=-1。由此可知,旋转后的坐标点(xi+1,yi+1)与旋转前的坐标点(xi,yi)相比,是通过旋转±atan 2 -i得到的,其中。并且,通过旋转±atan 2 -i的方式,使得计算机能够采用移位操作进行旋转操作,而免去了更多次的乘法运算,相较于其他的旋转角度,节省了算力。其中,±atan 2 -i分别表示顺时针旋转atan 2 -i度与逆时针旋转atan 2 -i度。其中,CORDIC算法具有多种模式,其中的矢量模式指,通过判断坐标点的Y轴的正负,以确定旋转方向的模式,即以Q值的正负判断旋转方向。 Among them, Ki=cos(θi), i is the number of rotations, θi is the angle of rotation during the i-th rotation, and di=-sign(yi). The function of the sign function is to take the sign (positive or negative) of a certain number: when x>0, sign(x)=1; when x=0, sign(x)=0; when x<0, sign(x) )=-1. It can be seen that the coordinate point (xi+1, yi+1) after rotation is compared with the coordinate point (xi, yi) before rotation, which is obtained by rotating ±atan 2 -i . In addition, by rotating ±atan 2 -i , the computer can use shift operations to perform rotation operations, which eliminates more multiplication operations and saves computing power compared to other rotation angles. Among them, ±atan 2 -i respectively represent clockwise rotation atan 2 -i degrees and counterclockwise rotation atan 2 -i degrees. Among them, the CORDIC algorithm has multiple modes, among which the vector mode refers to the mode of determining the direction of rotation by judging the positive or negative of the Y axis of the coordinate point, that is, judging the direction of rotation by the positive or negative of the Q value.
一个实施方式中,所述采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1),其中所述旋转处理的单次旋转角度为±atan 2 -i的步骤S202,包括: In an embodiment, the vector mode using the CORDIC algorithm performs rotation processing on the coordinate point (I, Q) around the origin to obtain the rotated coordinate point (I1, Q1) after the rotation processing, wherein the rotation processing The step S202 where the single rotation angle of is ±atan 2 -i includes:
S2021、判断所述Q值是否为正数;S2021: Determine whether the Q value is a positive number;
S2022、若是,则采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转角度为atan 2 -i的旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1); S2022, if yes, use the vector mode of the CORDIC algorithm to perform rotation processing on the coordinate point (I, Q) around the origin by a rotation angle of atan 2 -i , to obtain the rotated coordinate point (I1, Q1) after the rotation processing ;
S2023、若否,则采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转角度为-atan 2 -i的旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1)。 S2023. If not, use the vector mode of the CORDIC algorithm to perform rotation processing on the coordinate point (I, Q) around the origin with a rotation angle of -atan 2 -i to obtain the rotated coordinate point (I1, Q1).
如上所述,实现了采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转处理。若所述Q值为正值,则应对所述坐标点(I,Q)进行顺时针旋转处理,即绕原点进行旋转角度为atan 2 -i的旋转处理,以使所述坐标点(I,Q)靠近X轴;若所述Q值为负值,则应对所述坐标点(I,Q)进行逆时针旋转处理,即绕原点进行旋转角度为-atan 2 -i的旋转处理,以使所述坐标点(I,Q)靠近X轴。 As described above, the vector mode using the CORDIC algorithm is implemented to rotate the coordinate point (I, Q) around the origin. If the Q value is positive, the coordinate point (I, Q) should be rotated clockwise, that is, the rotation angle of atan 2 -i should be performed around the origin, so that the coordinate point (I, Q) is close to the X axis; if the Q value is negative, the coordinate point (I, Q) should be rotated counterclockwise, that is, the rotation angle of -atan 2 -i is performed around the origin to make The coordinate point (I, Q) is close to the X axis.
一个实施方式中,所述若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模的步骤S4,包括:In one embodiment, if the value of atan(Q1/I1) is within a preset angle range, the step S4 of calculating the modulus of the complex number I+jQ according to a preset modulus formula includes:
S401、若atan(Q1/I1)的值处于预设角度范围内,则采用公式:|I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|),计算出所述复数的模,其中,|I+jQ|为复数I+jQ的模,参数alpha、beta通过查询预存的角度与参数对应关系获得。S401. If the value of atan(Q1/I1) is within the preset angle range, the formula is adopted: |I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,| Q1|), calculate the modulus of the complex number, where |I+jQ| is the modulus of the complex number I+jQ, and the parameters alpha and beta are obtained by querying the correspondence between the prestored angle and the parameter.
如上所述,实现了采用公式:|I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|),计算出所述复数的模。若atan(Q1/I1)的值处于预设角度范围内,表明可以根据预存的角度与参数对应关系获知参数alpha、beta的值,再将参数alpha、beta的值,套入公式|I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|),即可计算出所述复数的模。As described above, the formula: |I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|) is used to calculate the modulus of the complex number. If the value of atan(Q1/I1) is within the preset angle range, it indicates that the values of the parameters alpha and beta can be obtained according to the corresponding relationship between the prestored angle and the parameters, and then the values of the parameters alpha and beta are inserted into the formula |I+jQ |=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|), the modulus of the complex number can be calculated.
一个实施方式中,所述若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模的步骤S4,包括:In one embodiment, if the value of atan(Q1/I1) is within a preset angle range, the step S4 of calculating the modulus of the complex number I+jQ according to a preset modulus formula includes:
S411、若atan(Q1/I1)的值处于预设角度范围内,则判断所述旋转处理的旋转次数是否大于预设的旋转次数阈值;S411: If the value of atan(Q1/I1) is within a preset angle range, determine whether the number of rotations of the rotation processing is greater than a preset number of rotations threshold;
S412、若是,则根据所述预设求模公式计算出所述复数I+jQ的模。S412. If yes, calculate the modulus of the complex number I+jQ according to the preset modulus formula.
如上所述,实现了进一步提高复数的模的计算精度。预设算法例如CORDIC算法行旋转处理的旋转次数越多,后续处理所获得的复数的模的精度越高。若所述旋转处理的旋转次数大于预设的旋转阈值,表明已经耗费了足够的计算资源,不应再继续旋转以消耗计算资源,已经可以采用预设求模公式,例如采用公式:|I+jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|),计算出所述复数的模。其中,所述旋转阈值例如为3-10次。As described above, the calculation accuracy of the modulus of the complex number is further improved. The more the number of rotations of the preset algorithm such as CORDIC algorithm, the higher the precision of the complex number modulus obtained by the subsequent processing. If the number of rotations of the rotation processing is greater than the preset rotation threshold, it indicates that sufficient computing resources have been consumed, and the rotation should not be continued to consume computing resources. The preset modulus formula can already be used, for example, the formula: |I+ jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|), calculate the modulus of the complex number. Wherein, the rotation threshold is, for example, 3-10 times.
本申请的基于调制解调器的复数求模方法,获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ;将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1);判断atan(Q1/I1)的值是否处于预设角度范围内;若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模。从而在保证复数的模的精度的前提下,减少了耗费的计算资源。The modem-based complex number modulus method of the present application obtains the cosine value and the sine value of the radio frequency carrier signal to be processed, and uses one of the cosine value and the sine value as the real part and the other as the imaginary part. The part generates a complex number I+jQ; correspondingly transforms the complex number I+jQ into a coordinate point (I, Q) in a rectangular coordinate system, and uses a preset algorithm to rotate the coordinate point to obtain a rotated coordinate point (I1,Q1); Determine whether the value of atan(Q1/I1) is within the preset angle range; if the value of atan(Q1/I1) is within the preset angle range, calculate the value according to the preset modulus formula The modulus of the complex number I+jQ. Therefore, under the premise of ensuring the accuracy of the modulus of the complex number, the consumption of computational resources is reduced.
参照图2,本申请实施例提供一种基于调制解调器的复数求模装置,包括:2, an embodiment of the present application provides a modem-based complex number modulus device, including:
复数生成单元1,用于获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ;The complex number generating unit 1 is used to obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as the real part and the other as the imaginary part to generate a complex number I +jQ;
旋转处理单元2,用于将所述复数I+jQ对应转化为平面直角坐标系中的 坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1);The rotation processing unit 2 is configured to correspondingly convert the complex number I+jQ into coordinate points (I, Q) in a plane rectangular coordinate system, and use a preset algorithm to rotate the coordinate points to obtain a rotating coordinate point (I1,Q1);
预设角度范围判断单元3,判断atan(Q1/I1)的值是否处于预设角度范围内;The preset angle range judgment unit 3 judges whether the value of atan (Q1/I1) is within the preset angle range;
复数的模计算单元4,用于当atan(Q1/I1)的值处于预设角度范围时,根据预设求模公式计算出所述复数I+jQ的模。The complex modulus calculation unit 4 is configured to calculate the modulus of the complex number I+jQ according to the preset modulus formula when the value of atan(Q1/I1) is in the preset angle range.
如上述单元1所述,获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ。调制解调器是一种计算机硬件,它能把计算机的数字信号翻译成模拟信号,而这些模拟信号又可被另一端的另一个调制解调器接收,并译成计算机可识别的语言。这一简单过程完成了两台计算机间的通信。其中,在对信号进行处理的过程中,经常需要采用对复数的模的计算。其中,信号的传递一般采用射频载波,以传递射频载波信号。其中接收的射频载波信号可以来自另一个调制解调器。获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ。射频载波信号可供改变的参数只有余弦、频率和正弦三种。而正弦与频率相关。因此一般以载波信号中的余弦和正弦,作为两个主要的调制变量。据此,提取所述射频载波信号中的余弦和正弦的数值,记为复数I+jQ。由于本实施方式用于计算复数的模,因此I为所述射频载波信号中的余弦,Q为所述射频载波信号中的正弦,或者,I为所述射频载波信号中的正弦,Q为所述射频载波信号中的余弦,均可行。As described in the above unit 1, obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as the real part, and the other as the imaginary part to generate a complex number I +jQ. A modem is a kind of computer hardware that can translate the digital signal of the computer into an analog signal, and these analog signals can be received by another modem at the other end and translated into a language that the computer can recognize. This simple process completes the communication between the two computers. Among them, in the process of processing the signal, it is often necessary to calculate the modulus of the complex number. Among them, the signal transmission generally uses a radio frequency carrier to transmit the radio frequency carrier signal. The received radio frequency carrier signal can come from another modem. Obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as a real part and the other as an imaginary part to generate a complex number I+jQ. The only parameters that can be changed for the RF carrier signal are cosine, frequency and sine. And sine is related to frequency. Therefore, the cosine and sine in the carrier signal are generally used as the two main modulation variables. Accordingly, the values of cosine and sine in the radio frequency carrier signal are extracted and recorded as complex numbers I+jQ. Since this embodiment is used to calculate the modulus of a complex number, I is the cosine in the radio frequency carrier signal, Q is the sine in the radio frequency carrier signal, or I is the sine in the radio frequency carrier signal, and Q is the all The cosine in the radio frequency carrier signal is acceptable.
如上述单元2所述,将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1)。其中,进行旋转处理的预设算法可以为任意算法,优选CORDIC算法(Coordinate Rotation Digital Computer),其中CORDIC算法即坐标旋转数字计算方法,通过基本的加和移位运算代替乘法运算,使得矢量的旋转和定向的计算不再需要三角函数、乘法、开方、反三角、指数等函数。CORDIC算法具有多种模式,其中的矢量模式指,通过判断坐标点的Y轴的正负,以确定旋转方向的模式。具体地,采用CORDIC算法对所述坐标点(I,Q)进行旋转处理,使旋转后的坐标点与平面直角坐标系的X轴的夹角变小。As described in the above unit 2, the complex number I+jQ is correspondingly converted into coordinate points (I, Q) in a rectangular coordinate system, and the coordinate points are rotated by a preset algorithm to obtain the rotated coordinate points (I1, Q1). Among them, the preset algorithm for rotation processing can be any algorithm, preferably the CORDIC algorithm (Coordinate Rotation Digital Computer), where the CORDIC algorithm is the coordinate rotation digital calculation method, which replaces the multiplication operation by the basic addition and shift operation to make the vector rotation The calculation of sum orientation no longer needs functions such as trigonometric function, multiplication, square root, inverse trigonometry, and exponent. The CORDIC algorithm has multiple modes, among which the vector mode refers to the mode in which the direction of rotation is determined by judging the positive or negative of the Y axis of the coordinate point. Specifically, the CORDIC algorithm is used to perform rotation processing on the coordinate point (I, Q), so that the angle between the rotated coordinate point and the X axis of the planar rectangular coordinate system is reduced.
如上述单元3所述,判断atan(Q1/I1)的值是否处于预设角度范围内。预 设算法例如CORDIC算法旋转次数足够多,能够使坐标点与X轴的夹角趋近于0,此时的坐标点的X轴方向读数即为复数I+jQ的模,即
Figure PCTCN2019075687-appb-000003
Figure PCTCN2019075687-appb-000004
其中,In是坐标点与X轴的夹角趋近于0时所述坐标点的X轴方向读数。但是要使坐标点与X轴的夹角趋近于0,需要旋转次数过多,需要大量的计算机资源。而若atan(Q1/I1)的值处于预设角度范围内,此时的坐标点已能做为近似计算出复数I+jQ的模的依据,耗费的计算机资源大大减少。其中预设角度例如为(0,atan0.3)、(0,atan0.25)。其中,atan是反正切函数,即正切函数的反函数。
As described in the above unit 3, it is determined whether the value of atan(Q1/I1) is within the preset angle range. The preset algorithm such as the CORDIC algorithm has enough rotation times to make the angle between the coordinate point and the X axis approach 0. At this time, the X axis reading of the coordinate point is the modulus of the complex number I+jQ, that is
Figure PCTCN2019075687-appb-000003
Figure PCTCN2019075687-appb-000004
Wherein, In is the X-axis direction reading of the coordinate point when the angle between the coordinate point and the X-axis approaches 0. However, to make the angle between the coordinate point and the X axis approach 0, too many rotations are required, and a lot of computer resources are required. If the value of atan(Q1/I1) is within the preset angle range, the coordinate point at this time can be used as a basis for approximately calculating the modulus of the complex number I+jQ, and the computer resources consumed are greatly reduced. The preset angle is, for example, (0, atan0.3), (0, atan0.25). Among them, atan is the arctangent function, that is, the inverse function of the tangent function.
如上述单元4所述,若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模。其中,预设求模公式可为任意公式,优选为:|I+jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|)。其中,公式|I+jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|)能够利用合适的参数alpha、beta,预估所述复数的模的数值,参数alpha、beta通过查询预存的角度与参数对应关系获得。预存的角度与参数对应关系例如为,(0,A)对应参数alpha、beta分别为a1、b1,[A,B)对应参数alpha、beta分别为a2、b2……。优选地,设置角度(0,atan0.25)对应alpha、beta分别为0.864458929403047、0.106419757324935。As described in the above unit 4, if the value of atan(Q1/I1) is within the preset angle range, the modulus of the complex number I+jQ is calculated according to the preset modulus formula. Among them, the preset modulus formula can be any formula, preferably: |I+jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1 |). Among them, the formula |I+jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|) can use appropriate parameters alpha, beta, predict To estimate the value of the modulus of the complex number, the parameters alpha and beta are obtained by querying the correspondence between the prestored angle and the parameter. The corresponding relationship between the pre-stored angle and the parameter is, for example, (0,A) corresponding to the parameters alpha and beta are a1, b1, respectively, and [A, B) corresponding to the parameters alpha and beta are a2, b2, respectively. Preferably, the setting angle (0, atan0.25) corresponding to alpha and beta are 0.864458929403047 and 0.106419757324935 respectively.
综上,本实施方式通过先对复数对应的坐标点,采用预设算法进行旋转处理,在旋转后若atan(Q1/I1)的值处于预设角度范围内,再采用预设求模公式求出所述复数的模。从而在保证复数的模的值的精度的前提下,减少了CORDIC算法的旋转次数。In summary, this embodiment first uses a preset algorithm to perform rotation processing on the coordinate points corresponding to the complex number. After the rotation, if the value of atan(Q1/I1) is within the preset angle range, then the preset modulus formula is used to calculate Find the modulus of the complex number. Therefore, the number of rotations of the CORDIC algorithm is reduced under the premise of ensuring the accuracy of the modulus of the complex number.
一个实施方式中,所述装置,包括:In one embodiment, the device includes:
继续旋转单元,用于当所述atan(Q1/I1)的值不处于预设角度范围内时,继续采用所述预设算法对所述坐标点(I1,Q1)进行旋转处理。The continuous rotation unit is configured to continue to use the preset algorithm to perform rotation processing on the coordinate points (I1, Q1) when the value of the atan(Q1/I1) is not within the preset angle range.
如上所述,实现了继续旋转处理。若所述atan(Q1/I1)的值不处于预设角度范围内,表明所述CORDIC算法行旋转处理的旋转次数不够,不足以采用后续的预设求模公式求出所述复数的模。因此还需要继续采用所述预设算法对所述坐标点(I1,Q1)进行旋转处理。As described above, continuous rotation processing is realized. If the value of atan(Q1/I1) is not within the preset angle range, it indicates that the number of rotations of the CORDIC algorithm for rotation processing is insufficient, and the subsequent preset modulus formula is not enough to obtain the modulus of the complex number. Therefore, it is also necessary to continue to use the preset algorithm to perform rotation processing on the coordinate points (I1, Q1).
一个实施方式中,所述复数生成单元1,包括:In one embodiment, the complex number generating unit 1 includes:
绝对值判断子单元,用于判断所述余弦数值的绝对值是否大于所述正弦数值的绝对值;An absolute value judging subunit for judging whether the absolute value of the cosine value is greater than the absolute value of the sine value;
第一复数生成子单元,用于当所述余弦数值的绝对值大于所述正弦数值的绝对值时,将I作为所述射频载波信号中的余弦数值,将Q作为所述射频载波信号中的正弦数值,从而生成复数I+jQ;The first complex number generating subunit is configured to use I as the cosine value in the radio frequency carrier signal and Q as the cosine value in the radio frequency carrier signal when the absolute value of the cosine value is greater than the absolute value of the sine value. A sine value to generate a complex number I+jQ;
第二复数生成子单元,用于当所述余弦数值的绝对值不大于所述正弦数值的绝对值时,将I作为所述射频载波信号中的正弦数值,将Q作为所述射频载波信号中的正弦数值,从而生成复数I+jQ。The second complex number generating subunit is used for when the absolute value of the cosine value is not greater than the absolute value of the sine value, using I as the sine value in the radio frequency carrier signal and Q as the radio frequency carrier signal The sine value of, thereby generating a complex number I+jQ.
如上所述,实现了生成复数I+jQ。为了减少后续的预设算法的旋转次数,将余弦和正弦的绝对值中较小的数值记为Q,较大的数值记为I。从而使初始的复数I+jQ转化为平面直角坐标系中的坐标点与原点的连线,与X轴的角度更小,进而减少后续的CORDIC算法的旋转次数。其中,由于正弦可能为负数,因此进行绝对值的大小比较。As described above, the complex number I+jQ is generated. In order to reduce the number of rotations of the subsequent preset algorithm, the smaller value of the absolute value of cosine and sine is recorded as Q, and the larger value is recorded as I. In this way, the initial complex number I+jQ is transformed into the line between the coordinate point and the origin in the rectangular coordinate system, and the angle with the X axis is smaller, thereby reducing the number of rotations of the subsequent CORDIC algorithm. Among them, since sine may be negative, the absolute value is compared.
一个实施方式中,所述旋转处理单元2,包括:In one embodiment, the rotation processing unit 2 includes:
平面直角坐标建立子单元,用于建立平面直角坐标系,以所述余弦或者所述正弦作为X轴,所述正弦或者所述余弦作为Y轴,将所述复数I+jQ对应转化为所述平面直角坐标系中的坐标点(I,Q);The plane rectangular coordinate establishment subunit is used to establish a plane rectangular coordinate system, with the cosine or the sine as the X axis, the sine or the cosine as the Y axis, and correspondingly transform the complex number I+jQ into the The coordinate point (I, Q) in the plane rectangular coordinate system;
旋转处理子单元,用于采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1),其中所述旋转处理的单次旋转角度为±atan 2 -i,其中进行旋转的次数记为i次。 The rotation processing subunit is used to perform rotation processing on the coordinate point (I, Q) around the origin using the vector mode of the CORDIC algorithm to obtain the rotation coordinate point (I1, Q1) after the rotation processing, wherein the rotation processing The single rotation angle of is ±atan 2 -i , and the number of rotations is recorded as i times.
如上所述,实现了获得旋转处理后的坐标点(I1,Q1)。As mentioned above, the coordinate point (I1, Q1) after the rotation processing is obtained.
Cordic算法的迭代公式为:The iterative formula of Cordic algorithm is:
x i+1=K i[x i-y i·d i·2 -i] x i+1 =K i [x i -y i ·d i ·2 -i ]
y i+1=K i[y i+x i·d i·2 -i] y i+1 =K i [y i +x i ·d i ·2 -i ]
其中,Ki=cos(θi),i为旋转的次数,θi为第i次旋转时旋转的角度值,di=-sign(yi)。其中sign函数的功能是取某个数的符号(正或负):当x>0,sign(x)=1;当x=0,sign(x)=0;当x<0,sign(x)=-1。由此可知,旋转后的坐标点(xi+1,yi+1)与旋转前的坐标点(xi,yi)相比,是通过旋转±atan 2 -i得到的,其中。并且,通过旋转±atan 2 -i的方式,使得计算机能够采用移位操作进行旋转操作, 而免去了更多次的乘法运算,相较于其他的旋转角度,节省了算力。其中,±atan 2 -i分别表示顺时针旋转atan 2 -i度与逆时针旋转atan 2 -i度。其中,CORDIC算法具有多种模式,其中的矢量模式指,通过判断坐标点的Y轴的正负,以确定旋转方向的模式,即以Q值的正负判断旋转方向。 Among them, Ki=cos(θi), i is the number of rotations, θi is the angle of rotation during the i-th rotation, and di=-sign(yi). The function of the sign function is to take the sign (positive or negative) of a certain number: when x>0, sign(x)=1; when x=0, sign(x)=0; when x<0, sign(x) )=-1. It can be seen that the coordinate point (xi+1, yi+1) after rotation is compared with the coordinate point (xi, yi) before rotation, which is obtained by rotating ±atan 2 -i . In addition, by rotating ±atan 2 -i , the computer can use shift operations to perform rotation operations, which eliminates more multiplication operations and saves computing power compared to other rotation angles. Among them, ±atan 2 -i respectively represent clockwise rotation atan 2 -i degrees and counterclockwise rotation atan 2 -i degrees. Among them, the CORDIC algorithm has multiple modes, among which the vector mode refers to the mode of determining the direction of rotation by judging the positive or negative of the Y axis of the coordinate point, that is, judging the direction of rotation by the positive or negative of the Q value.
一个实施方式中,所述旋转处理子单元,包括:In an embodiment, the rotation processing sub-unit includes:
Q值判断模块,用于判断所述Q值是否为正数;The Q value judgment module is used to judge whether the Q value is a positive number;
第一旋转处理模块,用于当所述Q值为正数时,则采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转角度为atan 2 -i的旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1); The first rotation processing module is used for when the Q value is positive, the vector mode of the CORDIC algorithm is used to rotate the coordinate point (I, Q) around the origin by a rotation angle of atan 2 -i to obtain The rotation coordinate point (I1, Q1) after the rotation processing;
第二旋转处理模块,用于当所述Q值不为正数时,则采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转角度为-atan 2 -i的旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1)。 The second rotation processing module is used for when the Q value is not a positive number, the vector mode of the CORDIC algorithm is used to perform rotation processing on the coordinate point (I, Q) around the origin by an angle of -atan 2 -i , Obtain the rotation coordinate point (I1, Q1) after the rotation processing.
如上所述,实现了采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转处理。若所述Q值为正值,则应对所述坐标点(I,Q)进行顺时针旋转处理,即绕原点进行旋转角度为atan 2 -i的旋转处理,以使所述坐标点(I,Q)靠近X轴;若所述Q值为负值,则应对所述坐标点(I,Q)进行逆时针旋转处理,即绕原点进行旋转角度为-atan 2 -i的旋转处理,以使所述坐标点(I,Q)靠近X轴。 As described above, the vector mode using the CORDIC algorithm is implemented to rotate the coordinate point (I, Q) around the origin. If the Q value is positive, the coordinate point (I, Q) should be rotated clockwise, that is, the rotation angle of atan 2 -i should be performed around the origin, so that the coordinate point (I, Q) is close to the X axis; if the Q value is negative, the coordinate point (I, Q) should be rotated counterclockwise, that is, the rotation angle of -atan 2 -i is performed around the origin to make The coordinate point (I, Q) is close to the X axis.
一个实施方式中,所述复数的模计算单元4,包括:In one embodiment, the complex number modulus calculation unit 4 includes:
复数的模计算子单元,用于当atan(Q1/I1)的值处于预设角度范围内时,则采用公式:|I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|),计算出所述复数的模,其中,|I+jQ|为复数I+jQ的模,参数alpha、beta通过查询预存的角度与参数对应关系获得。Complex number modulus calculation subunit, used when the value of atan(Q1/I1) is within the preset angle range, the formula is used: |I+jQ|=alpha×max(|I1|,|Q1|)+beta ×min(|I1|,|Q1|), calculate the modulus of the complex number, where |I+jQ| is the modulus of the complex number I+jQ, and the parameters alpha and beta are obtained by querying the prestored angle and parameter correspondence.
如上所述,实现了采用公式:|I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|),计算出所述复数的模。若atan(Q1/I1)的值处于预设角度范围内,表明可以根据预存的角度与参数对应关系获知参数alpha、beta的值,再将参数alpha、beta的值,套入公式|I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|),即可计算出所述复数的模。As described above, the formula: |I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|) is used to calculate the modulus of the complex number. If the value of atan(Q1/I1) is within the preset angle range, it indicates that the values of the parameters alpha and beta can be obtained according to the corresponding relationship between the prestored angle and the parameters, and then the values of the parameters alpha and beta are inserted into the formula |I+jQ |=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|), the modulus of the complex number can be calculated.
一个实施方式中,所述复数的模计算单元4,包括:In one embodiment, the complex number modulus calculation unit 4 includes:
旋转次数阈值判断子单元,用于当atan(Q1/I1)的值处于预设角度范围内时,则判断所述旋转处理的旋转次数是否大于预设的旋转次数阈值;The number of rotations threshold judging subunit is used to determine whether the number of rotations of the rotation processing is greater than the preset number of rotations threshold when the value of atan(Q1/I1) is within the preset angle range;
复数的模计算子单元,用于当所述旋转处理的旋转次数大于预设的旋转次数阈值时,则根据所述预设求模公式计算出所述复数I+jQ的模。The complex modulus calculation subunit is configured to calculate the modulus of the complex number I+jQ according to the preset modulus calculation formula when the rotation number of the rotation processing is greater than a preset rotation number threshold.
如上所述,实现了进一步提高复数的模的计算精度。预设算法例如CORDIC算法行旋转处理的旋转次数越多,后续处理所获得的复数的模的精度越高。若所述旋转处理的旋转次数大于预设的旋转阈值,表明已经耗费了足够的计算资源,不应再继续旋转以消耗计算资源,已经可以采用预设求模公式,例如采用公式:|I+jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|),计算出所述复数的模。其中,所述旋转阈值例如为3-10次。As described above, the calculation accuracy of the modulus of the complex number is further improved. The more the number of rotations of the preset algorithm such as CORDIC algorithm, the higher the precision of the complex number modulus obtained by the subsequent processing. If the number of rotations of the rotation processing is greater than the preset rotation threshold, it indicates that sufficient computing resources have been consumed, and the rotation should not be continued to consume computing resources. The preset modulus formula can already be used, for example, the formula: |I+ jQ|=|I1+jQ1|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|), calculate the modulus of the complex number. Wherein, the rotation threshold is, for example, 3-10 times.
本申请的基于调制解调器的复数求模装置,获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ;将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1);判断atan(Q1/I1)的值是否处于预设角度范围内;若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模。从而在保证复数的模的精度的前提下,减少了耗费的计算资源。The modem-based complex number modulus device of the present application obtains the cosine value and the sine value of the radio frequency carrier signal to be processed, and uses one of the cosine value and the sine value as the real part and the other as the imaginary part. The part generates a complex number I+jQ; correspondingly transforms the complex number I+jQ into a coordinate point (I, Q) in a rectangular coordinate system, and uses a preset algorithm to rotate the coordinate point to obtain a rotated coordinate point (I1,Q1); Determine whether the value of atan(Q1/I1) is within the preset angle range; if the value of atan(Q1/I1) is within the preset angle range, calculate the value according to the preset modulus formula The modulus of the complex number I+jQ. Therefore, under the premise of ensuring the accuracy of the modulus of the complex number, the consumption of computational resources is reduced.
参考附图3,本申请还提供了一种计算机可读存储介质10,其上存储有计算机程序11,所述计算机程序11被处理器执行时实现如以上实施例所描述的基于调制解调器的复数求模方法的步骤。Referring to FIG. 3, the present application also provides a computer-readable storage medium 10 on which a computer program 11 is stored. When the computer program 11 is executed by a processor, the modem-based complex number request as described in the above embodiment is implemented. The steps of the model method.
参考附图4,本申请还提供了一种计算机设备20,包括存储器22和处理器21,所述存储器存储有计算机程序221,所述处理器执行所述计算机程序221时实现如以上实施例所描述的基于调制解调器的复数求模方法的步骤。4, the present application also provides a computer device 20, including a memory 22 and a processor 21, the memory stores a computer program 221, the processor executes the computer program 221 as described in the above embodiment Describe the steps of the modem-based complex number modulus method.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part.
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在存储介质中,或者从一个存储介质向另一 存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a storage medium, or transmitted from one storage medium to another storage medium. For example, the computer instructions may be sent from a website, computer, server, or data center through wired (such as coaxial cable, optical fiber) , Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website site, computer, server or data center. The storage medium may be any available medium that can be stored by a computer or a data storage device such as a server or data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的和实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双速据率SDRAM(SSRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage. In the medium, when the computer program is executed, it may include the procedures of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements not only includes those elements, It also includes other elements not explicitly listed, or elements inherent to the process, device, article, or method. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, device, article, or method that includes the element.
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly applied to other related The technical field is equally included in the scope of patent protection of this application.

Claims (15)

  1. 一种基于调制解调器的复数求模方法,其特征在于,包括:A modem-based complex number modulus method, which is characterized in that it includes:
    获取待处理的射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ;Obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as a real part and the other as an imaginary part to generate a complex number I+jQ;
    将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1);Correspondingly convert the complex number I+jQ into coordinate points (I, Q) in a rectangular coordinate system, and use a preset algorithm to rotate the coordinate points to obtain a rotated coordinate point (I1, Q1);
    判断atan(Q1/I1)的值是否处于预设角度范围内;Determine whether the value of atan(Q1/I1) is within the preset angle range;
    若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模。If the value of atan(Q1/I1) is within the preset angle range, the modulus of the complex number I+jQ is calculated according to the preset modulus formula.
  2. 根据权利要求1所述的基于调制解调器的复数求模方法,其特征在于,所述判断atan(Q1/I1)的值是否处于预设角度范围内的步骤之后,包括:The modem-based complex number modulus method according to claim 1, wherein after the step of judging whether the value of atan(Q1/I1) is within a preset angle range, the method comprises:
    若所述atan(Q1/I1)的值不处于所述预设角度范围中,则继续采用所述预设算法对所述坐标点(I1,Q1)进行旋转处理。If the value of atan(Q1/I1) is not in the preset angle range, then continue to use the preset algorithm to perform rotation processing on the coordinate points (I1, Q1).
  3. 根据权利要求1所述的基于调制解调器的复数求模方法,其特征在于,所述获取待处理的所述射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ的步骤,包括:The modem-based complex number modulus method according to claim 1, wherein said obtaining the cosine value and the sine value of the radio frequency carrier signal to be processed, and combining the cosine value and the sine value One value is used as the real part, and the other is used as the imaginary part. The steps to generate a complex number I+jQ include:
    判断所述余弦数值的绝对值是否大于所述正弦数值的绝对值;Judging whether the absolute value of the cosine value is greater than the absolute value of the sine value;
    若所述余弦数值的绝对值大于所述正弦数值的绝对值,则将I作为所述射频载波信号中的余弦数值,将Q作为所述射频载波信号中的正弦数值,从而生成复数I+jQ;If the absolute value of the cosine value is greater than the absolute value of the sine value, use I as the cosine value in the radio frequency carrier signal and Q as the sine value in the radio frequency carrier signal, thereby generating a complex number I+jQ ;
    若所述余弦数值的绝对值不大于所述正弦数值的绝对值,则将I作为所述射频载波信号中的正弦数值,将Q作为所述射频载波信号中的正弦数值,从而生成复数I+jQ。If the absolute value of the cosine value is not greater than the absolute value of the sine value, use I as the sine value in the radio frequency carrier signal and Q as the sine value in the radio frequency carrier signal, thereby generating a complex number I+ jQ.
  4. 根据权利要求1所述的基于调制解调器的复数求模方法,其特征在于,所述将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1)的步骤, 包括:The modem-based complex number modulus method according to claim 1, wherein the said complex number I+jQ is correspondingly transformed into coordinate points (I, Q) in a rectangular coordinate system, and a preset algorithm is used The step of performing rotation processing on the coordinate point to obtain a rotating coordinate point (I1, Q1) includes:
    建立平面直角坐标系,以所述余弦或者所述正弦作为X轴,所述正弦或者所述余弦作为Y轴,将所述复数I+jQ对应转化为所述平面直角坐标系中的坐标点(I,Q);Establish a plane rectangular coordinate system, take the cosine or the sine as the X axis, and the sine or the cosine as the Y axis, and transform the complex number I+jQ into coordinate points in the plane rectangular coordinate system ( I,Q);
    采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1),其中所述旋转处理的单次旋转角度为±atan 2 -i,其中进行旋转的次数记为i次。 The vector mode of the CORDIC algorithm is used to rotate the coordinate point (I, Q) around the origin to obtain the rotated coordinate point (I1, Q1) after the rotation processing, wherein the single rotation angle of the rotation processing is ± atan 2 -i , where the number of rotations is recorded as i times.
  5. 根据权利要求4所述的基于调制解调器的复数求模方法,其特征在于,所述采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1),其中所述旋转处理的单次旋转角度为±atan 2 -i的步骤,包括: The modem-based complex modulus method according to claim 4, wherein the vector mode of the CORDIC algorithm is used to rotate the coordinate point (I, Q) around the origin to obtain the rotated The step of rotating the coordinate point (I1, Q1), wherein the single rotation angle of the rotation processing is ±atan 2 -i , includes:
    判断所述Q值是否为正数;Determine whether the Q value is a positive number;
    若是,则采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转角度为atan 2 -i的旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1); If yes, use the vector mode of the CORDIC algorithm to perform rotation processing on the coordinate point (I, Q) around the origin with a rotation angle of atan 2 -i to obtain the rotated coordinate point (I1, Q1) after the rotation processing;
    若否,则采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转角度为-atan 2 -i的旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1)。 If not, use the vector mode of the CORDIC algorithm to rotate the coordinate point (I, Q) around the origin with a rotation angle of -atan 2 -i to obtain the rotated coordinate point (I1, Q1) after the rotation process .
  6. 根据权利要求1所述的基于调制解调器的复数求模方法,其特征在于,所述若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模处于预设角度范围内的步骤,包括:The modem-based complex number modulus method according to claim 1, wherein if the value of atan(Q1/I1) is within a preset angle range, the complex number I is calculated according to a preset modulus formula. The steps for +jQ's modulus to be within the preset angle range include:
    若atan(Q1/I1)的值处于预设角度范围内,则采用公式:|I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|),计算出所述复数的模,其中,|I+jQ|为复数I+jQ的模,参数alpha、beta通过查询预存的角度与参数对应关系获得。If the value of atan(Q1/I1) is within the preset angle range, use the formula: |I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1| ), calculate the modulus of the complex number, where |I+jQ| is the modulus of the complex number I+jQ, and the parameters alpha and beta are obtained by querying the prestored angle and parameter correspondence.
  7. 根据权利要求1所述的基于调制解调器的复数求模方法,其特征在于,所述若atan(Q1/I1)的值处于预设角度范围内,则根据预设求模公式计算出所述复数I+jQ的模处于预设角度范围内的步骤,包括:The modem-based complex number modulus method according to claim 1, wherein if the value of atan(Q1/I1) is within a preset angle range, the complex number I is calculated according to a preset modulus formula. The steps for +jQ's modulus to be within the preset angle range include:
    若atan(Q1/I1)的值处于预设角度范围内,则判断所述旋转处理的旋转次数是否大于预设的旋转次数阈值;If the value of atan(Q1/I1) is within the preset angle range, it is determined whether the number of rotations of the rotation processing is greater than the preset threshold of the number of rotations;
    若是,则根据所述预设求模公式计算出所述复数I+jQ的模。If yes, the modulus of the complex number I+jQ is calculated according to the preset modulus formula.
  8. 一种基于调制解调器的复数求模装置,其特征在于,包括:A modem-based complex number modulus device, characterized in that it comprises:
    复数生成单元,用于获取待处理的射频载波信号的余弦数值和正弦数值,并将所述余弦数值和所述正弦数值中的一个数值作为实部,另一个作为虚部生成复数I+jQ;A complex number generating unit, configured to obtain the cosine value and the sine value of the radio frequency carrier signal to be processed, and use one of the cosine value and the sine value as the real part, and the other as the imaginary part to generate the complex number I+jQ;
    旋转处理单元,用于将所述复数I+jQ对应转化为平面直角坐标系中的坐标点(I,Q),并采用预设算法对所述坐标点进行旋转处理,以得到旋转坐标点(I1,Q1);The rotation processing unit is used to convert the complex number I+jQ into coordinate points (I, Q) in a rectangular coordinate system, and use a preset algorithm to rotate the coordinate points to obtain a rotating coordinate point ( I1,Q1);
    预设角度范围判断单元,判断atan(Q1/I1)的值是否处于预设角度范围内;The preset angle range judgment unit judges whether the value of atan (Q1/I1) is within the preset angle range;
    复数的模计算单元,用于当atan(Q1/I1)的值处于预设角度范围内时,根据预设求模公式计算出所述复数I+jQ的模。The complex modulus calculation unit is configured to calculate the modulus of the complex number I+jQ according to the preset modulus formula when the value of atan(Q1/I1) is within the preset angle range.
  9. 根据权利要求8所述的基于调制解调器的复数求模装置,其特征在于,所述装置,包括:The modem-based complex number modulus device according to claim 8, wherein the device comprises:
    继续旋转单元,用于当所述atan(Q1/I1)的值不处于预设角度范围内时,继续采用所述预设算法对所述坐标点(I1,Q1)进行旋转处理。The continuous rotation unit is configured to continue to use the preset algorithm to perform rotation processing on the coordinate points (I1, Q1) when the value of the atan(Q1/I1) is not within the preset angle range.
  10. 根据权利要求8所述的基于调制解调器的复数求模装置,其特征在于,所述复数生成单元,包括:The modem-based complex number modulus device according to claim 8, wherein the complex number generating unit comprises:
    绝对值判断子单元,用于判断所述余弦数值的绝对值是否大于所述正弦数值的绝对值;An absolute value judging subunit for judging whether the absolute value of the cosine value is greater than the absolute value of the sine value;
    第一复数生成子单元,用于当所述余弦数值的绝对值大于所述正弦数值的绝对值时,则将I作为所述射频载波信号中的余弦数值,并将Q作为所述射频载波信号中的正弦数值,从而生成复数I+jQ;The first complex number generating subunit is configured to use I as the cosine value in the radio frequency carrier signal and Q as the radio frequency carrier signal when the absolute value of the cosine value is greater than the absolute value of the sine value The sine value in, thereby generating a complex number I+jQ;
    第二复数生成子单元,用于当所述余弦数值的绝对值不大于所述正弦数值的绝对值时,则将I作为所述射频载波信号中的正弦数值,并将Q作为所述射频载波信号中的正弦数值,从而生成复数I+jQ。The second complex number generating subunit is configured to use I as the sine value in the radio frequency carrier signal and Q as the radio frequency carrier when the absolute value of the cosine value is not greater than the absolute value of the sine value The sine value in the signal, which generates the complex number I+jQ.
  11. 根据权利要求8所述的基于调制解调器的复数求模装置,其特征在于,所述旋转处理单元,包括:8. The modem-based complex modulus device according to claim 8, wherein the rotation processing unit comprises:
    平面直角坐标建立子单元,用于建立平面直角坐标系,以所述余弦或者所 述正弦作为X轴,所述正弦或者所述余弦作为Y轴,将所述复数I+jQ对应转化为所述平面直角坐标系中的坐标点(I,Q);The plane rectangular coordinate establishment subunit is used to establish a plane rectangular coordinate system, using the cosine or the sine as the X axis, the sine or the cosine as the Y axis, and correspondingly transforming the complex number I+jQ into the The coordinate point (I, Q) in the plane rectangular coordinate system;
    旋转处理子单元,用于采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1),其中所述旋转处理的单次旋转角度为±atan 2 -i,其中进行旋转的次数记为i次。 The rotation processing subunit is used to perform rotation processing on the coordinate point (I, Q) around the origin using the vector mode of the CORDIC algorithm to obtain the rotation coordinate point (I1, Q1) after the rotation processing, wherein the rotation processing The single rotation angle of is ±atan 2 -i , and the number of rotations is recorded as i times.
  12. 根据权利要求11所述的基于调制解调器的复数求模装置,其特征在于,所述旋转处理子单元,包括:11. The modem-based complex modulus device according to claim 11, wherein the rotation processing sub-unit comprises:
    Q值判断模块,用于判断所述Q值是否为正数;The Q value judgment module is used to judge whether the Q value is a positive number;
    第一旋转处理模块,用于当所述Q值为正数时,则采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转角度为atan 2 -i的旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1); The first rotation processing module is used for when the Q value is positive, the vector mode of the CORDIC algorithm is used to rotate the coordinate point (I, Q) around the origin by a rotation angle of atan 2 -i to obtain The rotation coordinate point (I1, Q1) after the rotation processing;
    第二旋转处理模块,用于当所述Q值不为正数时,则采用CORDIC算法的矢量模式对所述坐标点(I,Q)绕原点进行旋转角度为-atan 2 -i的旋转处理,获得旋转处理后的所述旋转坐标点(I1,Q1)。 The second rotation processing module is used for when the Q value is not a positive number, the vector mode of the CORDIC algorithm is used to perform rotation processing on the coordinate point (I, Q) around the origin by an angle of -atan 2 -i , Obtain the rotation coordinate point (I1, Q1) after the rotation processing.
  13. 根据权利要求8所述的基于调制解调器的复数求模装置,其特征在于,所述复数的模计算单元,包括:The modem-based complex number modulus device according to claim 8, wherein the complex number modulus calculation unit comprises:
    复数的模计算子单元,用于当atan(Q1/I1)的值处于预设角度范围内时,则采用公式:|I+jQ|=alpha×max(|I1|,|Q1|)+beta×min(|I1|,|Q1|),计算出所述复数的模,其中,|I+jQ|为复数I+jQ的模,参数alpha、beta通过查询预存的角度与参数对应关系获得。Complex number modulus calculation subunit, used when the value of atan(Q1/I1) is within the preset angle range, the formula is used: |I+jQ|=alpha×max(|I1|,|Q1|)+beta ×min(|I1|,|Q1|), calculate the modulus of the complex number, where |I+jQ| is the modulus of the complex number I+jQ, and the parameters alpha and beta are obtained by querying the prestored angle and parameter correspondence.
  14. 根据权利要求8所述的基于调制解调器的复数求模装置,其特征在于,所述复数的模计算单元,包括:The modem-based complex number modulus device according to claim 8, wherein the complex number modulus calculation unit comprises:
    旋转次数阈值判断子单元,用于当atan(Q1/I1)的值处于预设角度范围内时,则判断所述旋转处理的旋转次数是否大于预设的旋转次数阈值;The number of rotations threshold judging subunit is used to determine whether the number of rotations of the rotation processing is greater than the preset number of rotations threshold when the value of atan(Q1/I1) is within the preset angle range;
    复数的模计算子单元,用于当所述旋转处理的旋转次数大于预设的旋转次数阈值时,则根据所述预设求模公式计算出所述复数I+jQ的模。The complex modulus calculation subunit is configured to calculate the modulus of the complex number I+jQ according to the preset modulus calculation formula when the rotation number of the rotation processing is greater than a preset rotation number threshold.
  15. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程 序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7中任一项所述的基于调制解调器的复数求模方法的步骤。A computer device, comprising a memory and a processor, the memory stores a computer program, wherein the processor implements the modem-based method according to any one of claims 1 to 7 when the computer program is executed. Steps of complex number modulus method.
PCT/CN2019/075687 2019-02-01 2019-02-21 Method and device for calculating modulus of complex number based on modem WO2020155224A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910104578.4 2019-02-01
CN201910104578.4A CN109918047A (en) 2019-02-01 2019-02-01 Plural modulus method and apparatus based on modem

Publications (1)

Publication Number Publication Date
WO2020155224A1 true WO2020155224A1 (en) 2020-08-06

Family

ID=66961312

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/075687 WO2020155224A1 (en) 2019-02-01 2019-02-21 Method and device for calculating modulus of complex number based on modem

Country Status (2)

Country Link
CN (1) CN109918047A (en)
WO (1) WO2020155224A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1375150A (en) * 1998-12-10 2002-10-16 艾利森公司 QAM modulator for radio communications
US20030165203A1 (en) * 2001-08-10 2003-09-04 Rishi Mohindra Quadrature gain and phase imbalance correction in a receiver
CN101938253A (en) * 2009-06-30 2011-01-05 瑞昱半导体股份有限公司 Carrier reconstructing device and method
CN105426340A (en) * 2015-11-10 2016-03-23 江苏商贸职业学院 Polar-harmonic sine and cosine transformation algorithm
CN107347044A (en) * 2017-07-19 2017-11-14 上海航天测控通信研究所 Multi-carrier modulation demodulation method in a kind of VDES systems

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19950577C2 (en) * 1999-10-20 2002-08-22 Siemens Ag Complex CORDIC procedure for signal processing tasks as well as radio communication system for the implementation of the procedure
CN1965292A (en) * 2004-06-04 2007-05-16 Lm爱立信电话有限公司 Complex logarithmic ALU
CN103150137A (en) * 2013-03-01 2013-06-12 北京理工大学 Implementation method of single-precision floating point trigonometric function covering full circumferential angle
GB2537371B (en) * 2015-04-13 2019-10-02 Imagination Tech Ltd Modulo calculation using polynomials

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1375150A (en) * 1998-12-10 2002-10-16 艾利森公司 QAM modulator for radio communications
US20030165203A1 (en) * 2001-08-10 2003-09-04 Rishi Mohindra Quadrature gain and phase imbalance correction in a receiver
CN101938253A (en) * 2009-06-30 2011-01-05 瑞昱半导体股份有限公司 Carrier reconstructing device and method
CN105426340A (en) * 2015-11-10 2016-03-23 江苏商贸职业学院 Polar-harmonic sine and cosine transformation algorithm
CN107347044A (en) * 2017-07-19 2017-11-14 上海航天测控通信研究所 Multi-carrier modulation demodulation method in a kind of VDES systems

Also Published As

Publication number Publication date
CN109918047A (en) 2019-06-21

Similar Documents

Publication Publication Date Title
WO2019128567A1 (en) Data auditing method and device
US20210256537A1 (en) Methods, apparatuses, devices, and systems for asset transfer
WO2020119264A1 (en) Block chain-based screen recording evidence collection method and system, and electronic device
WO2020119271A1 (en) Block chain-based screen recording evidence obtaining method, system, and electronic device
CN112508200B (en) Method, apparatus, device, medium, and program for processing machine learning model file
WO2022100028A1 (en) Interface traffic anomaly detection method and apparatus, terminal device, and storage medium
WO2023005164A1 (en) Face key point detection method and apparatus, device, and computer-readable storage medium
CN112818387B (en) Method, apparatus, storage medium and program product for model parameter adjustment
WO2023197955A1 (en) Signal processing method and apparatus, electronic device, and medium
WO2020155224A1 (en) Method and device for calculating modulus of complex number based on modem
WO2021012563A1 (en) File encryption management method and system, and computer readable storage medium
CN112149141B (en) Model training method, device, equipment and medium
CN113610709B (en) Model quantization method, apparatus, electronic device, and computer-readable storage medium
WO2020042938A1 (en) Clustering-based frequency deviation determination and elimination method and device, and electronic apparatus
CN112732468B (en) Data processing method, data interaction system and computing equipment
WO2022057545A1 (en) File transfer method and apparatus, electronic device and computer-readable medium
CN117633835A (en) Data processing method, device, equipment and storage medium
CN115859749B (en) Constraint building method and device of three-dimensional model, electronic equipment and storage medium
WO2020119477A1 (en) Identity authentication method employing blockchain, and terminal apparatus
CN111951349A (en) Method and device for adjusting graph vertex type and electronic equipment
CN115659110A (en) Trigonometric function calculation method, device, equipment and storage medium
CN114398678A (en) Registration verification method and device for preventing electronic file from being tampered, electronic equipment and medium
US10904003B2 (en) Validation of short authentication data with a zero knowledge proof
Atkinson et al. Multivariate quadrature of a singular integrand
WO2020094023A1 (en) Road thinning algorithm

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: 19912653

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: 19912653

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.01.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19912653

Country of ref document: EP

Kind code of ref document: A1