CN109753107A - A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing - Google Patents

A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing Download PDF

Info

Publication number
CN109753107A
CN109753107A CN201811458631.2A CN201811458631A CN109753107A CN 109753107 A CN109753107 A CN 109753107A CN 201811458631 A CN201811458631 A CN 201811458631A CN 109753107 A CN109753107 A CN 109753107A
Authority
CN
China
Prior art keywords
phase
sinusoidal
target
sine
sinusoidal phase
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811458631.2A
Other languages
Chinese (zh)
Inventor
易龙强
李镇
王玮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XIAMEN KECAN INFORMATION TECHNOLOGY Co Ltd
Kehua Hengsheng Co Ltd
Original Assignee
XIAMEN KECAN INFORMATION TECHNOLOGY Co Ltd
Kehua Hengsheng Co Ltd
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 XIAMEN KECAN INFORMATION TECHNOLOGY Co Ltd, Kehua Hengsheng Co Ltd filed Critical XIAMEN KECAN INFORMATION TECHNOLOGY Co Ltd
Priority to CN201811458631.2A priority Critical patent/CN109753107A/en
Publication of CN109753107A publication Critical patent/CN109753107A/en
Pending legal-status Critical Current

Links

Landscapes

  • Position Fixing By Use Of Radio Waves (AREA)

Abstract

The invention discloses a kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing, comprising: establishes the sine table of target sector;Current sinusoidal phase finger is obtained, judges current sinusoidal phase finger whether in target sector;If so, searching sine value corresponding with current sinusoidal phase finger in sine table;If not, target sinusoidal phase pointer corresponding with current sinusoidal phase finger in target sector is obtained according to default corresponding relationship, target sine value corresponding with target sinusoidal phase pointer is searched in sine table, and the quadrant according to locating for current sinusoidal phase finger and target sine value obtain sine value corresponding with current sinusoidal phase finger;Digital sinusoidal signal is obtained by all sine values.Under identical precision conditions, present invention saves program's memory spaces, using the characteristic optimization look-up method of sinusoidal four-quadrant, to accelerate the calculating process of sinusoidal calculations, convenient for realizing the application demand of SPWM on the lesser MCU of resource.

Description

