Summary of the invention
The object of the present invention is to provide a kind of generation method and apparatus of pseudo random sequence, make to generate quickly pseudo random sequence.
For solving the problems of the technologies described above, embodiments of the present invention provide a kind of generation method of pseudo random sequence, comprise following steps:
Adopt the generation relation of a m sequence, to the first pseudo random sequence x
1(n+D) carry out recursion, obtain described x
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+T
1) mould 2 add the reduced form of expression:
Wherein, coefficient a
i∈ 0,1}, and i=0,1,2,3 ... T
1; Described n is random natural number;
By described x
1(n+D) a in reduced form
igetting 0 item number removes;
According to described removal a
iget the x obtaining after 0 item number
1(n+D), generate described the first pseudo random sequence.
Embodiments of the present invention also provide a kind of generating apparatus of pseudo random sequence, comprise:
The first pseudo random sequence generator, for according to the first pseudo random sequence x
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+T
1) mould 2 add the reduced form of expression
And by described x
1(n+D) a in reduced form
iget 0 item number and remove, generate described the first pseudo random sequence; Wherein, described x
1(n+D) reduced form adopts the generation relation of a m sequence to carry out recursion and obtains; In formula, coefficient a
i∈ 0,1}, and i=0,1,2,3 ... T
1; Described n is random natural number.
Embodiment of the present invention in terms of existing technologies, by adopting the generation relation of a m sequence, to the first pseudo random sequence x
1(n+D) carry out recursion, obtain x
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+T
1) mould 2 add the reduced form of expression, generate the first pseudo random sequence, can directly obtain the data after original repeatedly circulation, do not need first to generate hash, make to generate quickly pseudo random sequence, reduce processing delay, be conducive to parallel computation.
In addition, according to described removal a
iget the x obtaining after 0 item number
1(n+D),, before generating the step of described the first pseudo random sequence, also comprise following steps:
Adopt the generation relation of the 2nd m sequence, to the second pseudo random sequence x
2(n+D) carry out recursion, obtain described x
2(n+D) use x
2(n), x
2(n+1) ..., x
2(n+T
2) mould 2 add the reduced form of expression:
Wherein, coefficient b
j∈ 0,1}, and j=0,1,2,3 ... T
2;
By described x
2(n+D) b in reduced form
jgetting 0 item number removes;
According to described removal a
iget the x obtaining after 0 item number
1(n+D), generate in the step of described the first pseudo random sequence, also comprise following sub-step:
According to described removal b
jget the x obtaining after 0 item number
2(n+D), generate described the second pseudo random sequence;
According to described removal a
iget the x obtaining after 0 item number
1(n+D),, after generating the step of described the first pseudo random sequence, also comprise following steps:
The first pseudo random sequence of described generation and the second pseudo random sequence exclusive-OR that is shifted is generated to Gold sequence c (n), and the expression of described c (n) is c (n)=(x
1(n+D)+x
2(n+D)) mod2.
While adopting two m sequences to generate Gold sequence, also can recursion obtain the reduced representation form of each m sequence, thereby generate Gold sequence, can further reduce processing delay, be conducive to parallel computation, make to generate quickly pseudo random sequence.
In addition, also comprise following steps:
In advance long pseudo-random sequence is divided into the m section of every section of N data, use c (n+N), c (n+2N) ..., c (n+mN) represent, wherein, described n=0,1 ..., N-1;
Obtaining described x
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+T
1) mould 2 add in the step of reduced form of expression, also comprise following sub-step:
Adopt the generation relation of a m sequence, will be used for generating described c (n+N), c (n+2N) ..., c (n+mN) the first pseudo random sequence x
1(n+D) carry out recursion, obtain described c (n+N), c (n+2N) ..., x in c (n+mN)
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+T
1) mould 2 add the reduced form of expression;
By described x
1(n+D) a in reduced form
iget in the step that 0 item number removes, also comprise following sub-step:
By described c (n+N), c (n+2N) ..., x in c (n+mN)
1(n+D) a in reduced form
igetting 0 item number removes;
Obtaining described x
2(n+D) use x
2(n), x
2(n+1) ..., x
2(n+T
2) mould 2 add in the step of reduced form of expression, also comprise following sub-step:
Adopt the generation relation of the 2nd m sequence, will be used for generating described c (n+N), c (n+2N) ..., c (n+mN) the second pseudo random sequence x
2(n+D) carry out recursion, obtain described c (n+N), c (n+2N) ..., x in c (n+mN)
2(n+D) use x
2(n), x
2(n+1) ..., x
2(n+T
2) mould 2 add the reduced form of expression;
By described x
2(n+D) b in reduced form
jget in the step that 0 item number removes, also comprise following sub-step:
By described c (n+N), c (n+2N) ..., x in c (n+mN)
2(n+D) b in reduced form
jgetting 0 item number removes;
Generate in the step of described pseudo random sequence c (n) at exclusive-OR that the first pseudo random sequence of described generation and the second pseudo random sequence are shifted, also comprise following sub-step:
Parallel generation Gold sequence c (n+N), c (n+2N) ..., c (n+mN), obtain described long pseudo-random sequence.
By by long pseudo-random sequence segmentation parallel generation, can further accelerate the generation of pseudo random sequence.
embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, the embodiments of the present invention are explained in detail.But, persons of ordinary skill in the art may appreciate that in the each execution mode of the present invention, in order to make reader understand the application better, many ins and outs are proposed.But, even without these ins and outs and the many variations based on following execution mode and modification, also can realize the each claim of the application technical scheme required for protection.
The first execution mode of the present invention relates to a kind of generation method of pseudo random sequence, and idiographic flow as shown in Figure 2, comprises following steps:
Step 201, the generation relation of employing the one m sequence, to the first pseudo random sequence x
1(n+D) carry out recursion, obtain x
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+T
1) mould 2 add the reduced form of expression:
Wherein, coefficient a
i∈ 0,1}, and i=0,1,2,3 ... T
1; N is random natural number.
Step 202, by x
1(n+D) a in reduced form
igetting 0 item number removes.
In LTE standard or WCDMA standard, and the generation relation of a m sequence all has deterministic expression, correspondingly, and T
1also there is determined value with the value of D, refer to relevant criterion, do not repeat them here.Describe with LTE standard below.
The generation relation of the one m sequence can be x
1(n+31)=(x
1(n+3)+x
1(n)) mod2, in fact this generation relation has described a kind of recurrence relation, can be equivalent to:
x
1(n+D)=(x
1(n+D-28)+x
1(n+D-31))mod2,D≥31,
Recursion so always, because all additions are all that mould 2 adds, can obtain x
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+30) form that mould 2 adds, as follows:
x
1(n+D)=(x
1(n+D-28)+x
1(n+D-31))mod2
=(x
1(n+D-28-28)+x
1(n+D-28-31))mod2+(x
1(n+D-31-28)+x
1(n+D-31-31))mod2
=(x
1(n+D-28*2)+x
1(n+D-31*2))mod2
...
=(a
30x
1(n+30)+a
29x
1(n+29)+…+a
0x
1(n))mod2
Wherein, coefficient a
i∈ { 0,1}.
In order to allow sequence randomization as far as possible, D can get 1600.
Generation by a m sequence is related to x
1(n+31)=(x
1(n+3)+x
1(n)) mod2 rewrites
x
1(n+31)=(x
1(n+3)+x
1(n))mod2
=(x
1(n+3-31+31)+x
1(n-31+31))mod2
=(x
1(n-25)+x
1(n-28))mod2+(x
1(n-28)+x
1(n-31))mod2 (1.1)
=(x
1(n-25)+x
1(n-31))mod2
...
Same:
x
1(n)=(x
1(n-28)+x
1(n-31))mod2
=(x
1(n-28-28)+x
1(n-28-31))mod2+(x
1(n-31-28)+x
1(n-31-31))mod2
=(x
1(n-28*2)+x
1(n-31*2))mod2 (1.2)
=(x
1(n-28*4)+x
1(n-31*4))mod2
...
Comprehensive 1.1 and 1.2 formulas, recursion is gone down always, can obtain x
1(n+1600) calculating formula is:
Step 203, according to removing a
iget the x obtaining after 0 item number
1(n+D), generate the first pseudo random sequence.
Compared with prior art, present embodiment is by adopting the generation relation of a m sequence, to the first pseudo random sequence x
1(n+D) carry out recursion, obtain x
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+T
1) mould 2 add the reduced form of expression, generate the first pseudo random sequence, can directly obtain the data after original repeatedly circulation, do not need first to generate hash, make to generate quickly pseudo random sequence, reduce processing delay, be conducive to parallel computation.
The second execution mode of the present invention relates to a kind of generation method of pseudo random sequence.The second execution mode has been done further improvement on the first execution mode basis, main improvements are: in second embodiment of the invention, while adopting two m sequences to generate Gold sequence, also can recursion obtain the reduced representation form of each m sequence, thereby generate Gold sequence, can further reduce processing delay, be conducive to parallel computation, make to generate quickly pseudo random sequence.
Specifically, as shown in Figure 3, comprise following steps:
Step 301 to 302 with step 201 similar to step 202, recursion obtains the first pseudo random sequence x
1(n+D) reduced form, and remove wherein coefficient and get 0 item, do not repeat them here.
Step 303, the generation relation of employing the 2nd m sequence, to the second pseudo random sequence x
2(n+D) carry out recursion, obtain described x
2(n+D) use x
2(n), x
2(n+1) ..., x
2(n+T
2) mould 2 add the reduced form of expression:
Wherein, coefficient b
j∈ 0,1}, and j=0,1,2,3 ... T
2.
Step 304, by described x
2(n+D) b in reduced form
jgetting 0 item number removes.
Step 303 to 304 in, recursion obtains the second pseudo random sequence x
2(n+D) reduced form, and remove wherein coefficient and get 0 item, with similar in the first execution mode, T
2determine according to the regulation of Long Term Evolution LTE standard or Wideband Code Division Multiple Access (WCDMA) WCDMA standard.Take LTE system as example, the generation of the 2nd m sequence is closed and is:
x
2(n+31)=(x
2(n+3)+x
2(n+2)+x
2(n+1)+x
2(n))mod2
Carry out recursion, obtain x
2(n+1600) calculating formula is:
Obtain the reduced form of the first pseudo random sequence and the second pseudo random sequence in recursion, and remove after coefficient gets 0 item, execution step 305 and 306, generates the first pseudo random sequence and the second pseudo random sequence.
Specifically, step 305, according to removing a
iget the x obtaining after 0 item number
1(n+D), generate the first pseudo random sequence;
Step 306, according to removing b
jget the x obtaining after 0 item number
2(n+D), generate the second pseudo random sequence.
Then, in step 307, by generate the first pseudo random sequence and the second pseudo random sequence be shifted exclusive-OR generate Gold sequence c (n), wherein, the expression of c (n) is c (n)=(x
1(n+D)+x
2(n+D)) mod2.
From above-mentioned steps, in the time adopting two m sequences to generate Gold sequence, can first recursion obtain the reduced representation form of each m sequence, exclusive-OR is again shifted two m sequences, thereby generate Gold sequence, can further reduce processing delay, be conducive to parallel computation, make to generate quickly pseudo random sequence.
The 3rd execution mode of the present invention relates to a kind of generation method of pseudo random sequence.The 3rd execution mode has been done further improvement on the second execution mode basis, and main improvements are: in third embodiment of the invention, by by long pseudo-random sequence segmentation parallel generation, can further accelerate the generation of pseudo random sequence.
Specifically, as shown in Figure 4, comprise following steps:
Step 401, is divided into long pseudo-random sequence the m section of every section of N data in advance, with c (n+N), c (n+2N) ..., c (n+mN) represent, wherein, n=0,1 ..., N-1.
Step 402, adopts the generation relation of a m sequence, will be used for generating c (n+N), c (n+2N) ..., c (n+mN) the first pseudo random sequence x
1(n+D) carry out recursion, obtain c (n+N), c (n+2N) ..., x in c (n+mN)
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+30) mould 2 adds the reduced form of expression; Similar with step 301, do not repeat them here.
Step 403, by c (n+N), c (n+2N) ..., x in c (n+mN)
1(n+D) a in reduced form
igetting 0 item number removes; Similar with step 302, do not repeat them here.
Step 404, adopts the generation relation of the 2nd m sequence, will be used for generating c (n+N), c (n+2N) ..., c (n+mN) the second pseudo random sequence x
2(n+D) carry out recursion, obtain c (n+N), c (n+2N) ..., x in c (n+mN)
2(n+D) use x
2(n), x
2(n+1) ..., x
2(n+30) mould 2 adds the reduced form of expression; Similar with step 303, do not repeat them here.
Step 405, by c (n+N), c (n+2N) ..., x in c (n+mN)
2(n+D) b in reduced form
jgetting 0 item number removes; Similar with step 304, do not repeat them here.
Step 406, parallel generation Gold sequence c (n+N), c (n+2N) ..., c (n+mN), obtain long pseudo-random sequence.
In the data to longer need to walk abreast descrambling or similar operations, while needing the scrambler of the each segment data of parallel generation, adopt present embodiment can reduce processing delay, generate quickly long pseudo-random sequence.
The step of the whole bag of tricks is divided above, just in order being described clearly, can to merge into a step or some step is split while realization, is decomposed into multiple steps, as long as comprise identical logical relation, all in the protection range of this patent; To adding inessential modification in algorithm or in flow process or introducing inessential design, but the core design that does not change its algorithm and flow process is all in the protection range of this patent.
Four embodiment of the invention relates to a kind of generating apparatus of pseudo random sequence, comprises:
The first pseudo random sequence generator, for according to the first pseudo random sequence x
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+T
1) mould 2 add the reduced form of expression
And by x
1(n+D) a in reduced form
iget 0 item number and remove, generate the first pseudo random sequence; Wherein, x
1(n+D) reduced form adopts the generation relation of a m sequence to carry out recursion and obtains; In formula, coefficient a
i∈ 0,1}, and i=0,1,2,3 ... T
1; N is random natural number.
Take LTE system as example, as shown in Figure 5, in figure, box indicating shift register, in First ray maker, by i=1,3,4,5,6,9,12,17,19, the result output that exclusive-OR is carried out in the output of 20,23 these 11 registers is the first pseudo random sequence.
Be not difficult to find, present embodiment is the system embodiment corresponding with the first execution mode, present embodiment can with the enforcement of working in coordination of the first execution mode.The correlation technique details of mentioning in the first execution mode is still effective in the present embodiment, in order to reduce repetition, repeats no more here.Correspondingly, the correlation technique details of mentioning in present embodiment also can be applicable in the first execution mode.
It is worth mentioning that, each module involved in present embodiment is logic module, and in actual applications, a logical block can be a physical location, can be also a part for a physical location, can also realize with the combination of multiple physical locations.In addition, for outstanding innovation part of the present invention, in present embodiment, the unit not too close with solving technical problem relation proposed by the invention do not introduced, but this does not show not exist in present embodiment other unit.
Fifth embodiment of the invention relates to a kind of generating apparatus of pseudo random sequence.The 5th execution mode has done further improvement on the 4th execution mode basis, main improvements are: in fifth embodiment of the invention, while adopting two m sequences to generate Gold sequence, also adopt two pseudo random sequence generators, by the Output rusults displacement exclusive-OR of two pseudo random sequences, generate Gold sequence, can further reduce processing delay, be conducive to parallel computation, make to generate quickly pseudo random sequence.
Specifically, on the first execution mode basis, also comprise the second pseudo random sequence generator, for according to the second pseudo random sequence x
2(n+D) use x
2(n), x
2(n+1) ..., x
2(n+T
2) mould 2 add the reduced form of expression
And by x
2(n+D) b in reduced form
jget 0 item number and remove, generate the second pseudo random sequence; Wherein, x
2(n+D) reduced form adopts the generation relation of the 2nd m sequence to carry out recursion and obtains; In formula, coefficient b
j∈ 0,1}, and j=0,1,2,3 ... T
2;
Adder, for the first pseudo random sequence generating and the second pseudo random sequence exclusive-OR that is shifted are obtained to Gold sequence c (n), wherein, the expression of c (n) is c (n)=(x
1(n+D)+x
2(n+D)) mod2.
Take LTE system as example, the calculating formula that First ray maker adopts is:
The calculating formula that the second sequence generator adopts is:
According to above-mentioned two calculating formulas, can obtain random sequence generator new in LTE as shown in Figure 6, in figure, box indicating shift register, in First ray maker, by i=1,3,4,5,6,9,12,17, the output of 19,20,23 these 11 registers is carried out the result of exclusive-OR and is exported to adder; In the second sequence generator by j=1,2,3,8,12, the output of 16,19,20,23 these 9 registers is carried out the result of exclusive-OR and is exported to adder, two output displacement exclusive-OR are obtained required Gold sequence by adder.
Be not difficult to find, present embodiment is the system embodiment corresponding with the second execution mode, present embodiment can with the enforcement of working in coordination of the second execution mode.The correlation technique details of mentioning in the second execution mode is still effective in the present embodiment, in order to reduce repetition, repeats no more here.Correspondingly, the correlation technique details of mentioning in present embodiment also can be applicable in the second execution mode.
Sixth embodiment of the invention relates to a kind of generating apparatus of pseudo random sequence.The 6th execution mode has done further improvement on the 5th execution mode basis, main improvements are: in sixth embodiment of the invention, by by long pseudo-random sequence segmentation, and build several pseudo random sequence generators, generate the pseudo random sequence of segmentation simultaneously, can parallel generation long pseudo-random sequence, further accelerate the generation of pseudo random sequence.
Specifically, present embodiment comprises deserializer, in advance long pseudo-random sequence being divided into the m section of every section of N data, use c (n+N), c (n+2N) ..., c (n+mN) represent, n=0,1 ..., N-1;
M segmentation pseudo random sequence generator, as shown in Figure 7, for parallel generation pseudo random sequence c (n+N), c (n+2N) ..., c (n+mN), obtain long pseudo-random sequence;
Each segmentation pseudo random sequence generator comprises First ray maker, the second sequence generator and adder;
Wherein, the calculating formula that First ray maker adopts is respectively to adopt the generation relation of a m sequence, will be used for generating c (n+N), c (n+2N) ..., c (n+mN) the first pseudo random sequence x
1(n+D) carry out recursion, obtain c (n+N), c (n+2N) ..., x in c (n+mN)
1(n+D) use x
1(n), x
1(n+1) ..., x
1(n+T
1) mould 2 add the reduced form of expression, and remove a
iget 0 item number, the calculating formula obtaining;
The calculating formula that the second sequence generator adopts is respectively to adopt the generation relation of the 2nd m sequence, will be used for generating c (n+N), c (n+2N) ..., c (n+mN) the second pseudo random sequence x
2(n+D) carry out recursion, obtain c (n+N), c (n+2N) ..., x in c (n+mN)
2(n+D) use x
2(n), x
2(n+1) ..., x
2(n+T
2) mould 2 add the reduced form of expression, and remove b
jget 0 item number, the calculating formula obtaining.
Because the 3rd execution mode is mutually corresponding with present embodiment, therefore present embodiment can with the enforcement of working in coordination of the 3rd execution mode.The correlation technique details of mentioning in the 3rd execution mode is still effective in the present embodiment, and the technique effect that can reach in the 3rd execution mode can be realized in the present embodiment too, in order to reduce repetition, repeats no more here.Correspondingly, the correlation technique details of mentioning in present embodiment also can be applicable in the 3rd execution mode.
Persons of ordinary skill in the art may appreciate that the respective embodiments described above are to realize specific embodiments of the invention, and in actual applications, can do various changes to it in the form and details, and without departing from the spirit and scope of the present invention.