CN100511211C - Periodic function argument converting device, method and communication apparatus using same - Google Patents

Periodic function argument converting device, method and communication apparatus using same Download PDF

Info

Publication number
CN100511211C
CN100511211C CNB2006101040552A CN200610104055A CN100511211C CN 100511211 C CN100511211 C CN 100511211C CN B2006101040552 A CNB2006101040552 A CN B2006101040552A CN 200610104055 A CN200610104055 A CN 200610104055A CN 100511211 C CN100511211 C CN 100511211C
Authority
CN
China
Prior art keywords
value
fixed point
centerdot
sine
prime
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.)
Expired - Fee Related
Application number
CNB2006101040552A
Other languages
Chinese (zh)
Other versions
CN1904876A (en
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2006101040552A priority Critical patent/CN100511211C/en
Publication of CN1904876A publication Critical patent/CN1904876A/en
Application granted granted Critical
Publication of CN100511211C publication Critical patent/CN100511211C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Complex Calculations (AREA)

Abstract

The invention discloses a cycling function independent variable transformation device that includes normalization process unit to gain locating point independent variable, independent variable transformation unit used to setting the integer part and keeping the decimal part of locating point. The invention also discloses a cycling function independent variable transformation method, sine and cosine value determine device, and the receiver and sender in communication system. The invention could sharply decrease the demand to computer resource and storage resource, and lower cost.

Description

Periodic function independent variable converting means, method and use its communication facilities
Technical field
The present invention relates to the computing electronics field, more particularly, relate to a kind of periodic function independent variable converting means, method and use its communicator.
Background technology
Modern Communication System is normally a kind of based in digital signal processing (DSP), field programmable gate array (FPGA), the application-specific IC technology such as (ASIC), or wherein certain several combination realizes.In Modern Communication System, some other modules in modulator, Time and Frequency Synchronization module, channel equalization module and the practical communication system need be used a large amount of sines and cos operation usually.Along with the bandwidth of Modern Communication System is more and more wideer, unit interval domestic demand data volume to be processed is increasing, and the rapidity of cycle computings such as offset of sinusoidal and cosine and validity have proposed very high requirement.In addition, not only in communication system, in a lot of other electronic systems, control system, also need to use in a large number sine and cos operation.Sinusoidal fast and effectively and cos operation not only can be accelerated response time, the raising system performance of these systems, and can also save system resource effectively, reduces system cost.
In order to improve arithmetic speed, to reduce system cost, all be to adopt fixed-point number to calculate under a lot of situations in these systems.When carrying out floating point arithmetic, at first need to convert floating number to fixed-point number, and then utilize the fixed-point number computing to realize the computing of floating number.Floating number is represented with fixed-point number, and utilized the fixed-point number computing to realize that the process of the computing of floating number is called as fixed point.Fixed-point number with 16 bit lengths is an example below, and the process of fixed point is described.
Before explanation fixed point process, need the method for expressing that explanation positive definite is counted and negative definite is counted earlier.In present application, fixed-point number is generally all represented with the two's complement form.Each 16 figure place is represented the positive and negative of fixed-point number with a sign bit, and 0 expression numerical value is being for just, and 1 expression numerical value is for bearing, the absolute value of all the other 15 bit representation numerical value, and for positive integer and 0, this 15 bit value corresponding is exactly the absolute value of this number; And for negative integer, the radix-minus-one complement of this 15 bit adds the absolute value that 1 pairing numerical value is only this number.In the following example:
Binary number 0010000000000011b → 8195
Binary number 1111111111111100b →-4
The crucial part of fixed point process be exactly as how an integer represent a decimal, wherein most important is exactly to determine the position of radix point in this 16 bit, be the integral part that the bit on the radix point left side is used for representing decimal, and the bit on radix point the right is used for representing the fraction part of decimal.By setting radix point different position in 16 bits, just can represent the decimal of different sizes and different accuracy.
Above process just be called several calibrations, Q representation and (a, b) representation is two kinds is arranged.Table 1 is that the Q of 16 bit fixed pointization represents and (a, b) expression and decimal system numerical value scope table.
Q represents (a, b) expression Decimal number is represented scope
Q15 (1,15) -1≤X≤0.999969482421875
Q14 (2,14) -2≤X≤1.99993896484375
Q13 (3,13) -4≤X≤3.9998779296875
Q12 (4,12) -8≤X≤7.999755859375
Q11 (5,11) -16≤X≤15.99951171875
Q10 (6,10) -32≤X≤31.9990234375
Q9 (7,9) -64≤X≤63.998046875
Q8 (8,8) -128≤X≤127.99609375
Q7 (9,7) -256≤X≤255.9921875
Q6 (10,6) -512≤X≤511.984375
Q5 (11,5) -1024≤X≤1023.96875
Q4 (12,4) -2048≤X≤2047.9375
Q3 (13,3) -4096≤X≤4095.875
Q2 (14,2) -8192≤X≤8191.75
Q1 (15,1) -16384≤X≤16383.5
Q0 (16,0) -32768≤X≤32767
Table 1
As above shown in the table, the Q representation has only provided the bit wide of expression fraction part.And (a, b) the expression rule has provided the bit wide of expression integral part and fraction part simultaneously, and the integer bit wide has here comprised sign bit.Generally with (a, the b) a in the representation, b are called integer bit wide and decimal bit wide.Method for expressing that has and expression described here are different, sign bit are not included in the integer-bit width.This just difference to some extent on representation, its corresponding calculating process is duplicate.
It can also be seen that from last table, same one 16 figure place, if the position difference that radix point is set, promptly fixed mark is different, its represented number is also different.
Such as, for 4 16 same system numbers (corresponding 16 bits) 0x2001H, have:
0x2001H → 8193, calibration (16,0)
0x2001H → 32.00390625, calibration (8,8)
0x2001H → 0.250030517578125, calibration (1,15)
It can also be seen that from last table the represented number of different scaled values is the scope difference not only, and the precision that can represent is also inequality, under the identical situation of total number of bits, the decimal bit wide is big more, and the numerical range that can represent is more little, but precision is high more; On the contrary, the decimal bit wide is following more, and the numerical range that can represent is big more, but precision is low more.
Such as, the numerical range of (16,0) is-32768 to+32767, precision is 1; And the numerical range of (1,15) is-1 to 0.999969482421875, and precision is 1/32768=0.000030517578125.So for fixed-point number, numerical range and precision are a pair of contradiction, a variable wants to represent the numerical range of comparison, need be cost to sacrifice precision; And want to improve precision, then the expression scope of numerical value just will reduce accordingly.
In the fixed-point algorithm of reality,, must fully take into account this point in order to arrive best performance.
With the calibration (a b) is example, and the transformational relation of floating number and fixed-point number can be expressed as:
Floating number x is converted to fixed-point number x z: x z=round (x2 b)
Fixed-point number x zBe converted to floating number x:x=float (x z2 -b)
Wherein round () represents round, and float () expression is used as input parameter as floating number.
When the fixed-point number of correspondence is unsigned number, then in the integer bit wide, do not need to consider sign bit, and other parts all there is similar processing.Following discussion all is that example describes with the signed integer, for signless integer similar process is arranged, and all conclusions that obtain all has similar conclusion here under the signless integer situation.
Under the fixed point condition, by the angle value of input, it is very complicated often directly in real time to calculate its corresponding sine value and cosine value, and speed is slow, is difficult to satisfy system requirements.So seldom directly carry out the calculating of the sine value and the cosine value of fixed point in these systems, but reduce computational complexity, improve arithmetic speed, to reach system requirements by the mode of tabling look-up.
The basic thought of look-up method is exactly: be exactly that all or part of fixed point sine value in the one-period or cosine value are precomputed, and exist in the storer.When needs calculate sine value or cosine value, according to the fixed point angle value of input,, obtain it for sine value or the pairing memory address of cosine value by calculating, then directly read the numerical value of storage, be the sine value or the cosine value of this angle value correspondence to this address.
Obviously will (∞ ,+∞) pairing sine value of angle value and cosine value all calculate in advance in the scope, and store, be very difficult the realization.Generally speaking, all be the periodicity of utilizing sine function and cosine function, the sine value or the cosine value of angle value correspondence in the specific period calculated in advance, and stores, such as (π ,+π) or in (0,2 π) scope.Like this, when tabling look-up, when the input angle value in this scope, can directly obtain the memory address of its sine value or cosine value correspondence by certain calculation; And when the angle value of input not in this scope the time, just need to utilize earlier periodically, this angle value is transformed in the scope that sine table or cosine table can represent, and then obtain the memory address of its sine value or cosine value correspondence by certain calculation.
Therefore, so just need be in which according to angle in cycle, the branch situation is discussed, then in the scope that angular transformation can be represented to sine table or cosine table.Often be unfavorable for code optimization and carry out branch's judgement, efficient is carried out in influence.
At present, a kind of angle value changing method is arranged, be referred to as first kind of prior art at this.
In first kind of prior art, suppose known angle φ, it need be transformed in the cycle of appointment, be assumed to be here [0,2 π).Angle φ after then changing TShould satisfy φ=2 π n+ φ T, φ T∈ [0,2 π), n is an integer.
Suppose that φ is (M in scaled values 1, M 2) fixed point value under the situation is φ z, the fixed point value of 2 π under identical scaled values is M 2 π, φ TFixed point value under identical scaled values is φ Tz, then have:
φ z=M ·n+φ Tz (1)
At first, obtain the n value by division; Then, utilize the n value that obtains to calculate φ Tz
φ Tz=φ z-M ·n (2)
In first kind of prior art, need to carry out fixed point division, be a very operation of consumption systems computational resource and in fixed-point system, do fixed point division, thus first kind of prior art consumption calculations resource greatly, and increase system cost.
At present, also have a kind of angle value transform method, be referred to as second kind of prior art at this.
In many systems, angle φ is the accumulation amount of t (or some other a parameter) variation in time, be φ (t)=φ (t-1)+Δ φ, and Δ φ smaller amount often, be [0 corresponding to designated period like this, 2 π) situation, can think φ only [2 π, 4 π) change in the scope.Can realize angular transformation by judging to shift like this.
&phi; Tz = &phi; z - M 2 &pi; , &phi; z &GreaterEqual; M 2 &pi; &phi; z , 0 &le; &phi; z < M 2 &pi; &phi; z + M 2 &pi; , &phi; z < 0 - - - ( 3 )
With respect to first kind of prior art, second kind of prior art avoided the fixed point division computing, but still need carry out branch and judge, especially carry out in the system of a large amount of sine values and cosine value calculating at needs, carry out branch's logic determines continually, can improve demand significantly, increase system cost, and all very big influence can be arranged the optimization and the execution efficient of system performance to computational resource.
More than describe angle value transformation problem involved in the trigonometric function in detail.But problem but not only is confined to trigonometric function.On the contrary, for periodic function arbitrarily, all may relate to the problem that similarly independent variable is transformed in the designated period scope, and prior art has same or analogous defective in the face of this problem the time.
Summary of the invention
In view of this, another object of the present invention is the frequency deviation compensating device that proposes in a kind of communication system, with the computing velocity of quickening frequency offset compensation, thus the efficient of raising Frequency offset estimation.
For achieving the above object, technical scheme of the present invention is achieved in that
Frequency deviation compensating device in a kind of communication system, this device comprises:
The Frequency offset estimation unit, the data that are used to treat frequency offset compensation are carried out Frequency offset estimation,
Compensation of phase calculates the unit, is used to calculate the phase place of needs compensation;
The sine and cosine value is determined device, be used for to just comprising/signal of cosine function handles, this sine and cosine value determines that device comprises integer-bit storage unit, independent variable converter unit and sine and cosine value determining unit in normalized unit, the designated period scope, wherein:
The normalized unit, be used for according to the integral multiple of π to input just/cosine function fixed point independent variable carries out normalized, with obtain after the normalized fixed point just/the cosine function independent variable;
Integer-bit storage unit in the designated period scope, be used to store after the described normalized fixed point just/integral part of cosine function independent variable in the designated period scope;
The independent variable converter unit, be used for the fixed point after the described normalized just/integral part of cosine function independent variable, be set to this integral part of being stored by integer-bit storage unit in the designated period scope, and with the fixed point after the described normalized just/fraction part of cosine function independent variable remains unchanged;
Sine and cosine value determining unit, determine the fixed point exported by described independent variable converter unit just/the cosine function independent variable just/cosine value;
The frequency offset compensation unit, be used for according to determine by described sine and cosine value that device determines just/data that cosine value is treated frequency offset compensation carry out frequency offset compensation.
This sine and cosine value determining unit comprises:
Sine value table memory module is used for storage package and contains
Figure C200610104055D00101
The sine value table of the fixed point sine value in the scope, wherein the size of this table is
Figure C200610104055D00102
The normalized module is used for the input angle φ according to the fixed point of being exported by the independent variable converter unit z, calculate &phi; &prime; = &phi; 2 &pi; Pairing fixed point value φ ' z, and according to φ ' z, to described &phi; &prime; = &phi; 2 &pi; With scaled values (M ' 1, M ' 2) calibration again, obtain new fixed point value φ " z, described φ zFor φ is (M according to calibration 1, M 2) fixed point after value, and φ ∈ [0,2 π);
M ' wherein 2=N 2+ 2, M ' 1=(M 1+ M 2)-M ' 2=(M 1+ M 2)-(N 2+ 2);
The numerical digit acquisition module is used to obtain φ " zThe fraction part most significant bit
Figure C200610104055D00113
With fractional part gradation high order bit
Figure C200610104055D00114
Sine and cosine value determination module is used for according to described new fixed point value φ " z, the fraction part most significant bit
Figure C200610104055D00115
With fractional part gradation high order bit
Figure C200610104055D00116
Look into described sine value table to determine the fixed point sine and cosine value of described fixed point input angle, wherein:
( sin ( &phi; ) ) FIX = ( 1 - 2 c 1 ) &CenterDot; Tab 2 sin z [ ( 1 - 2 c 0 ) &CenterDot; &phi; &prime; &prime; z + ( 2 c 0 - 1 ) &CenterDot; ( c 1 + c 0 ) &CenterDot; 2 &CenterDot; 2 N 2 ] ;
( cos ( &phi; ) ) FIX = ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; Tab 2 sin z [ ( 2 c 0 - 1 ) &CenterDot; &phi; &prime; &prime; z + ( 1 - 2 c 0 ) &CenterDot; ( 1 + 2 c 1 ) &CenterDot; 2 N 2 ] ;
Wherein c 1 = b M &prime; 2 ; c 0 = b M &prime; 2 - 1 , (sin (φ)) FIXBe the fixed point value of sin (φ), (cos (φ)) FIXBe the fixed point value of cos (φ), XOR (c 1, c 0) be to c 1And c 0Do XOR, Tab 2 sin ( i ) = sin ( 0 + i &CenterDot; &pi; / 2 2 N 2 ) , Wherein i = 0,1 , . . . , 2 N 2 - 1 .
This sine and cosine value determining unit comprises:
Sine value table memory module is used for storage package and contains
Figure C200610104055D001113
The sine value table of the fixed point sine value in the scope, wherein the size of this table is
Figure C200610104055D001114
The normalized module is used for the input angle φ according to the fixed point of being exported by the independent variable converter unit z, calculate &phi; &prime; = &phi; 2 &pi; Pairing fixed point value φ ' z, and according to φ ' z, to described &phi; &prime; = &phi; 2 &pi; With scaled values (M ' 1, M ' 2) calibration again, obtain new fixed point value φ " z, described φ zFor φ is (M according to calibration 1, M 2) fixed point after value, and φ ∈ [π, π);
M ' wherein 2=N 2+ 2, M ' 1=(M 1+ M 2)-M ' 2=(M 1+ M 2)-(N 2+ 2);
The numerical digit acquisition module is used to obtain φ " zThe fraction part most significant bit
Figure C200610104055D001117
With fractional part gradation high order bit
Figure C200610104055D00121
Sine and cosine value determination module is used for according to described new fixed point value φ " z, the fraction part most significant bit
Figure C200610104055D00122
With fractional part gradation high order bit
Figure C200610104055D00123
Look into described sine value table to determine the fixed point sine and cosine value of described fixed point input angle, wherein:
( sin ( &phi; ) ) FIX = ( 1 - 2 c 1 ) &CenterDot; Tab 2 sin z [ ( 1 - 2 c 0 ) &CenterDot; &phi; &prime; &prime; z + XOR ( c 1 + c 0 ) &CenterDot; 2 &CenterDot; 2 N 2 ] ;
( cos ( &phi; ) ) FIX = ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; Tab 2 sin z [ ( 2 c 0 - 1 ) &CenterDot; &phi; &prime; &prime; z + ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; 2 N 2 ] ;
Wherein
Figure C200610104055D00126
Figure C200610104055D00127
(sin (φ)) FIXBe the fixed point value of sin (φ), (cos (φ)) FIXBe the fixed point value of cos (φ), XOR (c 1, c 0) be to c 1And c 0Do XOR, Tab 2 sin ( i ) = sin ( 0 + i &CenterDot; &pi; / 2 2 N 2 ) , Wherein i = 0,1 , . . . , 2 N 2 - 1 .
Described communication system is orthogonal frequency division multiplex OFDM system or carrier wave communication system.
From technique scheme as can be seen, the present invention proposes a kind of periodic function independent variable converting means, this device comprises: the normalized unit, be used for the fixed point independent variable of input being carried out normalized, to obtain the fixed point independent variable after the normalized according to cycle of periodic function; The independent variable converter unit, be used for integral part with the fixed point independent variable after the described normalized, be set to the integral part of fixed point independent variable in the designated period scope after the described normalized, and the fraction part of the fixed point independent variable after the described normalized is remained unchanged.This shows, use after the present invention, do not need to carry out the fixed point division, also do not need to carry out branch and judge, only need do the simple integer part operation, therefore greatly reduced demand, thereby reduced cost computational resource and storage resources.
In addition, the invention allows for a kind of transform method of periodic function independent variable, use method proposed by the invention after, owing to do not need to carry out the fixed point division, do not need to carry out branch yet and judge, therefore be very beneficial for code optimization, and greatly improved system and carried out efficient.
Description of drawings
Fig. 1 is the demonstrative structure synoptic diagram according to periodic function independent variable converting means of the present invention.
Fig. 2 is the exemplary flow synoptic diagram according to periodic function independent variable transform method of the present invention.
Fig. 3 is the basic composition system architecture synoptic diagram of communication system.
Fig. 4 is the structural representation according to the communication system medium frequency skew estimation unit of the embodiment of the invention.
Fig. 5 is the structural representation according to transmitting terminal in the communication system of the embodiment of the invention.
Fig. 6 is the structural representation according to receiving end in the communication system of the embodiment of the invention.
Embodiment
For making the purpose, technical solutions and advantages of the present invention express clearlyer, the present invention is further described in more detail below in conjunction with drawings and the specific embodiments.
Main thought of the present invention is: proposes a kind of periodic function input parameter (being the periodic function independent variable) to be transformed to transform method in the designated period scope, need not carry out branch and judge, but can be by unified disposal route realization conversion.Wherein, input parameter carried out specific processing after, the number on the specific digits is operated, the entire process process all is unified, does not need according to the input parameter discussion of classifying in which periodic regime.In addition, normalized input parameter directly can be delivered to next module, not necessarily need normalized value is transformed into original value and then sends into next module.And, the input parameter of periodic function can be transformed to any period scope, do not need to transform in some special designated period scope.
The Cycle Length that can make periodic function is M, generally the input independent variable need be transformed in the periodic regime of functional value computing unit appointment, independent variable is sent into the functional value computing unit again and is calculated.If the periodic regime of functional value computing unit appointment be [s, s+M).S has two class values generally speaking, i.e. s=Mn or s=Mn-M/2, and wherein n is an arbitrary integer.
For the fixed point argument value φ in any range z, it need be transformed to designated period [s, s+M) in, its conversion is described as follows:
At first:, to φ zCarry out normalized, calculate &phi; &prime; = &phi; &CenterDot; 1 M Pairing fixed point value φ ' z
Then, establish φ ' zInteger-bit from a high position to the low level, be followed successively by
Figure C200610104055D00132
Decimal place is followed successively by from a high position to the low level b M 2 , b M 2 - 1 , . . . , b 1 ;
Through observation shows that and be in the different cycles (for example: [s-M, s), [s, s+M), [s+M, s+2M)), the independent variable φ ' of corresponding same functional value zFraction part be all to be identical, only integral part is different.
φ ' zIn that [s, s+M) corresponding storage unit can be calculated and be stored in to the integral part in this periodic regime in advance, establishes φ ' here zIn that [s, s+M) integral part in this periodic regime is
Figure C200610104055D00141
So only need with Value be changed to
Figure C200610104055D00143
Just can be with φ ' z[s gets final product in s+M) to transform to designated period.
Fig. 1 is the demonstrative structure synoptic diagram according to periodic function independent variable converting means of the present invention.As shown in Figure 1, this device 100 comprises:
Normalized unit 101 is used for according to cycle of periodic function the fixed point independent variable of input being carried out normalized, to obtain the fixed point independent variable after the normalized;
Integer-bit storage unit 102 in the designated period scope is used to store the integral part of fixed point independent variable in the designated period scope after the described normalized;
Independent variable converter unit 103, be used for integral part with the fixed point independent variable after the described normalized, be set to this integral part of being stored, and the fraction part of the fixed point independent variable after the described normalized is remained unchanged by integer-bit storage unit 102 in the designated period scope.
When the cycle that needs conversion is some specific cycles, can carries out simple set or other logical operation, and can omit integer-bit storage unit 102 in the designated period scope, thereby further save system resource.Such as, under the situation that is applied to trigonometric function, and the cycle that need transform to be [0,2 π) time, need the integral part of conversion very simple this moment, all is 0, therefore can directly put 0, thereby can omit integer-bit storage unit 102 in the designated period scope.
When having done normalized again in the subsequent cycle function calculation unit, periodic function independent variable converting means 100 preferably includes contrary normalization unit, and the fixed point independent variable after the conversion that is used for the independent variable converter unit is exported carries out contrary normalized.
When not doing normalized in the subsequent cycle function calculation unit, periodic function independent variable converting means 100 just can not comprise contrary normalization unit.
Equally, the invention allows for a kind of periodic function independent variable transform method.Fig. 2 is the exemplary flow synoptic diagram according to periodic function independent variable transform method of the present invention.Comprise: preestablish the designated period scope that need transform to, as shown in Figure 2, this method also comprises:
Step 201: the fixed point independent variable of input is carried out normalized according to cycle of periodic function, to obtain the fixed point independent variable after the normalized;
Step 202: with the integral part of the fixed point independent variable after the described normalized, be set to the integral part of fixed point independent variable in the designated period scope after this normalized, and the fraction part of the fixed point independent variable after the described normalized is remained unchanged.
After step 202, this method is preferably also carried out contrary normalized to the fixed point independent variable after the conversion.
Equally, contrary normalized can not need yet, and this depends on the design of the periodic function computing unit of back.When having done normalized again in the periodic function computing unit, just must use contrary normalized here; And when not doing normalized in the periodic function computing unit, just do not need contrary normalized here.
Preferably, periodic function is a trigonometric function, and can be periodic function arbitrarily such as sine function, cosine function, tan, cotangent function, arcsin function, inverse cosine function, arctan function or arc cotangent function.More preferably, the designated period scope be [0,2 π) or [π, π).
Be that example is carried out more detailed exemplary illustrated to the present invention below with the trigonometric function, but it will be appreciated by those of skill in the art that the present invention is not limited only to trigonometric function, but can use periodic function arbitrarily.
In trigonometric function,, require the span of the designated period of conversion that two kinds of situation: φ are generally arranged for the input angle T∈ [π, π) and φ T∈ [0,2 π).Under two kinds of situations similar derivation is arranged, here earlier to φ ∈ [0,2 π) situation describe.
For φ T∈ [0,2 π) situation:
The problem that need to solve is for angle φ arbitrarily, and it is transformed to φ T, satisfy φ=2 π n+ φ T, φ T∈ [0,2 π), n is an integer.
Suppose that φ is (M in scaled values 1, M 2) fixed point value under the situation is φ z, the fixed point value of 2 π under identical scaled values is M 2 π, φ TFixed point value under identical scaled values is φ Tz, the problem that then needs to solve in the fixed point system is, for angle φ arbitrarily z, it is transformed to φ Tz, satisfy φ z=M 2 πN+ φ Tz, φ Tz∈ [0, M 2 π), n is an integer.
Then with φ zTransform to φ TzCorresponding treatment step is as follows:
The first step: according to input value φ z, calculate &phi; &prime; = &phi; &CenterDot; 1 2 &pi; Pairing fixed point value φ ' z
(then problem changes into for arbitrarily angled φ ' z, it is transformed to φ ' Tz, satisfy &phi; &prime; z = n &times; 2 M 2 + &phi; &prime; Tz , &phi; &prime; Tz &Element; [ 0 , 2 M 2 - 1 ] , Wherein n is an integer.)
&phi; &prime; z = n &times; 2 M 2 + &phi; &prime; Tz , &phi; &prime; Tz &Element; [ 0 , 2 M 2 - 1 ] - - - ( 4 )
Second step: establish φ ' zInteger-bit from a high position to the low level, be followed successively by
Figure C200610104055D00166
Decimal place is followed successively by from a high position to the low level b M 2 , b M 2 - 1 , . . . , b 1 .
Observe φ ' in the different cycles scope by form zThe characteristics of integer-bit and decimal place
Table 2 transforms to φ for different cycles scope angle φ T∈ [0,2 π) the situation comparison sheet
Figure C200610104055D00171
Table 2
Can see from top table 2, when φ [0,2 π) outside the scope time, the φ that φ is corresponding with it TFixed point value φ ' after the normalization of value zWith φ ' TzDifference be the integer-bit difference, and decimal place is identical.
Form above observing can find to ask φ ' zCorresponding φ ' TzValue is exactly with φ ' zInteger-bit
Figure C200610104055D00172
All zero clearings promptly obtain its corresponding φ ' Tz, make a i=0, i=1,2 ..., M 1, just can obtain φ ' Tz:
&phi; &prime; z &RightArrow; a i = 0 &phi; &prime; Tz - - - ( 5 )
The 3rd step: according to value φ ' Tz, calculate φ T=φ ' TThe fixed point value φ of 2 π correspondences Tz
What deserves to be explained is:
1, for the first step: be not to do &phi; &prime; = &phi; &CenterDot; 1 2 &pi; , Can carry out &phi; &prime; = &phi; &CenterDot; 1 2 &pi; &CenterDot; 2 z , Here z is an arbitrary integer.Can make φ ' like this TzAnd φ ' BzNot the relation that equates, but differ the relation of 2 integral number power, when doing for second step, need be according to the value of z, determining need to which binary number position 0.
2, for the 3rd step: in the fixed point system, a lot of ensuing modules of situation are utilized often to table look-up and are calculated corresponding functional value, not necessarily need φ TzValue can directly be utilized φ ' TzValue is tabled look-up, and can save multiplication operation like this.
For: φ T∈ [π, situation π):
The problem that then needs to solve is for angle φ arbitrarily, and it is transformed to φ T, satisfy φ=2 π n+ φ T, φ T[π, π), n is an integer to ∈.
Suppose that φ is (M in scaled values 1, M 2) fixed point value under the situation is φ z, the fixed point value of 2 π under identical scaled values is M 2 π, φ TFixed point value under identical scaled values is φ Tz, the problem that then needs to solve in the fixed point system is, for angle φ arbitrarily z, it is transformed to φ Tz, satisfy φ z=M 2 πN+ φ Tz, &phi; Tz &Element; [ - M 2 &pi; 2 , M 2 &pi; 2 ) , N is an integer.
Situation is equivalent to φ in this T∈ [0,2 π) situation slightly complexity a bit observe its characteristics (φ here, φ ' by a form z, φ ' TzWith φ T∈ [0,2 π) situation under be identical):
Table 3 transforms to φ for different cycles scope angle φ T∈ [π, situation comparison sheet π)
Figure C200610104055D00184
Figure C200610104055D00191
Table 3
Can see from top form, when φ [π, in the time of π) outside the scope, the φ that φ is corresponding with it TFixed point value φ ' after the normalization of value zWith φ ' TzDifference be the integer-bit difference, and decimal place is identical.
Form above observing can find to ask φ ' zCorresponding φ ' TzValue makes φ ' exactly zInteger-bit
Figure C200610104055D00201
All equal the decimal place most significant digit
Figure C200610104055D00202
Value, promptly obtain its corresponding φ ' Tz
Then with φ T∈ [π, π) under the situation, φ zTransform to φ TzBut following steps are handled:
The first step: according to input value φ z, calculate &phi; &prime; = &phi; &CenterDot; 1 2 &pi; Pairing fixed point value φ ' z
Second step: establish φ ' zInteger-bit from a high position to the low level, be followed successively by
Figure C200610104055D00204
Decimal place is followed successively by from a high position to the low level
Figure C200610104055D00205
Get the decimal place most significant bit
Figure C200610104055D00206
Make all bits of integer-bit equal
Figure C200610104055D00207
Just can obtain φ Tz:
a i = b M 2 , i = 1,2 . . . , M 1 - - - ( 6 )
&phi; &prime; z &RightArrow; a i = b M 2 &phi; &prime; Tz
(2.2.4)
The 3rd step: according to value φ ' Tz, calculate φ T=φ ' TThe fixed point value φ of 2 π correspondences Tz
With φ T∈ [0,2 π) situation similar, what deserves to be explained is:
1, for the first step: be not to do &phi; &prime; = &phi; &CenterDot; 1 2 &pi; , Can carry out &phi; &prime; = &phi; &CenterDot; 1 2 &pi; &CenterDot; 2 z , Here z is an arbitrary integer.Can make φ ' like this TzAnd φ ' BzNot the relation that equates, but differ the relation of 2 integral number power, when doing for second step, need be according to the value of z, determining need to which binary number position 0.
2, for the 3rd step: in the fixed point system, a lot of ensuing modules of situation are utilized often to table look-up and are calculated corresponding functional value, not necessarily need φ TzValue can directly be utilized φ ' TzValue is tabled look-up, and can save multiplication operation like this.
According to the present invention the trigonometric function independent variable is transformed to after the periodic regime of appointment, can then determine trigonometric function value.Trigonometric function is typical periodic function, and sinusoidal and cosine is again typical triangle periodic function.Herein, for convenience of explanation, with sinusoidal and cosine be example the present invention is described in detail, obvious, for trigonometric functions such as tangent, cotangents, valued methods of the present invention is suitable equally.
At first the method for determining sinusoidal and cosine value according to the present invention is described.
For sinusoidal and cosine, the cycle is 2 π.Span to the one-period of input angle φ generally has two kinds of situations: φ ∈ [π, π) and φ ∈ [0,2 π).Under two kinds of situations similar derivation is arranged, here earlier to φ ∈ [0,2 π) situation describe.
(1) for φ ∈ [0,2 π) situation:
Calculate at first, in advance &phi; &Element; [ 0 , &pi; 2 ) Sine value in the scope is set up the fixed point sine table, can be identical such as this process with second kind of prior art two, to this detailed description:
Make N 2Be a positive integer, then can calculate sine table { Tab2 Sin(i) }
Tab 2 sin ( i ) = sin ( 0 + i &CenterDot; &pi; / 2 2 N 2 ) , i = 0,1 , . . . , 2 N 2 - 1 - - - ( 7 )
To obtain floating point values in the formula (7), carry out fixed point with suitable scaled values after, just obtained size and be The fixed point sine table
Figure C200610104055D00214
This table can be represented
Figure C200610104055D00215
Sine value in the scope.
Work as N 2During=N-2, sine table has identical degree of accuracy in the sine table that is obtained by formula (10) and the first kind of prior art, and required storage resources has only 1/4 of sine table in first kind of prior art.
Then, according to existing sine table, determine corresponding sine value and cosine value look-up method.
At first, the fixed point angle of order input is φ z, it is that φ is (M according to calibration 1, M 2) fixed point after value, only consider here φ ∈ [0,2 π) situation, if φ not in this scope, need transform to it in this periodic regime according to the periodicity of sine function and cosine function.In the derivation of back, as not doing Special Statement, scaled values remains unchanged in the fixed point calculating process.
Looking into the process of sine value and cosine value can carry out according to following steps according to sine table:
The 1st step: according to input value φ z, calculate &phi; &prime; = &phi; 2 &pi; Pairing fixed point value φ ' z
The 2nd step: make M ' 2=N 2+ 2, M ' 1=(M 1+ M 2)-M ' 2=(M 1+ M 2)-(N 2+ 2), according to φ ' z, right &phi; &prime; = &phi; 2 &pi; With scaled values (M ' 1, M ' 2) calibration again, obtain new fixed point value φ " z:
&phi; &prime; &prime; z = &phi; &prime; z &CenterDot; 2 - ( M 2 - M &prime; 2 ) - - - ( 8 )
The 3rd step: establish φ " zDecimal place from a high position to the low level, be followed successively by
Figure C200610104055D00219
Take out most significant digit wherein
Figure C200610104055D002110
And next most significant bit
Figure C200610104055D002111
In order to express easily, order
c 1 = b M &prime; 2 - - - ( 9 )
c 0 = b M &prime; 2 - 1 - - - ( 10 )
The 4th step: according to φ " z, c 1, c 0Calculate its pairing sine value and cosine value, as follows:
Table 4 be φ ∈ [0,2 π) computing formula and and the c of sine value in the different quadrants of situation 1, c 0Mapping table.
Figure C200610104055D00223
Table 4
Table 5 be φ ∈ [0,2 π) computing formula and and the c of cosine value in the different quadrants of situation 1, c 0Mapping table.
Figure C200610104055D00224
Figure C200610104055D00231
Table 5
Can obtain asking the unified formula of sine value and cosine value according to top form:
( sin ( &phi; ) ) FIX = ( 1 - 2 c 1 ) &CenterDot; Tab 2 sin z [ ( 1 - 2 c 0 ) &CenterDot; &phi; &prime; &prime; z + ( 2 c 0 - 1 ) &CenterDot; ( c 1 + c 0 ) &CenterDot; 2 &CenterDot; 2 N 2 ] - - - ( 11 )
( cos ( &phi; ) ) FIX = ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; Tab 2 sin z [ ( 2 c 0 - 1 ) &CenterDot; &phi; &prime; &prime; z + ( 1 - 2 c 0 ) &CenterDot; ( 1 + 2 c 1 ) &CenterDot; 2 N 2 ] - - - ( 12 )
XOR (c wherein 1, c 0) represent c 1, c 0Do XOR.
Wherein (sin (φ)) FIXThe fixed point value of expression sin (φ), (cos (φ)) FIXThe fixed point value of expression cos (φ), its calibration parameter is not necessarily identical with φ.
According to above-mentioned formula (11) and (12), can determine fixed point angle φ by tabling look-up zCorresponding fixed point sine value (sin (φ)) FIXWith fixed point cosine value (cos (φ)) FIX
Below just realized for φ ∈ [0,2 π) situation under fixed point sine value and the determining of fixed point cosine value.
(2) for φ ∈ [π, situation π):
At first be to calculate in advance &phi; &Element; [ 0 , &pi; 2 ) Sine value in the scope is set up sine table, its build table process and front φ ∈ [0,2 π) situation identical; Be specially:
Make N 2Be a positive integer, then can calculate sine table { Tab2 Sin(i) }
Tab 2 sin ( i ) = sin ( 0 + i &CenterDot; &pi; / 2 2 N 2 ) , i = 0,1 , . . . , 2 N 2 - 1
To obtain floating point values in the above-mentioned formula, carry out fixed point with suitable scaled values after, just obtained size and be
Figure C200610104055D00237
The fixed point sine table
Figure C200610104055D00238
This table can be represented
Figure C200610104055D00239
Sine value in the scope.
Work as N 2During=N-2, sine table has identical degree of accuracy in the sine table that is obtained by above-mentioned formula and the first kind of prior art, and required storage resources has only 1/4 of sine table in the prior art.
Be according to existing sine table then, determine corresponding sine value and cosine value look-up method.
The fixed point angle of order input is φ z, it is that φ is (M according to calibration 1, M 2) fixed point after value, [π, situation π) is if φ not in this scope, need transform to it in this periodic regime according to the periodicity of sine function and cosine function only to consider φ ∈ here.
In the derivation of back, as not doing Special Statement, scaled values remains unchanged in the fixed point calculating process.Looking into the process of sine value and cosine value can carry out according to following steps according to sine table:
The 1st step: according to input value φ z, calculate &phi; &prime; = &phi; 2 &pi; Pairing fixed point value φ ' z
The 2nd step: make M ' 2=N 2+ 2, M ' 1=(M 1+ M 2)-M ' 2=(M 1+ M 2)-(N 2+ 2), according to φ ' z, right &phi; &prime; = &phi; 2 &pi; With scaled values (M ' 1, M ' 2) calibration again, obtain new fixed point value φ " z:
&phi; &prime; &prime; z = &phi; &prime; z &CenterDot; 2 - ( M 2 - M &prime; 2 ) - - - ( 13 )
The 3rd step: establish φ " zDecimal place from a high position to the low level, be followed successively by Take out most significant digit wherein
Figure C200610104055D00245
And next most significant bit
Figure C200610104055D00246
In order to express easily, order
c 1 = b M &prime; 2 - - - ( 14 )
c 0 = b M &prime; 2 - 1 - - - ( 15 )
The 4th step: according to φ " z, c 1, c 0Calculate its pairing sine value and cosine value, as follows:
Table 6 is φ ∈ [π, π) computing formula and and the c of sine value in the different quadrants of situation 1, c 0Mapping table.
Table 6
Table 7 is φ ∈ [π, π) computing formula and and the c of cosine value in the different quadrants of situation 1, c 0Mapping table.
Table 7
Can obtain asking the unified formula of sine value and cosine value according to top form:
( sin ( &phi; ) ) FIX = ( 1 - 2 c 1 ) &CenterDot; Tab 2 sin z [ ( 1 - 2 c 0 ) &CenterDot; &phi; &prime; &prime; z + XOR ( c 1 + c 0 ) &CenterDot; 2 &CenterDot; 2 N 2 ] - - - ( 16 )
( cos ( &phi; ) ) FIX = ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; Tab 2 sin z [ ( 2 c 0 - 1 ) &CenterDot; &phi; &prime; &prime; z + ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; 2 N 2 ] - - - ( 17 )
XOR (c wherein 1, c 0) represent c 1, c 0Do XOR.
Wherein (sin (φ)) FIXThe fixed point value of expression sin (φ), (cos (φ)) FIXThe fixed point value of expression cos (φ), its calibration parameter is not necessarily identical with φ.
According to above-mentioned formula (16) and (17), can determine fixed point angle φ by tabling look-up zCorresponding fixed point sine value (sin (φ)) FIXWith fixed point cosine value (cos (φ)) FIX
[π, the determining of fixed point sine value under situation π) and fixed point cosine value have below just been realized for φ ∈.
Equally, for φ value in any range that the fixed point number can be represented, the present invention is suitable equally.When can not determine the span of input angle φ,, still can carry out the calculating of sine value and cosine value according to the method for front through after certain processing.
At first be to calculate in advance &phi; &Element; [ 0 , &pi; 2 ) Sine value in the scope is set up sine table.Its build table process and front φ ∈ [0,2 π) and φ ∈ [π, situation π) is identical, is specially:
Make N 2Be a positive integer, then can calculate sine table { Tab2 Sin(i) }
Tab 2 sin ( i ) = sin ( 0 + i &CenterDot; &pi; / 2 2 N 2 ) , i = 0,1 , . . . , 2 N 2 - 1
To obtain floating point values in the above-mentioned formula, carry out fixed point with suitable scaled values after, just obtained size and be The fixed point sine table
Figure C200610104055D00265
This table can be represented
Figure C200610104055D00266
Sine value in the scope.
Work as N 2During=N-2, sine table has identical degree of accuracy in the sine table that obtains and the prior art, and required storage resources has only 1/4 of sine table in the prior art.
Then, according to existing sine table, determine corresponding sine value and cosine value look-up method.Process is to input angle φ zAfter certain processing, can change be grouped into front φ ∈ [0,2 π) situation.
The 1st step: according to input value φ z, calculate &phi; &prime; = &phi; 2 &pi; Pairing fixed point value φ ' z
The 2nd step: make M ' 2=N 2+ 2, M ' 1=(M 1+ M 2)-M ' 2=(M 1+ M 2)-(N 2+ 2), according to φ " z, right &phi; &prime; = &phi; 2 &pi; With scaled values (M ' 1, M ' 2) calibration again, obtain new fixed point value φ " z:
&phi; &prime; &prime; z = &phi; &prime; z &CenterDot; 2 - ( M 2 - M &prime; 2 ) - - - ( 18 )
The 3rd step: establish φ " zInteger-bit from a high position to the low level, be followed successively by
Figure C200610104055D002610
Will
Figure C200610104055D002611
All be set to 0, even:
a i=0,i=1,2,...M′ 1 (19)
If with φ " zThe value that integer-bit all is set to after 0 is φ ' ' ' z, by the φ ' ' ' as can be known that derives zPairing angle value [0,2 π) in the scope, and differ the integral multiple of 2 π with the angle φ of initial input, so sine value and the cosine value of its corresponding sine value and cosine value and φ are identical.
The 4th the step: with φ ∈ [0,2 π) time, the 3rd the step identical;
The 5th the step: with φ ∈ [0,2 π) time, the 4th the step identical;
Like this, just obtained fixed point angle φ by this step zCorresponding fixed point sine value (sin (φ)) FIXWith fixed point cosine value (cos (φ)) FIXIts calibration parameter is not necessarily identical with φ.
Below just realized for φ in any range that the fixed point number can be represented under the value condition the determining of fixed point sine value and fixed point cosine value.
Simultaneously, for φ ∈ [π, situation π) also can be by the method for top φ situation of value in any range that the fixed point number can be represented, convert to φ ∈ [0,2 π) situation carry out computing.In the 1st step of tabling look-up in all cases, φ has been done processing divided by 2 π &phi; &prime; = &phi; 2 &pi; . Here not necessarily to can have divided by 2 π &phi; &prime; = &phi; 2 &pi; &CenterDot; 2 p , Wherein p can be arbitrary integer, and the scaled values that calibrate again the while back need be adjusted according to the value of p.Here the value of p is limited in the restriction of fixed point integer bit wide and decimal bit wide, gets when fully big when integer bit wide and decimal bit wide, the value of p can be thought hard-core.
Though more than to determine sinusoidal and cosine value is that example is illustrated, it will be appreciated by those of skill in the art that such exemplary illustrated and be not used in qualification the present invention, but can be applied to arbitrarily on the periodic circular function.
More than described the exemplary algorithm of definite sine value of the present invention and cosine value, but the present invention is not limited to calculate sine value and cosine value.On the contrary, but be applicable to trigonometric function arbitrarily.
Based on above-mentioned analysis, the invention allows for a kind of sine and cosine value and determine device, comprising:
The normalized unit, be used for according to the integral multiple of π to input just/cosine function fixed point independent variable carries out normalized, with obtain after the normalized fixed point just/the cosine function independent variable;
Integer-bit storage unit in the designated period scope, be used to store after the described normalized fixed point just/integral part of cosine function independent variable in the designated period scope;
The independent variable converter unit, be used for the fixed point after the described normalized just/integral part of cosine function independent variable, be set to this integral part of being stored by integer-bit storage unit in the designated period scope, and with the fixed point after the described normalized just/fraction part of cosine function independent variable remains unchanged;
Sine and cosine value determining unit, determine the fixed point exported by described independent variable converter unit just/the cosine function independent variable just/cosine value.
Preferably, above-mentioned sine and cosine value determining unit comprises:
Sine value table memory module is used for storage package and contains
Figure C200610104055D00281
The sine value table of the fixed point sine value in the scope, wherein the size of this table is
Figure C200610104055D00282
The normalized module is used for the input angle φ according to fixed point z, calculate &phi; &prime; = &phi; 2 &pi; Pairing fixed point value φ ' z, and according to φ ' z, to described &phi; &prime; = &phi; 2 &pi; With scaled values (M ' 1, M ' 2) calibration again, obtain new fixed point value φ " z, described φ zFor φ is (M according to calibration 1, M 2) fixed point after value, and φ ∈ [0,2 π);
M ' wherein 2=N 2+ 2, M ' 1=(M 1+ M 2)-M ' 2=(M 1+ M 2)-(N 2+ 2);
The numerical digit acquisition module is used to obtain φ " zMost significant bit With inferior high order bit
Sine and cosine value determination module is used for according to described new fixed point value φ " z, most significant bit
Figure C200610104055D00287
With inferior high order bit
Figure C200610104055D00288
Look into described sine value table to determine the fixed point sine and cosine value of described fixed point input angle, wherein:
( sin ( &phi; ) ) FIX = ( 1 - 2 c 1 ) &CenterDot; Tab 2 sin z [ ( 1 - 2 c 0 ) &CenterDot; &phi; &prime; &prime; z + ( 2 c 0 - 1 ) &CenterDot; ( c 1 + c 0 ) &CenterDot; 2 &CenterDot; 2 N 2 ] ;
( cos ( &phi; ) ) FIX = ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; Tab 2 sin z [ ( 2 c 0 - 1 ) &CenterDot; &phi; &prime; &prime; z + ( 1 - 2 c 0 ) &CenterDot; ( 1 + 2 c 1 ) &CenterDot; 2 N 2 ] ;
Wherein c 1 = b M &prime; 2 ; c 0 = b M &prime; 2 - 1 , (sin (φ)) FIXBe the fixed point value of sin (φ), (cos (φ)) FIXBe the fixed point value of cos (φ), XOR (c 1, c 0) be to c 1And c 0Do XOR, Tab 2 sin ( i ) = sin ( 0 + i &CenterDot; &pi; / 2 2 N 2 ) , Wherein i = 0,1 , . . . , 2 N 2 - 1 .
Alternatively, when φ ∈ [π, in the time of π), sine and cosine value determining unit can also comprise:
Sine value table memory module is used for storage package and contains
Figure C200610104055D002815
The sine value table of the fixed point sine value in the scope, wherein the size of this table is
Figure C200610104055D002816
The normalized module is used for the input angle φ according to fixed point z, calculate &phi; &prime; = &phi; 2 &pi; Pairing fixed point value φ ' z, and according to φ ' z, to described &phi; &prime; = &phi; 2 &pi; With scaled values (M ' 1, M ' 2) calibration again, obtain new fixed point value φ " z, described φ zFor φ according to the calibration for (M1, the value after fixed point M2), and φ ∈ [π, π); M ' wherein 2=N 2+ 2, M ' 1=(M 1+ M 2)-M ' 2=(M 1+ M 2)-(N 2+ 2); The numerical digit acquisition module is used to obtain φ " zThe fraction part most significant bit With fractional part gradation high order bit
Figure C200610104055D00293
Sine and cosine value determination module is used for according to described new fixed point value φ " z, the fraction part most significant bit
Figure C200610104055D00294
With fractional part gradation high order bit
Figure C200610104055D00295
Look into described sine value table to determine the fixed point sine and cosine value of described fixed point input angle, wherein:
( sin ( &phi; ) ) FIX = ( 1 - 2 c 1 ) &CenterDot; Tab 2 sin z [ ( 1 - 2 c 0 ) &CenterDot; &phi; &prime; &prime; z + XOR ( c 1 + c 0 ) &CenterDot; 2 &CenterDot; 2 N 2 ] ;
( cos ( &phi; ) ) FIX = ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; Tab 2 sin z [ ( 2 c 0 - 1 ) &CenterDot; &phi; &prime; &prime; z + ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; 2 N 2 ] ;
Wherein c 1 = b M &prime; 2 ; c 0 = b M &prime; 2 - 1 , (sin (φ)) FIXBe the fixed point value of sin (φ), (cos (φ)) FIXBe the fixed point value of cos (φ), XOR (c 1, c 0) be to c 1And c 0Do XOR, Tab 2 sin ( i ) = sin ( 0 + i &CenterDot; &pi; / 2 2 N 2 ) , Wherein i = 0,1 , . . . , 2 N 2 - 1 .
More than specifically describe trigonometric function value of the present invention and determined device and invention, wherein especially described definite method and apparatus of sine value and cosine value.
Below to needs use some specific implementations of determining trigonometric function value with and in communication system residing the specific descriptions.Obviously, the present invention is not limited to communication system.
In Modern Communication System, some other modules in modulator, Time and Frequency Synchronization module, channel equalization module and the practical communication system need be used a large amount of sines and cos operation usually.Not only in communication system, in a lot of other electronic systems, control system, also need to use in a large number sine and cos operation.Sinusoidal fast and effectively and cos operation not only can be accelerated response time, the raising system performance of these systems, and can also save system resource effectively, reduces system cost.
At present, the problem that general communication system need solve is: at transmitting terminal information is encoded, modulated, at receiving end the signal of process the channel distortions received is carried out the information that demodulation, decoding recover the transmission of making a start.
At transmitting terminal, at first information source is carried out information source coding, carry out chnnel coding then, the signal that the information translation after then will encoding by modulator becomes to be suitable for transmitting in channel.
At receiving end, need handle received signal through channel distortions, after Time and Frequency Synchronization, channel equalization, carry out channel decoding again, then carry out source decoding again, recover raw information at last.
This is the base conditioning flow process of Modern Communication System, and wherein modulator, Time and Frequency Synchronization, channel equalization and some other module in practical communication system usually need to use a large amount of sines and cos operation.Along with the bandwidth of Modern Communication System is more and more wideer, unit interval domestic demand data volume to be processed is increasing, and the rapidity of offset of sinusoidal and cos operation and validity have proposed very high requirement.
Fig. 3 is the structural representation according to the communication system medium frequency skew estimation unit of the embodiment of the invention.Fig. 4 is the basic composition system architecture synoptic diagram of Modern Communication System.The basic composition of Modern Communication System is formed by sending part and receiving unit.The calculating that wherein a lot of modules all need to use sine value and cosine value is such as at receiving unit.
The treatment scheme of receiver is in the communication system: carry out time synchronized at first to received signal, promptly judge whether the time reference position that signal arrives and signal arrives.Then the carrier frequency shift of signal is estimated, carrier frequency shift is compensated according to estimated value.Then carry out channel estimating, signal is carried out channel compensation (being also referred to as channel equalization) according to estimated value.Carry out channel decoding and source decoding again, obtain needed information at last.
Next go through the generation of carrier wave frequency deviation and to the compensation method of frequency deviation.
It is bigger generally to carry out signal transmission attenuation in base band, and the frequency spectrum resource of base band also is limited simultaneously, transmits so under most of situation baseband signal is modulated on the carrier wave.
Generally need the baseband signal of transmission to be divided into in-phase component I DataWith quadrature component Q Data, make that carrier frequency is f c, the signal that then is modulated on this carrier wave is:
S f c = I data &CenterDot; cos ( 2 &pi; &CenterDot; f c &CenterDot; t ) - Q data &CenterDot; sin ( 2 &pi; &CenterDot; f c &CenterDot; t ) - - - ( 20 )
Formula not necessarily will use minus sign in (20), also can use plus sige, but convenient for the description of back, uses minus sign here.In order to express easily, utilize plural number to represent the in-phase component and the quadrature component of baseband signal simultaneously:
S Base=I data+j·Q data (21)
Then be modulated to carrier wave f cOn signal can be expressed as:
S f c = Re { S Base &CenterDot; e j &CenterDot; 2 &pi; &CenterDot; f c &CenterDot; t } - - - ( 22 )
Here Re{x} represents plural x is got real part.Simple generally speaking note is done:
S &prime; f c = S Base &CenterDot; e j &CenterDot; 2 &pi; &CenterDot; f c &CenterDot; t - - - ( 23 )
At receiving end, need remap on the base band to being modulated to signal on the carrier wave, so that further receive processing:
I data = LPF { S f c &CenterDot; cos ( 2 &pi; &CenterDot; f c &CenterDot; t ) } - - - ( 24 )
Q data = LPF { S f c &CenterDot; sin ( 2 &pi; &CenterDot; f c &CenterDot; t ) } - - - ( 25 )
Wherein LPE{x} represents signal x is carried out low-pass filtering, and equally also available complex operation is represented this process:
S Base = S &prime; f c &CenterDot; e - j &CenterDot; 2 &pi; &CenterDot; f c &CenterDot; t - - - ( 26 )
Here the carrier wave of the carrier wave of transmitting terminal and receiving end is to be produced by separately crystal oscillator respectively.And the crystal oscillator at two ends can't produce the identical carrier wave of frequency often, and has certain deviation:
f c,sned=f c,rece+Δf (27)
Obtain receiving baseband signal according to formula 26 like this and will have certain frequency offset error:
S Base , rece = S &prime; f c &CenterDot; e - j &CenterDot; 2 &pi; &CenterDot; f c , rece - t = S Base &CenterDot; e j &CenterDot; 2 &pi; &CenterDot; &Delta; f c &CenterDot; t - - - ( 28 )
The effect of frequency deviation estimating modules is exactly to estimate this frequency deviation value Δ f c, the frequency deviation complementary module then is that this frequency offset error compensation is gone back, and obtains actual transmission signal:
S Base = S Base , rece &CenterDot; e - j &CenterDot; 2 &pi; &CenterDot; &Delta; f c &CenterDot; t - - - ( 29 )
So in the compensate of frequency deviation module, need to calculate in a large number cos (j2 π Δ f cT) and sin (j2 π Δ f cT) value so then can greatly accelerate the computing velocity of these values according to the method for calculating sine value proposed by the invention and cosine value, improves system effectiveness.
Fig. 3 is the structural representation according to the communication system medium frequency skew estimation unit of the embodiment of the invention.
As seen from Figure 3, this device comprises:
The Frequency offset estimation unit, the data that are used to treat frequency offset compensation are carried out Frequency offset estimation,
Compensation of phase calculates the unit, is used to calculate the phase place of needs compensation; Just calculate the phase place that t need compensate constantly;
Aforesaid angular transformation unit is used for input angle is transformed into the designated period scope;
Sine and cosine value determining unit, the angle that is used for determining to be transformed into the designated period scope according to the phase place of described needs compensation just/cosine value;
The frequency offset compensation unit, be used for according to described sine and cosine value determining unit determine just/data that cosine value is treated frequency offset compensation carry out Frequency offset estimation.
Wherein, the input parameter of sine and cosine value determining unit is the phase that t need compensate constantly t, output parameter be the sine value and the cosine value of this phase value correspondence.
In actual Project Realization (such as utilizing FPGA, DSP to realize), often directly do not use original phase value φ for the consideration that improves arithmetic speed, raising system effectiveness etc. t, it is carried out the later value φ of fixed point and be to use T, z
According to the different forms of setting up of sine table and cosine table, the arithmetic element of tabling look-up accordingly specific implementation is also slightly different, but its basic thought is consistent.
Also have a lot of modules also to need to use the calculating of sine value and cosine value.No matter be that transmitting terminal is modulated to baseband signal on the carrier wave, or receiving end will be modulated at the calculating that signal transformation on the carrier wave also all needs the sine value and the cosine value of usefulness on the base band.Fig. 5 is the structural representation according to transmitting terminal in the communication system of the embodiment of the invention.Fig. 6 is the structural representation according to receiving end in the communication system of the embodiment of the invention.
Fig. 6 mainly is for the signal transformation that will be modulated on the carrier wave process to base band is described, understands clearly for declarative procedure, does not consider the existence of carrier wave frequency deviation here, promptly supposes f C, sned=f C, rece=f cSo, can directly obtain I DataAnd Q DataWhen considering frequency deviation, also need to carry out compensate of frequency deviation, just can obtain I DataAnd Q Data
Equally, Frequency offset estimation device proposed by the invention had both gone for ofdm system, also can be applicable to the OFDMA system based on OFDM.More than with the ofdm system be example invention has been described, but it will be appreciated by those of skill in the art that the present invention is suitable equally for other multi-carrier communications systems.With OFDM is that example only describes to exemplary, and is not used in and limits the invention.The present invention can also be applicable to communication system arbitrarily such as carrier wave communication system.
Can see that from top description number of modules all needs to carry out the calculating of a large amount of sine values and cosine value in the communication system.So the quick calculation method of sine value and cosine value can greatly improve system effectiveness.
Simultaneously, this is not confined to use in the communication system, need carry out can both utilizing the present invention to improve system effectiveness in the system that triangle periodic function value calculates.
In sum, trigonometric function look-up method provided by the present invention, both used less storage resources, do not need to do branch's logic determines again to reduce demand to computational resource, and make that the computation process of whole sine value and cosine value is all lower to the requirement of system, thereby can improve the response speed that sine value and cosine value calculate, reduce system cost.And, use after the present invention, can also improve the efficient of Frequency offset estimation significantly.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (4)

1, the frequency deviation compensating device in a kind of communication system is characterized in that, this device comprises:
The Frequency offset estimation unit, the data that are used to treat frequency offset compensation are carried out Frequency offset estimation,
Compensation of phase calculates the unit, is used to calculate the phase place of needs compensation;
The sine and cosine value is determined device, be used for to just comprising/signal of cosine function handles, this sine and cosine value determines that device comprises integer-bit storage unit, independent variable converter unit and sine and cosine value determining unit in normalized unit, the designated period scope, wherein:
The normalized unit, be used for according to the integral multiple of π to input just/cosine function fixed point independent variable carries out normalized, with obtain after the normalized fixed point just/the cosine function independent variable;
Integer-bit storage unit in the designated period scope, be used to store after the described normalized fixed point just/integral part of cosine function independent variable in the designated period scope;
The independent variable converter unit, be used for the fixed point after the described normalized just/integral part of cosine function independent variable, be set to this integral part of being stored by integer-bit storage unit in the designated period scope, and with the fixed point after the described normalized just/fraction part of cosine function independent variable remains unchanged;
Sine and cosine value determining unit, determine the fixed point exported by described independent variable converter unit just/the cosine function independent variable just/cosine value;
The frequency offset compensation unit, be used for according to determine by described sine and cosine value that device determines just/data that cosine value is treated frequency offset compensation carry out frequency offset compensation.
2, the frequency deviation compensating device in the communication system according to claim 1 is characterized in that, this sine and cosine value determining unit comprises:
Sine value table memory module is used for storage package and contains
Figure C200610104055C00021
The sine value table of the fixed point sine value in the scope, wherein the size of this table is
Figure C200610104055C00022
The normalized module is used for the input angle φ according to the fixed point of being exported by the independent variable converter unit z, calculate &phi; &prime; = &phi; 2 &pi; Pairing fixed point value φ ' z, and according to φ ' z, to described &phi; &prime; = &phi; 2 &pi; With scaled values (M ' 1, M ' 2) calibration again, obtain new fixed point value φ " z, described φ zFor φ is (M according to calibration 1, M 2) fixed point after value, and φ ∈ [0,2 π);
Wherein M' 2=N 2+ 2, M ' 1=(M 1+ M 2)-M ' 2=(M 1+ M 2)-(N 2+ 2);
The numerical digit acquisition module is used to obtain the fraction part most significant bit of φ " z
Figure C200610104055C00031
With fractional part gradation high order bit b M &prime; 2 - 1 ;
Sine and cosine value determination module is used for according to described new fixed point value φ " z, the fraction part most significant bit
Figure C200610104055C00033
With fractional part gradation high order bit
Figure C200610104055C00034
Look into described sine value table to determine the fixed point sine and cosine value of described fixed point input angle, wherein:
( sin ( &phi; ) ) FIX = ( 1 - 2 c 1 ) &CenterDot; Tab sin 2 [ ( 1 - 2 c 0 ) &CenterDot; &phi; &prime; &prime; z + ( 2 c 0 - 1 ) &CenterDot; ( c 1 + c 0 ) &CenterDot; 2 &CenterDot; 2 N 2 ] ;
( cos ( &phi; ) ) FIX = ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; Tab sin z [ ( 2 c 0 - 1 ) &CenterDot; &phi; &prime; &prime; z + ( 1 - 2 c 0 ) &CenterDot; ( 1 + 2 c 1 ) &CenterDot; 2 N 2 ] ;
Wherein c 1 = b M &prime; 2 ; c 0 = b M &prime; 2 - 1 , (sin (φ)) FIXBe the fixed point value of sin (φ), (cos (φ)) FIXBe the fixed point value of cos (φ), XOR (c 1, c 0) be to c 1And c 0Do XOR, Tab 2 sin ( i ) = sin ( 0 + i &CenterDot; &pi; / 2 2 N 2 ) , Wherein i = 0,1 , . . . , 2 N 2 - 1 .
3, the frequency deviation compensating device in the communication system according to claim 1 is characterized in that, this sine and cosine value determining unit comprises:
Sine value table memory module is used for storage package and contains
Figure C200610104055C000311
The sine value table of the fixed point sine value in the scope, wherein the size of this table is
Figure C200610104055C000312
The normalized module is used for the input angle φ according to the fixed point of being exported by the independent variable converter unit z, calculate &phi; &prime; = &phi; 2 &pi; Pairing fixed point value φ ' z, and according to φ ' z, to described &phi; &prime; = &phi; 2 &pi; With scaled values (M ' 1, M ' 2) calibration again, obtain new fixed point value φ " z, described φ zFor φ is (M according to calibration 1, M 2) fixed point after value, and φ ∈ [π, π);
M ' wherein 2=N 2+ 2, M ' 1=(M 1+ M 2)-M ' 2=(M 1+ M 2)-(N 2+ 2);
The numerical digit acquisition module is used to obtain φ " zThe fraction part most significant bit
Figure C200610104055C000315
With fractional part gradation high order bit b M &prime; 2 - 1 ;
Sine and cosine value determination module is used for according to described new fixed point value φ " z, the fraction part most significant bit
Figure C200610104055C00041
With fractional part gradation high order bit
Figure C200610104055C00042
Look into described sine value table to determine the fixed point sine and cosine value of described fixed point input angle, wherein:
( sin ( &phi; ) ) FIX = ( 1 - 2 c 1 ) &CenterDot; Tab sin z [ ( 1 - 2 c 0 ) &CenterDot; &phi; &prime; &prime; z + ( 2 c 0 - 1 ) &CenterDot; ( c 1 , c 0 ) &CenterDot; 2 &CenterDot; 2 N 2 ] ;
( cos ( &phi; ) ) FIX = ( 1 - 2 &CenterDot; XOR ( c 1 , c 0 ) ) &CenterDot; Tab sin z [ ( 2 c 0 - 1 ) &CenterDot; &phi; &prime; &prime; z + ( 1 - 2 XOR ( c 1 , c 0 ) ) &CenterDot; 2 N 2 ] ;
Wherein c 1 = b M &prime; 2 ; c 0 = b M &prime; 2 - 1 , (sin (φ)) FIXBe the fixed point value of sin (φ), (cos (φ)) FIXBe the fixed point value of cos (φ), XOR (c 1, c 0) be to c 1And c 0Do XOR, Tab 2 sin ( i ) = sin ( 0 + i &CenterDot; &pi; / 2 2 N 2 ) , Wherein i = 0,1 , . . . , 2 N 2 - 1 .
4, the frequency deviation compensating device in the communication system according to claim 1 is characterized in that, described communication system is orthogonal frequency division multiplex OFDM system or carrier wave communication system.
CNB2006101040552A 2006-07-31 2006-07-31 Periodic function argument converting device, method and communication apparatus using same Expired - Fee Related CN100511211C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006101040552A CN100511211C (en) 2006-07-31 2006-07-31 Periodic function argument converting device, method and communication apparatus using same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006101040552A CN100511211C (en) 2006-07-31 2006-07-31 Periodic function argument converting device, method and communication apparatus using same

Publications (2)

Publication Number Publication Date
CN1904876A CN1904876A (en) 2007-01-31
CN100511211C true CN100511211C (en) 2009-07-08

Family

ID=37674142

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006101040552A Expired - Fee Related CN100511211C (en) 2006-07-31 2006-07-31 Periodic function argument converting device, method and communication apparatus using same

Country Status (1)

Country Link
CN (1) CN100511211C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3442124B1 (en) * 2017-08-07 2020-02-05 Siemens Aktiengesellschaft Method for protecting data in a data storage medium to prevent an unrecognised change and corresponding data processing system
CN111581590B (en) * 2020-05-07 2023-08-29 中车株洲电力机车研究所有限公司 Integral calculation method and device based on fixed point number variable

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4525862A (en) * 1980-07-02 1985-06-25 Motorola, Inc. Transform modulation system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4525862A (en) * 1980-07-02 1985-06-25 Motorola, Inc. Transform modulation system

Also Published As

Publication number Publication date
CN1904876A (en) 2007-01-31

Similar Documents

Publication Publication Date Title
CN101106558B (en) Communication device and method for caculating set value of orthogonal error compensation
JP3214867B2 (en) π / 4DQPSK modulation method
CN100458646C (en) Trigonometric value determiner, determining method and telecommunicating apparatus therewith
CN102882818B (en) Amending method and amending system directing at unbalanced zero intermediate frequency feedback
CN103873160B (en) A kind of method and device for the phase hit for improving digital phase modulation
CN107135174A (en) Sender unit, carrier phase recovery device and method
CN102859908A (en) Phase skew compensation at a coherent optical receiver
CN103488245A (en) Phase-amplitude conversion method and device in DDS (Direct Digital Synthesizer)
CN100511211C (en) Periodic function argument converting device, method and communication apparatus using same
CN102323878B (en) Circuit device and method for norm correction of CORDIC (Coordinated Rotation Digital Computer) algorithm
TWI420807B (en) An arbitrary frequency shifter in communication systems
CN109614073B (en) Four-quadrant arctangent function hardware realization circuit
CN110971243A (en) System and method for decoding BCH encoded codewords
CN201663654U (en) Non-integral multiple interpolation device and signal modulation system
CN101834818A (en) GMSK (Guassian Minimum Shift Keying) modulation device and method
CN102422622B (en) Signal mapping
CN102566963A (en) Method for processing data in field programmable gate array (FPGA)
US11196609B2 (en) Interpolation method for polar signals in radio frequency transmitters
Baltar et al. Efficient filter bank multicarrier realizations for 5G
CN102325111A (en) A kind of method that produces the GFSK baseband signal
CN110429985B (en) Fully-integrated low-cost high-speed high-precision out-of-phase modulator
Zhu et al. The Design of NCO Built in Ultra High-Speed Data Converter
JP5700562B2 (en) Optical transmission system
Bernhard et al. Implementation of an IFFT for an Optical OFDM Transmitter with 12.1 Gbit/s
Pote et al. Arithmetic of Koblitz Curve Secp256k1 Used in Bitcoin Cryptocurrency Based on One Variable Polynomial Division

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090708

Termination date: 20130731