A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing
Technical field
The present invention relates to SPWM modulate field, more particularly to a kind of digital sinusoidal signal calculation method, system, device and Readable storage medium storing program for executing.
Background technique
In BMS (Battery Management System, battery management system) internal resistance detection application, in battery Resistance sampling module needs to motivate battery using sinusoidal constant-current source, in digital application field, in order to produce sinusoidal constant-current supply, needs It wants single-chip microcontroller to carry out digital sine pulsewidth modulation and forms SPWM (Sinusoidal Pulse Width Modulation, positive taut pulse Width modulation) impulse waveform, and then filter and obtain the reference signal source of sinusoidal constant-current source.Forming SPWM sinusoidal pulse width modulation When, system schema generallys use high frequency DDS (Direct Digital Frequency Synthesis, Direct Digital frequency Synthesizer) algorithm realizes that SPWM is exported, and needs to calculate current sinusoidal signal value in algorithm calculating process, it is real in the prior art The quick calculating of existing sinusoidal signal value is usually to need to establish one to obtain high-precision sinusoidal signal value using look-up table Biggish sine table is opened, it is contemplated that MCU (Microcontroller Unit, micro-control unit) program of the applications such as BMS Memory space resource is limited, and sine table should not occupy too big storage resource, and the precision of sinusoidal signal value is caused to be restricted.
Therefore, how to provide a kind of scheme of solution above-mentioned technical problem is that those skilled in the art need to solve at present Problem.
Summary of the invention
The object of the present invention is to provide a kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing, Under identical precision conditions, program's memory space has been saved, has accelerated the calculating process of sinusoidal calculations, convenient for lesser in resource The application demand of SPWM is realized on MCU.
In order to solve the above technical problems, the present invention provides a kind of digital sinusoidal signal calculation methods, comprising:
Establish the sine table of target sector;
Current sinusoidal phase finger is obtained, judges current sinusoidal phase finger whether in the target sector;
If so, searching sine value corresponding with current sinusoidal phase finger in the sine table;
If it is not, obtaining in the target sector target corresponding with current sinusoidal phase finger just according to default corresponding relationship String phase finger, searches corresponding with target sinusoidal phase pointer target sine value in the sine table, and according to currently just Quadrant locating for string phase finger and the target sine value obtain sine value corresponding with current sinusoidal phase finger;
Digital sinusoidal signal is obtained by all sine values.
Preferably, the process of the sine table for establishing target sector specifically:
Determine sinusoidal phase pointer digit;
Phase resolution is obtained by the sinusoidal phase pointer digit, target sector is established according to the phase resolution Sine table.
Preferably, after the sine table for establishing target sector, before obtaining current sinusoidal phase finger, the number is just String signal calculation method further include:
Phase finger offset is obtained by the sinusoidal phase pointer digit and the phase resolution;
Correspondingly, the process for searching sine value corresponding with current sinusoidal phase finger in the sine table is specific Are as follows:
Sine corresponding with current sinusoidal phase finger is searched in the sine table according to the phase finger offset Value;
Correspondingly, the process for searching target sine value corresponding with target sinusoidal phase pointer in the sine table is specific Are as follows:
Target corresponding with target sinusoidal phase pointer is searched in the sine table according to the phase finger offset Sine value.
Preferably, the mistake of phase finger offset is obtained by the sinusoidal phase pointer digit and the phase resolution Journey specifically:
Phase finger offset is calculated according to offset relationship formula, wherein the offset relationship formula is e=n-m-2, and e is institute Phase finger offset is stated, n is the sinusoidal phase pointer digit, and m is the phase resolution.
Preferably, it is described judge current sinusoidal phase finger whether the process in the target sector specifically:
Judge current sinusoidal phase finger whether in the mesh by the highest order and a time high position of current sinusoidal phase finger It marks in sector;
Correspondingly, the quadrant according to locating for the current sinusoidal phase finger and target sine value obtains and current sinusoidal The process of the corresponding sine value of phase finger specifically:
According to quadrant locating for the high-order determining current sinusoidal phase of the highest order and described time;
Sine value corresponding with current sinusoidal phase finger is obtained by the quadrant and the target sine value.
Preferably, described to be had according to the highest order with the described high-order process for determining quadrant locating for current sinusoidal phase Body are as follows:
When the highest order and the secondary high position are followed successively by 0,0, quadrant locating for current sinusoidal phase is first quartile;
When the highest order and the secondary high position are followed successively by 0,1, quadrant locating for current sinusoidal phase is the second quadrant;
When the highest order and the secondary high position are followed successively by 1,0, quadrant locating for current sinusoidal phase is third quadrant;
When the highest order and the secondary high position are followed successively by 1,1, quadrant locating for current sinusoidal phase is fourth quadrant.
In order to solve the above technical problems, the present invention provides a kind of digital sinusoidal signal computing systems, comprising:
Module is constructed, for establishing the sine table of target sector;
Whether judgment module judges current sinusoidal phase finger in the target for obtaining current sinusoidal phase finger In sector, if so, the first trigger signal is generated, if it is not, generating the second trigger signal;
Enquiry module, for obtaining the target according to default corresponding relationship after receiving second trigger signal Target sinusoidal phase pointer corresponding with current sinusoidal phase finger in sector generates third trigger signal;
The table look-up module, for being searched in the sine table and current after receiving first trigger signal The corresponding sine value of sinusoidal phase pointer;It is also used to after receiving the third trigger signal, is searched in the sine table Target sine value corresponding with target sinusoidal phase pointer;
Adjust module, for the quadrant according to locating for current sinusoidal phase finger and the target sine value obtain with it is current just The corresponding sine value of string phase finger;
Signal generation module, for obtaining digital sinusoidal signal by all sine values.
Preferably, the process of the sine table for establishing target sector specifically:
Determine sinusoidal phase pointer digit;
Phase resolution is obtained by the sinusoidal phase pointer digit, target sector is established according to the phase resolution Sine table.
In order to solve the above technical problems, the present invention also provides a kind of digital sinusoidal signal computing devices, comprising:
Memory, for storing computer program;
Processor realizes that digital sinusoidal signal calculates as described in any one above when for executing the computer program The step of method.
In order to solve the above technical problems, the present invention also provides a kind of readable storage medium storing program for executing, on the readable storage medium storing program for executing It is stored with computer program, realizes that digital sine is believed as described in any one above when the computer program is executed by processor The step of number calculation method.
The present invention provides a kind of digital sinusoidal signal calculation methods, comprising: establishes the sine table of target sector;Acquisition is worked as Whether preceding sinusoidal phase pointer judges current sinusoidal phase finger in target sector;If so, searched in sine table with it is current The corresponding sine value of sinusoidal phase pointer;If it is not, obtaining referring in target sector with current sinusoidal phase according to default corresponding relationship The corresponding target sinusoidal phase pointer of needle searches target sine value corresponding with target sinusoidal phase pointer in sine table, and Sine value corresponding with current sinusoidal phase finger is obtained according to quadrant locating for current sinusoidal phase finger and target sine value;It is logical It crosses all sine values and obtains digital sinusoidal signal.
As it can be seen that in practical applications, using the solution of the present invention, it is only necessary to establish the sine table of a target sector, i.e., Sine value corresponding to the sinusoidal phase pointer in any sector can be inquired and saved 75% under identical precision conditions Program's memory space, meanwhile, look-up method has been advanced optimized using the feature of sinusoidal four-quadrant, to accelerate sinusoidal meter The calculating process of calculation, convenient for realizing the application demand of SPWM on the lesser MCU of resource.
The present invention also provides a kind of digital sinusoidal signal computing system, device and readable storage medium storing program for executing, have and above-mentioned The identical beneficial effect of digital sinusoidal signal calculation method.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to institute in the prior art and embodiment Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings Obtain other attached drawings.
Fig. 1 is a kind of step flow chart of digital sinusoidal signal calculation method provided by the present invention;
Fig. 2 is a kind of four sector distribution map of sine value provided by the present invention;
Fig. 3 is a kind of structural schematic diagram of digital sinusoidal signal computing system provided by the present invention.
Specific embodiment
Core of the invention is to provide a kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing, Under identical precision conditions, program's memory space has been saved, has accelerated the calculating process of sinusoidal calculations, convenient for lesser in resource The application demand of SPWM is realized on MCU.
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Fig. 1 is please referred to, Fig. 1 is a kind of step flow chart of digital sinusoidal signal calculation method provided by the present invention, packet It includes:
Step 1: establishing the sine table of target sector;
Specifically, sine value can be divided into four sectors referring to shown in Fig. 2, target sector refers to appointing in four sectors It anticipates a sector, sine table is established according to the corresponding relationship of phase finger in target sector and sine value.
Embodiment as one preferred establishes the process of the sine table of target sector specifically:
Determine sinusoidal phase pointer digit;
Phase resolution is obtained by sinusoidal phase pointer digit, the sine of target sector is established according to phase resolution Table.
Specifically, the phase resolution of sine table is generally less than or equal to sinusoidal phase pointer digit, sinusoidal phase pointer Digit often selects 16bit or 32bit, and occasion lower for some precision applications can also select 8bit.It is wanted according to sinusoidal precision It asks and system code memory block size, the sinusoidal table size of design 1/4.As established sinusoidal first sector (phase is 0~pi/2) Sine table, it is assumed that sinusoidal phase pointer is 16bit, then being spaced phase value resolution ratio (the i.e. described phase resolution) in sine table It can be set to 10, that is, establish the sine table for sharing 1024 points.
Step 2: obtaining current sinusoidal phase finger;
Step 3: current sinusoidal phase finger is judged whether in target sector, if so, 4 are entered step, if it is not, entering step Rapid 5;
Step 4: sine value corresponding with current sinusoidal phase finger is searched in sine table;
Step 5: it is sinusoidal that target corresponding with current sinusoidal phase finger in target sector being obtained according to default corresponding relationship Phase finger searches target sine value corresponding with target sinusoidal phase pointer in sine table, and according to current sinusoidal phase Quadrant locating for pointer and target sine value obtain sine value corresponding with current sinusoidal phase finger;
Specifically, in view of current sinusoidal phase finger may not be in target sector, therefore pre-establish target sector With the corresponding relationship of other sectors, corresponding relationship here can specifically refer to sinusoidal phase pointer and mesh in other sectors Mark the corresponding relationship of the sinusoidal phase pointer in sector.By taking four sectors as an example, it is assumed that target sector is located in first quartile, the Two sectors are located in the second quadrant, and third sector is located in third quadrant, and the 4th sector is located in fourth quadrant, specifically, After getting current sinusoidal phase finger, first determine whether current sinusoidal phase finger is in target sector, if so, that is just Sine value corresponding with current sinusoidal phase finger is searched directly in sine table, if it is not, then obtaining according to default corresponding relationship Then target sinusoidal phase pointer corresponding with current sinusoidal phase finger in target sector is searched with target just in sine table The corresponding target sine value of string phase finger, it is contemplated that quadrant locating for sinusoidal phase pointer is not at the same time, it must also be considered that sine value Positive and negative problem therefore need the quadrant according to locating for current sinusoidal phase finger to determine sine value after obtaining target sine value It is positive and negative, to obtain sine value corresponding with current sinusoidal phase finger.The present invention is only provided with the sine table of a sector, By the corresponding relationship of the sector and other sectors, the corresponding sine of sinusoidal phase pointer in any sector can be inquired Value, under the premise of guaranteeing precision, has saved 75% program's memory space, has answered suitable for some low-resource sinusoidal signals Use occasion.
Step 6: obtaining digital sinusoidal signal by all sine values.
Specifically, all sine values are combined by preset rules can be obtained digital sinusoidal signal.
The present invention provides a kind of digital sinusoidal signal calculation methods, comprising: establishes the sine table of target sector;Acquisition is worked as Whether preceding sinusoidal phase pointer judges current sinusoidal phase finger in target sector;If so, searched in sine table with it is current The corresponding sine value of sinusoidal phase pointer;If it is not, obtaining referring in target sector with current sinusoidal phase according to default corresponding relationship The corresponding target sinusoidal phase pointer of needle searches target sine value corresponding with target sinusoidal phase pointer in sine table, and Sine value corresponding with current sinusoidal phase finger is obtained according to quadrant locating for current sinusoidal phase finger and target sine value;It is logical It crosses all sine values and obtains digital sinusoidal signal.
As it can be seen that in practical applications, using the solution of the present invention, only establishing the sine table of a target sector, Ji Kecha It askes sine value corresponding to the sinusoidal phase pointer in any sector and has saved 75% journey under identical precision conditions Sequence memory space, meanwhile, look-up method is advanced optimized using the feature of sinusoidal four-quadrant, to accelerate sinusoidal calculations Calculating process, convenient for realizing the application demand of SPWM on the lesser MCU of resource.
On the basis of the above embodiments:
Embodiment as one preferred is established after the sine table of target sector, obtain current sinusoidal phase finger it Before, the digital sinusoidal signal calculation method further include:
Phase finger offset is obtained by sinusoidal phase pointer digit and phase resolution;
Correspondingly, searching the process of sine value corresponding with current sinusoidal phase finger in sine table specifically:
Sine value corresponding with current sinusoidal phase finger is searched in sine table according to phase finger offset;
Correspondingly, searching the process of target sine value corresponding with target sinusoidal phase pointer in sine table specifically:
Target sine value corresponding with target sinusoidal phase pointer is searched in sine table according to phase finger offset.
Embodiment as one preferred obtains phase finger offset by sinusoidal phase pointer digit and phase resolution The process of amount specifically:
Phase finger offset is calculated according to offset relationship formula, wherein offset relationship formula is e=n-m-2, and e refers to for phase Needle offset, n are sinusoidal phase finger digit, and m is phase resolution.
Specifically, when phase resolution is less than sinusoidal phase pointer digit, it is also necessary to calculate phase finger offset, i.e., Phase finger is tabled look-up offset, and specific calculation is referred to offset relationship formula e=n-m-2, it is assumed that the interval of sine table Phase value resolution ratio is 10, and sinusoidal phase pointer digit is 16, then phase finger offset is 4, that is, is needed during tabling look-up Sinusoidal phase pointer is moved to right four.
Embodiment as one preferred, judging current sinusoidal phase finger, whether process in target sector is specific Are as follows:
Judge current sinusoidal phase finger whether in target fan by the highest order and a time high position of current sinusoidal phase finger In area;
Correspondingly, the quadrant according to locating for current sinusoidal phase finger and target sine value obtain and current sinusoidal phase finger The process of corresponding sine value specifically:
According to quadrant locating for highest order and time high-order determining current sinusoidal phase;
Sine value corresponding with current sinusoidal phase finger is obtained by quadrant and target sine value.
Embodiment as one preferred, according to highest order and time high-order process for determining quadrant locating for current sinusoidal phase Specifically:
When highest order and a time high position are followed successively by 0,0, quadrant locating for current sinusoidal phase is first quartile;
When highest order and a time high position are followed successively by 0,1, quadrant locating for current sinusoidal phase is the second quadrant;
When highest order and a time high position are followed successively by 1,0, quadrant locating for current sinusoidal phase is third quadrant;
When highest order and a time high position are followed successively by 1,1, quadrant locating for current sinusoidal phase is fourth quadrant.
Specifically, the highest order of sinusoidal phase pointer and a time high position can identify quadrant locating for the sinusoidal phase pointer, By taking sinusoidal phase pointer Index is 16bits as an example, the corresponding relationship of sinusoidal phase pointer and the formation of four sectors of sine value is such as Shown in table 1.
1 sinusoidal phase pointer of table and sinusoidal four sector mapping tables
Referring to table 1 it is found that the highest order bit15 of sinusoidal phase pointer Index and time high position bit14, actual identification is worked as Four quadrants where preceding sinusoidal phase pointer, while bit15 controls the positive and negative of sine value, specifically, when sinusoidal phase refers to When the highest order bit15 of needle Index and time high position bit14 are followed successively by 0,0, sinusoidal phase pointer Index is in first quartile, when When the highest order bit15 of sinusoidal phase pointer Index and time high position bit14 are followed successively by 0,1, sinusoidal phase pointer Index is in Second quadrant, when the highest order bit15 of sinusoidal phase pointer Index and time high position bit14 is followed successively by 1,0, sinusoidal phase refers to Needle Index is in third quadrant, when the highest order bit15 of sinusoidal phase pointer Index and time high position bit14 is followed successively by 1,1, Sinusoidal phase pointer Index is in fourth quadrant, correspondingly, when bit15 is 0, the corresponding sine of sinusoidal phase pointer Index Value is positive, and when bit15 is 1, the corresponding sine value of sinusoidal phase pointer Index is negative.Sinusoidal phase pointer Index's Bit13~bit0 in four quadrants the period from full 0 transform to complete 1 (i.e. 16383).It should be noted that in the second quadrant With the growing direction of sine value when fourth quadrant and the growing direction of sinusoidal phase pointer Index just on the contrary, available at this time Bit14 control phase finger direction of tabling look-up has advanced optimized and has tabled look-up so that scheme fixed-point computation provided by the present invention is fast Method.
Specifically, tabling look-up so that target sector is the sector (phase is 0~pi/2) in first quartile as an example to above-mentioned Journey is illustrated, and first determines whether the position bit14 of current sinusoidal phase finger is 1, if so, pressing to bit13~bit0 Position is negated, and what is obtained is exactly current sinusoidal phase finger in the corresponding target sinusoidal phase pointer in target sector, into next step Judgement directly carries out next step judgement if the position bit14 of current sinusoidal phase finger is 0, that is, judges sinusoidal phase pointer Whether bit15 be 1, if so, corresponding sine value after negative sinusoidal phase pointer moves to right four is exported, if it is not, then exporting Corresponding sine value after positive sinusoidal phase pointer moves to right four.
Referring to figure 3., Fig. 3 is a kind of structural schematic diagram of digital sinusoidal signal computing system provided by the present invention, packet It includes:
Module 1 is constructed, for establishing the sine table of target sector;
Whether judgment module 2 judges current sinusoidal phase finger in target sector for obtaining current sinusoidal phase finger It is interior, if so, the first trigger signal is generated, if it is not, generating the second trigger signal;
Enquiry module 3, for after receiving the second trigger signal, according to default corresponding relationship obtain in target sector with The corresponding target sinusoidal phase pointer of current sinusoidal phase finger generates third trigger signal;
Table look-up module 4, for being searched and current sinusoidal phase finger in sine table after receiving the first trigger signal Corresponding sine value;It is also used to after receiving third trigger signal, lookup refers to target sinusoidal phase in sine table is directed to The target sine value answered;
Module 5 is adjusted, for the quadrant according to locating for current sinusoidal phase finger and target sine value obtains and current sinusoidal The corresponding sine value of phase finger;
Signal generation module 6, for obtaining digital sinusoidal signal by all sine values.
Embodiment as one preferred establishes the process of the sine table of target sector specifically:
Determine sinusoidal phase pointer digit;
Phase resolution is obtained by sinusoidal phase pointer digit, the sine of target sector is established according to phase resolution Table.
Embodiment as one preferred, the digital sinusoidal signal computing system further include:
Computing module, for obtaining phase finger offset by sinusoidal phase pointer digit and phase resolution;
Correspondingly, searching the process of sine value corresponding with current sinusoidal phase finger in sine table specifically:
Sine value corresponding with current sinusoidal phase finger is searched in sine table according to phase finger offset;
Correspondingly, searching the process of target sine value corresponding with target sinusoidal phase pointer in sine table specifically:
Target sine value corresponding with target sinusoidal phase pointer is searched in sine table according to phase finger offset.
Embodiment as one preferred, computing module are specifically used for:
Phase finger offset is calculated according to offset relationship formula, wherein offset relationship formula is e=n-m-2, and e refers to for phase Needle offset, n are sinusoidal phase finger digit, and m is phase resolution.
Embodiment as one preferred, judging current sinusoidal phase finger, whether process in target sector is specific Are as follows:
Judge current sinusoidal phase finger whether in target fan by the highest order and a time high position of current sinusoidal phase finger In area;
Correspondingly, the quadrant according to locating for current sinusoidal phase finger and target sine value obtain and current sinusoidal phase finger The process of corresponding sine value specifically:
According to quadrant locating for highest order and time high-order determining current sinusoidal phase;
Sine value corresponding with current sinusoidal phase finger is obtained by quadrant and target sine value.
Embodiment as one preferred, according to highest order and time high-order process for determining quadrant locating for current sinusoidal phase Specifically:
When highest order and a time high position are followed successively by 0,0, quadrant locating for current sinusoidal phase is first quartile;
When highest order and a time high position are followed successively by 0,1, quadrant locating for current sinusoidal phase is the second quadrant;
When highest order and a time high position are followed successively by 1,0, quadrant locating for current sinusoidal phase is third quadrant;
When highest order and a time high position are followed successively by 1,1, quadrant locating for current sinusoidal phase is fourth quadrant.
A kind of digital sinusoidal signal computing system provided by the present invention has and above-mentioned digital sinusoidal signal calculation method Identical beneficial effect.
For a kind of introduction of digital sinusoidal signal computing system provided by the present invention, above-described embodiment is please referred to, this Details are not described herein for invention.
Correspondingly, the present invention also provides a kind of digital sinusoidal signal computing devices, comprising:
Memory, for storing computer program;
Processor realizes the step such as any one digital sinusoidal signal calculation method above when for executing computer program Suddenly.
A kind of digital sinusoidal signal computing device provided by the present invention has and above-mentioned digital sinusoidal signal calculation method Identical beneficial effect.
For a kind of introduction of digital sinusoidal signal computing device provided by the present invention, above-described embodiment is please referred to, this Details are not described herein for invention.
Correspondingly, it is stored with computer program on readable storage medium storing program for executing the present invention also provides a kind of readable storage medium storing program for executing, It realizes when computer program is executed by processor such as the step of any one digital sinusoidal signal calculation method above.
A kind of readable storage medium storing program for executing provided by the present invention has with identical with above-mentioned digital sinusoidal signal calculation method Beneficial effect.
For a kind of introduction of readable storage medium storing program for executing provided by the present invention, above-described embodiment is please referred to, the present invention is herein It repeats no more.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment For, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is said referring to method part It is bright.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.

Claims (10)

1. a kind of digital sinusoidal signal calculation method characterized by comprising
Establish the sine table of target sector;
Current sinusoidal phase finger is obtained, judges current sinusoidal phase finger whether in the target sector;
If so, searching sine value corresponding with current sinusoidal phase finger in the sine table;
If it is not, obtaining target sine phase corresponding with current sinusoidal phase finger in the target sector according to default corresponding relationship Bit pointer searches target sine value corresponding with target sinusoidal phase pointer in the sine table, and according to current sinusoidal phase Quadrant locating for bit pointer and the target sine value obtain sine value corresponding with current sinusoidal phase finger;
Digital sinusoidal signal is obtained by all sine values.
2. digital sinusoidal signal calculation method according to claim 1, which is characterized in that described to establish target sector just The process of string table specifically:
Determine sinusoidal phase pointer digit;
Phase resolution is obtained by the sinusoidal phase pointer digit, target sector is being established just according to the phase resolution String table.
3. digital sinusoidal signal calculation method according to claim 2, which is characterized in that described to establish target sector just After string table, before obtaining current sinusoidal phase finger, the digital sinusoidal signal calculation method further include:
Phase finger offset is obtained by the sinusoidal phase pointer digit and the phase resolution;
Correspondingly, the process for searching sine value corresponding with current sinusoidal phase finger in the sine table specifically:
Sine value corresponding with current sinusoidal phase finger is searched in the sine table according to the phase finger offset;
Correspondingly, searching the process of target sine value corresponding with target sinusoidal phase pointer in the sine table specifically:
It is sinusoidal that target corresponding with target sinusoidal phase pointer is searched in the sine table according to the phase finger offset Value.
4. digital sinusoidal signal calculation method according to claim 3, which is characterized in that pass through the sinusoidal phase pointer Digit and the phase resolution obtain the process of phase finger offset specifically:
Phase finger offset is calculated according to offset relationship formula, wherein the offset relationship formula is e=n-m-2, and e is the phase Bit pointer offset, n are the sinusoidal phase pointer digit, and m is the phase resolution.
5. digital sinusoidal signal calculation method according to claim 1, which is characterized in that the judgement current sinusoidal phase Pointer whether the process in the target sector specifically:
Judge current sinusoidal phase finger whether in target fan by the highest order and a time high position of current sinusoidal phase finger In area;
Correspondingly, the quadrant according to locating for current sinusoidal phase finger and the target sine value obtain and current sinusoidal phase The process of the corresponding sine value of pointer specifically:
According to quadrant locating for the high-order determining current sinusoidal phase of the highest order and described time;
Sine value corresponding with current sinusoidal phase finger is obtained by the quadrant and the target sine value.
6. digital sinusoidal signal calculation method according to claim 5, which is characterized in that it is described according to the highest order and The described high-order process for determining quadrant locating for current sinusoidal phase specifically:
When the highest order and the secondary high position are followed successively by 0,0, quadrant locating for current sinusoidal phase is first quartile;
When the highest order and the secondary high position are followed successively by 0,1, quadrant locating for current sinusoidal phase is the second quadrant;
When the highest order and the secondary high position are followed successively by 1,0, quadrant locating for current sinusoidal phase is third quadrant;
When the highest order and the secondary high position are followed successively by 1,1, quadrant locating for current sinusoidal phase is fourth quadrant.
7. a kind of digital sinusoidal signal computing system characterized by comprising
Module is constructed, for establishing the sine table of target sector;
Whether judgment module judges current sinusoidal phase finger in the target sector for obtaining current sinusoidal phase finger It is interior, if so, the first trigger signal is generated, if it is not, generating the second trigger signal;
Enquiry module, for obtaining the target sector according to default corresponding relationship after receiving second trigger signal Interior target sinusoidal phase pointer corresponding with current sinusoidal phase finger generates third trigger signal;
The table look-up module is searched and current sinusoidal in the sine table for after receiving first trigger signal The corresponding sine value of phase finger;It is also used to after receiving the third trigger signal, lookup and mesh in the sine table Mark the corresponding target sine value of sinusoidal phase pointer;
Module is adjusted, is obtained and current sinusoidal phase for the quadrant according to locating for current sinusoidal phase finger and the target sine value The corresponding sine value of bit pointer;
Signal generation module, for obtaining digital sinusoidal signal by all sine values.
8. digital sinusoidal signal computing system according to claim 7, which is characterized in that described to establish target sector just The process of string table specifically:
Determine sinusoidal phase pointer digit;
Phase resolution is obtained by the sinusoidal phase pointer digit, target sector is being established just according to the phase resolution String table.
9. a kind of digital sinusoidal signal computing device characterized by comprising
Memory, for storing computer program;
Processor realizes digital sinusoidal signal as claimed in any one of claims 1 to 6 when for executing the computer program The step of calculation method.
10. a kind of readable storage medium storing program for executing, which is characterized in that be stored with computer program, the meter on the readable storage medium storing program for executing Calculation machine program realizes the step of digital sinusoidal signal calculation method as claimed in any one of claims 1 to 6 when being executed by processor Suddenly.
CN201811458631.2A 2018-11-30 2018-11-30 A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing Pending CN109753107A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811458631.2A CN109753107A (en) 2018-11-30 2018-11-30 A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811458631.2A CN109753107A (en) 2018-11-30 2018-11-30 A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing

Publications (1)

Publication Number Publication Date
CN109753107A true CN109753107A (en) 2019-05-14

Family

ID=66403484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811458631.2A Pending CN109753107A (en) 2018-11-30 2018-11-30 A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing

Country Status (1)

Country Link
CN (1) CN109753107A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112583240A (en) * 2020-12-04 2021-03-30 武汉海德博创科技有限公司 Frequency conversion table look-up algorithm suitable for digital control

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7701260B1 (en) * 2007-05-25 2010-04-20 Xilinx, Inc. Phase-to-sinusoid conversion
CN105634497A (en) * 2014-10-29 2016-06-01 江苏绿扬电子仪器集团有限公司 ROM table data storage and compression device for aiming at DDS signal source
CN206431518U (en) * 2017-01-03 2017-08-22 聊城大学 A kind of simple and economical waveform generator based on DDS technologies

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7701260B1 (en) * 2007-05-25 2010-04-20 Xilinx, Inc. Phase-to-sinusoid conversion
CN105634497A (en) * 2014-10-29 2016-06-01 江苏绿扬电子仪器集团有限公司 ROM table data storage and compression device for aiming at DDS signal source
CN206431518U (en) * 2017-01-03 2017-08-22 聊城大学 A kind of simple and economical waveform generator based on DDS technologies

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
袁玉卓 等: "《FPGA自学笔记 设计与验证》", 31 August 2017, 北京航空航天大学出版社 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112583240A (en) * 2020-12-04 2021-03-30 武汉海德博创科技有限公司 Frequency conversion table look-up algorithm suitable for digital control
CN112583240B (en) * 2020-12-04 2024-04-26 武汉海德博创科技有限公司 Variable frequency table look-up algorithm suitable for digital control

Similar Documents

Publication Publication Date Title
CN109975611A (en) A kind of Fourier's analysis method of variable sampling rate
CN202083398U (en) Signal conditioning circuit of rotating transformer
CN101930351B (en) Signal processing method and apparatus based on CORDIC
CN105629060B (en) Power grid frequency measurement method and device based on optimal baseband filtering
CN103178851B (en) A kind of novel sampling method producing SPWM control signal
CN102236048A (en) Method for measuring phasor frequency of electric system
CN109753107A (en) A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing
CN109739470A (en) A kind of computing system based on 2 type hyperbolic CORDIC arbitrary characteristics functions
CN105450224A (en) Direct digital frequency synthesis method and direct digital frequency synthesizer
CN109614073A (en) Four-quadrant arctan function hardware circuit implementation
CN110068729A (en) A kind of signal phasor calculating method
CN106597095B (en) A kind of frequency-tracking implementation method of dual processors equal interval sampling
CN109901382B (en) Regular sampling PWM (pulse-Width modulation) optimization method of digital control system
CN104133110A (en) Method for achieving cursor for frequency hopping signal time-frequency characteristic measurement
CN103697874B (en) A kind of quartz digital tuning fork gyroscope drives loop control circuit
CN104569573B (en) The measuring method and measuring circuit of a kind of power parameter
CN102263600B (en) Method and device for determining movement speed of terminal
CN112769324B (en) Dead zone compensation method and device, electronic equipment and storage medium
CN106597092A (en) High-precision anti-interference fixed-point computer three-phase voltage frequency measurement phase-locking algorithm
CN107678334A (en) The MCU chip of built-in amplifier and its application on frequency conversion refrigerator
CN104215924B (en) Synchronous demodulator, power standard source comprising synchronous demodulator and control method of power standard source
CN111987920A (en) Three-level space vector modulation method
CN204068930U (en) A kind of phase-locked loop
CN204065387U (en) A kind of synchronous demodulator and comprise the power standard source of this synchronous demodulator
CN203661014U (en) Signal duty ratio and period detection system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190514