CN109375897B - Method for generating pseudo-random sequence - Google Patents

Method for generating pseudo-random sequence Download PDF

Info

Publication number
CN109375897B
CN109375897B CN201710657524.1A CN201710657524A CN109375897B CN 109375897 B CN109375897 B CN 109375897B CN 201710657524 A CN201710657524 A CN 201710657524A CN 109375897 B CN109375897 B CN 109375897B
Authority
CN
China
Prior art keywords
data
initial data
pseudo
random sequence
shift register
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
CN201710657524.1A
Other languages
Chinese (zh)
Other versions
CN109375897A (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.)
Potevio Information Technology Co Ltd
Original Assignee
Potevio Information Technology 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 Potevio Information Technology Co Ltd filed Critical Potevio Information Technology Co Ltd
Priority to CN201710657524.1A priority Critical patent/CN109375897B/en
Publication of CN109375897A publication Critical patent/CN109375897A/en
Application granted granted Critical
Publication of CN109375897B publication Critical patent/CN109375897B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/582Pseudo-random number generators
    • G06F7/586Pseudo-random number generators using an integer algorithm, e.g. using linear congruential method

Abstract

The invention provides a method for generating a pseudo-random sequence, which is characterized in that N pieces of first data and N pieces of second data are respectively calculated according to N pieces of first initial data and N pieces of second initial data and are respectively used as initial data of a first shift register and initial data of a second shift register. The first data in the pseudo random sequence may be generated by one clock cycle according to initial data of the first shift register and the second shift register, and one data in the pseudo random sequence is generated every clock cycle, and finally the pseudo random sequence is generated. The first data in the pseudo-random sequence is generated only by one clock cycle, so that the speed of generating the pseudo-random sequence is greatly improved, and the generation time is shortened.

Description

Method for generating pseudo-random sequence
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method for generating a pseudorandom sequence.
Background
Currently, pseudorandom sequences are used in spread spectrum communication systems to multiply the modulated signal by the bandwidth of the spread signal, or to achieve data scrambling. Existing hardware circuits that implement simple pseudo-random sequences are typically shift registers with a tap structure. In practical applications, a pseudo-random sequence used for modulation or demodulation with a signal is not a single sequence, but a result of some logical operation performed by a plurality of pseudo-random sequences having different initial values. In a Long Term Evolution (LTE-a) system, a generation function of a pseudo-random sequence is two sub-sequences x1(n+NC) And x2(n+NC) And performing modulo two addition.
In LTE-a systems, physical channels carrying different services require pseudo-random sequences with different initial values, for example, in a Physical Broadcast Channel (PBCH), the initial values are required
Figure GDA0002943589500000011
Wherein the ID is a cell identity. On the other hand, a Physical Downlink Control Channel (PDCCH) requires an initial value
Figure GDA0002943589500000012
Wherein n issIs the time slot number, nRNTIAnd Radio Network Temporary Identifier (RNTI). HardwareIn the implementation, the real-time performance of the sequence generation is very strict, but generally, a circuit for generating the pseudo-random sequence needs to initialize for a plurality of clock cycles before the calculation output of the first data in the pseudo-random sequence is completed. The pseudo-random sequence in the LTE-a system can be represented by the following formula: c (n) ═ x1(n+NC)+x2(n+NC)]mod2 where x1(n+31)=[x1(n+3)+x1(n)]mod2,x2(n+31)=[x2(n+3)+x2(n+2)+x2(n+1)+x2(n)]mod 2. Neutron sequence x1(n) and x2(N) are respectively two m sequences, NC=1600,NCIs the state offset added to ensure non-correlation between two different m-sequences, mod2 represents the modulo-2 addition of the previous data. In the generation process of the pseudo-random sequence C, two subsequences x1(n) and x2(n) are generated by shifting 31 linear shift registers with feedback, respectively, where x1(0)~x1(30) And x2(0)~x2(30) Are respectively x1(n) and x2(n) known initial values or initial values that can be calculated indirectly. Thus, due to NCTo obtain the value of c (0), in the common algorithm of the prior art, it is necessary to wait at least for NCOne clock cycle completes x1(NC) And x2(NC) Calculation of (2), i.e. requiring iteration NCThen c (0) can be calculated.
The structure of the conventional circuit for generating the pseudo-random sequence C is shown in fig. 1. In the initial state, the subsequence x1(n) and x 231 initial values of (n) are respectively filled in a shift register with the depth of 31 bits, then the shift register is driven by a clock to operate, and x is respectively calculated1(n) and x2The subsequent value of (n), the first data C (0) of the pseudo-random sequence C, needs to wait 1600 clock cycles later, by x1(1600) And x2(1600) And (6) calculating.
The conventional method for generating the pseudorandom sequence can calculate the required pseudorandom sequence only through multiple iterations, so that the time for generating the pseudorandom sequence is greatly prolonged, and the speed for generating the pseudorandom sequence is reduced.
Disclosure of Invention
To overcome the above problems or to at least partially solve the above problems, the present invention provides a method for generating a pseudo-random sequence.
In one aspect, the present invention provides 1, a method for generating a pseudorandom sequence, including: s1, respectively acquiring N first initial data and N second initial data; n is an integer greater than 3; s2, calculating N first data based on a first recurrence formula according to the N first initial data, and using the N first data as initial data of a first shift register; s3, calculating N second data based on a second recursion formula according to the N second initial data, and taking the N second data as initial data of a second shift register; s4, generating the pseudo random sequence according to the initial data of the first shift register and the initial data of the second shift register.
Preferably, S2 specifically includes: and based on a first recursion formula, expressing each first data in the N first data through a plurality of first initial data in the N first initial data, and calculating the N first data.
Preferably, the first recurrence formula is obtained by iterative calculation through the following formula:
x1(n+N)=[x1(n+3)+x1(n)]mod2
wherein x is1(N + N) is the first subsequence x1N +1 th data, and the x1The first N data x in1(0)~x1And (N-1) is the N first initial data, and N is more than or equal to 0.
Preferably, the first recurrence formula is as follows:
Figure GDA0002943589500000031
wherein x is1(n) is said x1The (n +1) th data of (c),
Figure GDA0002943589500000032
represents the largest integer no greater than N/N,
Figure GDA0002943589500000033
means not more than
Figure GDA0002943589500000034
Is the XOR operation sign.
Preferably, S3 specifically includes: and based on a second recursion formula, representing each second data in the N second data by a plurality of second initial data in the N second initial data, and calculating the N second data.
Preferably, the second recurrence formula is obtained by iterative calculation through the following formula:
x2(n+N)=[x2(n+3)+x2(n+2)+x2(n+1)+x2(n)]mod2
wherein x is2(N + N) is the second subsequence x2N +1 th data, and the x2The first N data x in2(0)~x2And (N-1) is the N second initial data, and N is more than or equal to 0.
Preferably, the second recurrence formula is as follows:
Figure GDA0002943589500000041
wherein x is2(n) is said x2The (n +1) th data of (c),
Figure GDA0002943589500000042
represents the largest integer no greater than N/N,
Figure GDA0002943589500000043
means not more than
Figure GDA0002943589500000044
Is an XOR operationAnd (4) a symbol.
In another aspect, the present invention provides a device for generating a pseudorandom sequence, including: at least one processor; and at least one memory communicatively coupled to the processor, wherein: the memory stores program instructions executable by the processor, which calls the program instructions to perform the generation method described above.
In another aspect, the invention provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the above-described generation method.
In another aspect, the present invention provides a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the above-described generation method.
According to the method for generating the pseudorandom sequence, N pieces of first data and N pieces of second data are respectively calculated according to N pieces of first initial data and N pieces of second initial data and are respectively used as initial data of a first shift register and initial data of a second shift register. The first data in the pseudo random sequence may be generated by one clock cycle according to initial data of the first shift register and the second shift register, and one data in the pseudo random sequence is generated every clock cycle, and finally the pseudo random sequence is generated. Only one clock cycle is required to generate the first data in the pseudo-random sequence. The first data of the pseudo-random sequence can be obtained directly according to the N first initial data and the N second initial data through the first shift register and the second shift register after a specified number of clock cycles. In the process of generating the first data of the pseudo-random sequence, iteration is not needed, and the generation can be completed only by one clock cycle, so that the speed of generating the pseudo-random sequence is greatly improved, and the generation time is shortened.
Drawings
FIG. 1 is a schematic diagram of a circuit for generating a pseudo-random sequence in the prior art;
fig. 2 is a flowchart of a method for generating a pseudo-random sequence according to an embodiment of the present invention;
fig. 3 shows x in a method for generating a pseudo-random sequence according to an embodiment of the present invention1(n+NC) A schematic diagram of a recursively generated relationship;
fig. 4 shows x in a method for generating a pseudo-random sequence according to an embodiment of the present invention2(n+NC) A schematic diagram of a recursively generated relationship;
fig. 5 is a flowchart of a method for generating a pseudo-random sequence according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating the relationship between the number of recursion instances and the recursion depth when calculating any one of the data in the first subsequence in the prior art;
FIG. 7 is a diagram illustrating the relationship between the number of recursion instances and the recursion depth in calculating any one data in the second subsequence in the prior art;
fig. 8 is a flowchart of a method for generating a pseudo-random sequence according to an embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
In order to make the generated pseudo-random sequence meet a specific requirement, when the pseudo-random sequence C is generated by using the existing method, the pseudo-random sequence C is usually obtained by performing a certain logic operation on the output results of a plurality of different subsequences and then using the output results as the pseudo-random sequence of the current time, which requires multiple recursive iterations. Moreover, when data with different sequence numbers in the pseudorandom sequence C is generated, recursion depths may be different, as shown in the implementation of a hardware circuit, and these recursion iterative operations need to be completed by calculation of multiple clock cycles.
As shown in fig. 2, an embodiment of the present invention provides a method for generating a pseudorandom sequence, including: s1, respectively acquiring N first initial data and N second initial data; n is an integer greater than 3; s2, calculating N first data based on a first recurrence formula according to the N first initial data, and using the N first data as initial data of a first shift register; s3, calculating N second data based on a second recursion formula according to the N second initial data, and taking the N second data as initial data of a second shift register; s4, generating the pseudo random sequence according to the initial data of the first shift register and the initial data of the second shift register.
In particular, if a sequence is to be determined, on the one hand it can be predetermined and can be produced and reproduced repeatedly; on the other hand, it has the random property (i.e., statistical property) of a random sequence, which is a pseudo-random sequence. A pseudo-random sequence is a defined sequence with some random character, generated by a shift register. The m-sequence is short for the longest linear feedback shift register sequence, which is the one with the longest period generated by the shift register with linear feedback. The new sequence formed by the product of the m-sequence pair, preferably two primitive polynomials of degree n, is a Gold sequence, or the shifted modulo-2 of the sequence generated by the m-sequence pair, preferably two primitive polynomials, and the corresponding new sequence is also called a Gold sequence. The scheme of the present invention is described below in terms of generating Gold sequences, but the present invention is not limited to generating Gold sequences, and can also be used to generate other pseudo-random sequences.
In the LTE-a system, a Gold sequence is composed of a first subsequence and a second subsequence, and each subsequence corresponds to N initial data, i.e., N first initial data and N second initial data. Here, N is the number of initial data and the cycle length of the first subsequence and the second subsequence, and since the Gold sequence is composed of the first subsequence and the second subsequence, the cycle length of the Gold sequence is also N.
Since the initial data of the first subsequence and the second subsequence are both N, the number of bits of the first shift register matched with the first subsequence needs to be N, and similarly, the number of bits of the second shift register matched with the second subsequence needs to be N. N first data in the first subsequence, which can be used to generate the first data in the pseudorandom sequence, are calculated based on a first recurrence formula, and the N first data are used as initial data of the first shift register. Similarly, based on the second recursion formula, N second data in the second subsequence, which can be used for generating the first data in the pseudo-random sequence, are calculated, and the N second data are used as the initial data of the second shift register.
In this embodiment, the execution sequence of S2 and S3 is relatively independent, and there is no specific timing relationship, and S2 may be executed first and then S3, S3 may be executed first and then S2 may be executed, or S2 and S3 may be executed simultaneously. And is not particularly limited herein.
According to the initial data of the first shift register and the initial data of the second shift register, the first data in the pseudo-random sequence can be obtained after one clock cycle, then based on the property of the shift register, new data can be generated every time one clock cycle passes, and after a plurality of clock cycles, the subsequent data in the pseudo-random sequence can be obtained to generate the pseudo-random sequence.
In this embodiment, N first data and N second data are respectively calculated from N first initial data and N second initial data and are respectively used as initial data of the first shift register and the second shift register, first data in the pseudo-random sequence may be generated through one clock cycle according to the initial data of the first shift register and the second shift register, and one data in the pseudo-random sequence may be generated every time one cycle passes, and the pseudo-random sequence may be finally generated. The first data to generate the pseudo-random sequence only needs one clock cycle. The first data of the pseudo-random sequence can be obtained directly according to the N first initial data and the N second initial data through the first shift register and the second shift register after a specified number of clock cycles. In the process of generating the first data of the pseudo-random sequence, iteration is not needed, and the generation can be completed only by one clock cycle, so that the speed of generating the pseudo-random sequence is greatly improved, and the generation time is shortened.
It should be noted that "first" and "second" mentioned in the embodiments of the present invention are only for distinguishing purposes and are not limited to timing or order.
In the LTE-a system, a pseudo-random sequence used for spreading is a Gold sequence with a period length N of 31, that is, there are 31 initial data in the Gold sequence. The Gold sequence is composed as follows:
c(n)=[x1(n+NC)+x2(n+NC)]mod2
Figure GDA0002943589500000081
since mod2 represents the modulo-2 addition of the previous data, the modulo-2 addition is a binary operation, equivalent to an exclusive OR (the logical operation of the exclusive OR is a ^ operation). So the Gold sequence c (n) can also be expressed as:
c(n)=x1(n+NC)^x2(n+NC)
wherein the content of the first and second substances,
Figure GDA0002943589500000091
x1is the first subsequence, x2Is the second subsequence. The following introduces the concept of data sequence number, where a data sequence number refers to a sequence, and different sequence numbers are set for each data according to the position of each data in the sequence, and starting from the first data, sequence numbers are set for each data in sequence, and the sequence numbers are respectively 0, 1, 2, and 3 … …, where the data corresponding to the sequence number 0 is the first data, the data corresponding to the sequence number 1 is the second data, and so on. For example, the first subsequence x1X in (2)1(0) The number indicating the correspondence of this data is 0, at x1Is the first, i.e. represents x1The first data in (1).
In the expression of the Gold sequence c (n), the first subsequence x1And a second subsequence x2State shift amounts N all differing from c (N) by the same amountCThat is, to generate c (0), x is required1(NC) And x2(NC) Generating c (1), requires x1(NC+1) and x2(NC+1), and so on. x is the number of1(n+NC) And x2(n+NC) The recurrence relation of (c) is shown in fig. 3 and 4. From the figure, x can be derived1(n+NC) From two values x of the previous moment1(n+NC-28) and x1(n+NC-31) determination of x2(n+NC) From four values x of the previous moment2(n+NC-28)、x2(n+NC-29)、x2(n+NC-30) and x2(n+NC-31) determining.
According to the physical channel and modulation specification, x, of LTE-A systems1And x2The first 31 initial data of (a) have been determined or may be determined indirectly from channel parameters. The values of the initial data are different, and the obtained pseudo-random sequences are different.
When N is presentC1600, the first data c (0) in the pseudo-random sequence is x1(1600)^x2(1600) That is, c (0) is obtained by performing an exclusive or operation on the 1601 th data in the first subsequence and the 1601 th data in the second subsequence. Similarly, to generate a pseudo-random sequence C, the data in the first subsequence and the data in the second subsequence need to be at least the 1601 th data or data subsequent to the 1601 th data. Therefore, to reduce unnecessary clock cycles, the initial values of the first shift registers are set to x, respectively1(1600)~x1(1630) Setting initial values of the second shift registers to x, respectively2(1600)~x2(1630) In this way, the first data in the pseudo random sequence can be generated in one clock cycle, and each data in the pseudo random sequence to be generated is calculated by using the properties of the first shift register and the second shift register.
On the basis of the foregoing embodiment, S2 specifically includes: and based on a first recursion formula, expressing each first data in the N first data through a plurality of first initial data in the N first initial data, and calculating the N first data.
Specifically, the first recurrence formula is obtained by iterative calculation through the following formula:
x1(n+N)=[x1(n+3)+x1(n)]mod2
wherein x is1(N + N) is the first subsequence x1N +1 th data, and the x1The first N data x in1(0)~x1And (N-1) is the N first initial data, and N is more than or equal to 0.
Iterative formula x for the first subsequence1And (N + N) analyzing, and constructing a first recursion formula through the iteration times executed by the iteration formula and the operation of modulo-2 addition. Wherein the number of iterations is
Figure GDA0002943589500000101
As the operation rule of the modulo-2 addition can know, the operation of the modulo-2 addition is carried out on the even number of the same data, and then the even number of the same data are deleted; the operation of modulo-2 addition on odd number of same data only retains one data, and the position of the data is not changed. Only the first and last terms remain after the first iteration and after each multiple of 2 iterations.
The first recursion formula is obtained as follows:
Figure GDA0002943589500000102
wherein x is1(n) is x1The (N +1) th data, N is the serial number of any data in the pseudo-random sequence, N is the cycle length of the pseudo-random sequence,
Figure GDA0002943589500000111
represents the largest integer no greater than N/N,
Figure GDA0002943589500000112
means not more than
Figure GDA0002943589500000113
Is the largest integer of (a).
In the following, N is 31, i.e. x1(n+31)=[x1(n+3)+x1(n)]mod 2. For any data x of the first subsequence1(n) obtaining x after the first iteration1(n)=x1(n-31)^x1(n-28), resulting after the second iteration:
x1(n)=x1(n-31×2)^x1(n-31-28)^x1(n-28-31)^x1(n-28×2)
=x1(n-31×2)^x1(n-28×2)
and performing third iteration on the two obtained terms by using the formula to obtain:
x1(n)=x1(n-31×3)^x1(n-31×2-28)^x1(n-28×2-31)^x1(n-28×3)
and performing fourth iteration on the two obtained terms by utilizing the formula to obtain:
x1(n)=x1(n-31×4)^x1(n-28×4)
by analogy, the obtained first recurrence formula is as follows:
Figure GDA0002943589500000114
using the first recursion formula, any data x in the first subsequence can be calculated1(n) of (a). In the following, the first data x with the calculation number 1000 is given by taking N as 1000 and N as 31 as an example1(1000)。
Due to the fact that
Figure GDA0002943589500000115
Respectively obtaining:
Figure GDA0002943589500000116
Figure GDA0002943589500000117
so x1(1000)=x1(8)^x1(104). But due to x1(104) Cannot be directly from the first sub-unitObtained from 31 initial data known or indirectly known in the sequence, which are needed for x1(104) The first recursion formula is reused until x is reduced1(1000) Represented by the initial data. x is the number of1(104) Further can be represented as x1(104)=x1(42)^x1(48)=x1(11)^x1(14)^x1(17)^x1(20)。
In summary, x1(1000)=x1(8)^x1(11)^x1(14)^x1(17)^x1(20)。
Through the first recursion formula, the 1601 th data to 1631 th data in the first subsequence can be obtained, namely x1(1600)~x1(1630) I.e. 31 first data, the results obtained are as follows:
x1(1600)=x1(1)^x1(12)^x1(17)^x1(19)^x1(20)^x1(25)^x1(3)^x1(4)^x1(5)^x1(6)^x1(9)
x1(1601)=x1(10)^x1(13)^x1(18)^x1(2)^x1(20)^x1(21)^x1(26)^x1(4)^x1(5)^x1(6)^x1(7)
x1(1602)=x1(11)^x1(14)^x1(19)^x1(21)^x1(22)^x1(27)^x1(3)^x1(5)^x1(6)^x1(7)^x1(8)
……
x1(1615)=x1(1)^x1(12)^x1(16)^x1(18)^x1(19)^x1(20)^x1(21)^x1(24)^x1(27)^x1(3)^x1(6)^x1(7)^x1(9)
x1(1630)=x1(0)^x1(14)^x1(16)^x1(18)^x1(2)^x1(21)^x1(22)^x1(24)^x1(27)^x1(4)^x1(6)^x1(7)
on the basis of the foregoing embodiment, S3 specifically includes: and based on a second recursion formula, representing each second data in the N second data by a plurality of second initial data in the N second initial data, and calculating the N second data.
Specifically, the second recurrence formula is obtained by iterative calculation through the following formula:
x2(n+N)=[x2(n+3)+x2(n+2)+x2(n+1)+x2(n)]mod2
wherein x is2(N + N) is the second subsequence x2N +1 th data, and the x2The first N data x in2(0)~x2And (N-1) is the N second initial data, and N is more than or equal to 0.
Iterative formula x for the second subsequence2And (N + N) analyzing, and constructing a second recursion formula through the iteration times executed by the iteration formula and the operation of modulo-2 addition. Wherein the number of iterations is
Figure GDA0002943589500000121
And
Figure GDA0002943589500000122
the formula can be equivalent to that the first term and the second term are subjected to exclusive-or operation, the third term and the fourth term are subjected to exclusive-or operation, and the obtained result is subjected to exclusive-or operation, so that the iteration times of the first term and the second term are the same, and the iteration times of the third term and the fourth term are the same.
As the operation rule of the modulo-2 addition can know, the operation of the modulo-2 addition is carried out on the even number of the same data, and then the even number of the same data are deleted; the operation of modulo-2 addition on odd number of same data only retains one data, and the position of the data is not changed. Only the first and last terms remain after the first iteration and after each multiple of 2 iterations.
The second recursion formula is obtained as follows:
Figure GDA0002943589500000131
wherein x is2(n) is said x2The (N +1) th data, N is the serial number of any data in the pseudo-random sequence, N is the cycle length of the pseudo-random sequence,
Figure GDA0002943589500000132
represents the largest integer no greater than N/N,
Figure GDA0002943589500000133
means not more than
Figure GDA0002943589500000134
Is the XOR operation sign.
Take N as an example 31, i.e. x2(n+31)=[x2(n+3)+x2(n+2)+x2(n+1)+x2(n)]mod 2. Using the same method as the first recurrence formula, a second recurrence formula is obtained as follows:
Figure GDA0002943589500000135
using a second recursion formula, any data x in the second subsequence can be calculated2(n) of (a). In the following, the second data x with the calculation number 1000 is still given by taking n as an example 10002(1000)。
Figure GDA0002943589500000136
Can be obtained separately:
Figure GDA0002943589500000137
Figure GDA0002943589500000138
so x2(1000)=x2(8)^x2(40)^x2(72)^x2(104). But due to x2(40)、x2(72) And x2(104) All are allCan be directly obtained from 31 initial data which are known or indirectly known in the second subsequence, and need to be respectively corresponding to x2(40)、x2(72) And x1(104) Reuse the second recurrence formula until x is2(1000) Represented by the initial data. x is the number of2(40) Further can be represented as x1(40)=x1(9)^x1(10)^x1(11)^x1(12),x2(72) Further can be represented as x1(72)=x1(10)^x1(12)^x1(14)^x1(16)。x2(104) Further can be expressed as:
x2(104)=[x2(11)^x2(12)^x2(13)^x2(14)]^[x2(13)^x2(14)^x2(15)^x2(16)]^[x2(15)^x2(16)^x2(17)^x2(18)]^[x2(17)^x2(18)^x2(19)^x2(20)]
because of XOR (logical operation symbol ^), the operation rule is: if each binary bit of the values at two sides of the symbol ^ has the same value of 0 and the different value of 1; meanwhile, when the exclusive-or operation is performed on the plurality of numerical values, the results obtained by the plurality of numerical values in different orders are different. So in calculating x2(1000) In the process, even number of the same second data are required to be deleted, odd number of the same second data are required to be reserved for one, but the position of each second data is required to be kept unchanged, so that the calculated result is prevented from being changed due to different orders of the second data.
In summary, x2(1000)=x2(8)^x2(9)^x2(12)^x2(14)^x2(19)^x2(20)。
Using a second recurrence formula, 1601 th data to 1631 th data in the second subsequence can be obtained, i.e. x2(1600)~x2(1630) I.e. 31 second data, the results obtained are as follows:
x2(1600)=x2(1)^x2(12)^x2(16)^x2(19)^x2(2)^x2(20)^x2(23)^x2(3)^x2(8)
x2(1601)=x2(13)^x2(17)^x2(2)^x2(20)^x2(21)^x2(24)^x2(3)^x2(4)^x2(9)
x2(1602)=x2(10)^x2(14)^x2(18)^x2(21)^x2(22)^x2(25)^x2(3)^x2(4)^x2(5)
……
x2(1615)=x2(0)^x2(1)^x2(10)^x2(16)^x2(17)^x2(18)^x2(2)^x2(23)^x2(27)^x2(8)^x2(9)
……
x2(1630)=x2(0)^x2(10)^x2(11)^x2(12)^x2(13)^x2(14)^x2(15)^x2(16)^x2(17)^x2(2)^x2(23)^x2(24)^x2(25)^x2(3)^x2(5)^x2(7)^x2(8)^x2(9)
calculating x using the initial data1(1600) And x2(1600) Then, it is possible to wait for NCWhen 1600 clock cycles are elapsed, the first data c (0) in the pseudo-random sequence can be output, where c (0) is x1(1600)^x2(1600)。
Respectively convert x into1(1600)~x1(1630) And x2(1600)~x2(1630) And as initial data of the first shift register and the second shift register, obtaining one data of the pseudo-random sequence in each clock cycle, and finally generating the whole pseudo-random sequence C. The flow of outputting the first data c (0) in the pseudo-random sequence to be generated is shown in fig. 5.
The following illustrates the advantage of the computational complexity of the present invention over prior art schemes. In existing schemes, x is calculated1And x2Is when each data inBy recursive means, e.g. computing x1(1000) Then, x needs to be solved recursively1(1000-28) and x1(1000-31) and storing the two data as recursive instances in memory, and calculating x1(1000-28) calculating x1(1000-28X 2) and x1(1000-28-31) and store the two data as recursive instances in memory, and so on, up to x1(1000) Can pass through x1Until the first initial data in (2) is represented. Calculating x1(n) the number of recursion instances to be stored increases with an exponential power of 2 with increasing recursion depth (number of recursions), where the power exponent is
Figure GDA0002943589500000151
Likewise, x is calculated2(1000) Need to calculate x simultaneously2(1000-31)、x2(1000-30)、x2(1000-29) and x2(1000-28), and calculating each of the four data requires calculating the first four data recursively, so calculating x2(1000) The number of recursive instances that need to be stored grows exponentially with 2 as the depth of recursion (number of recursions) increases.
As shown in FIG. 6, for the relationship between the number of recursion instances and the recursion depth when calculating any data in the first subsequence in the prior art, the abscissa is the recursion depth h, and the ordinate is the number of recursion instances W1Then complexity of
Figure GDA0002943589500000152
I.e. the area of the enclosing part (e.g. the hatched part in fig. 6) between the curve of the recursive instance and the axis of abscissa. As can be seen from the formula and fig. 6, the complexity of computing either data grows with the depth of recursion by an exponential power of 2.
As shown in FIG. 7, for the relationship between the number of recursion instances and the recursion depth when calculating any data in the second subsequence in the prior art, the abscissa is the recursion depth h, and the ordinate is the number of recursion instances W2Then complexity of
Figure GDA0002943589500000153
I.e. the area of the enclosing part (e.g. the hatched part in fig. 7) between the curve of the recursive instance and the axis of abscissa. As can be seen from the formula and fig. 7, the complexity of computing either data grows with the recursion depth to an exponential power of 4. This exponential increase in complexity is intolerable in algorithm implementations.
By using the method of the invention, the interval between every two recursions of any data obtained by using the first recursion formula or any data obtained by using the second recursion formula is increased, so that the recursion depth is exponentially and rapidly reduced, and the complexity is approximately linear O (h). As shown in fig. 8, the abscissa is the recursion depth h, the ordinate is the number W of recursion instances, and the complexity is the sum of the areas of several rectangles. E.g. calculating x1(1000) The complexity of the time can be expressed as the number of recursion instances, namely the number of data needing to be stored is 10, and x is calculated similarly2(200) The complexity is 28.
TABLE 1 comparison of computational complexity of the prior art scheme and the present invention
Existing solutions Scheme of the invention
Complexity of O(2h) Or O (4)h) O(h)
x1(1000) 232 10
x2(200) 46 28
Another embodiment of the present invention provides a pseudo random sequence generation apparatus, including: at least one processor; and at least one memory communicatively coupled to the processor, wherein: the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the generation method provided by the above embodiment, for example, the following pseudo random sequence generation method can be executed: s1, respectively acquiring N first initial data and N second initial data; n is an integer greater than 3; s2, calculating N first data based on a first recurrence formula according to the N first initial data, and using the N first data as initial data of a first shift register; s3, calculating N second data based on a second recursion formula according to the N second initial data, and taking the N second data as initial data of a second shift register; s4, generating the pseudo random sequence according to the initial data of the first shift register and the initial data of the second shift register.
The processor may be a Micro-Controller Unit (MCU) and/or a Field-Programmable Gate Array (FPGA). But also other processors that call the program instructions to execute the generation method provided by the above-described embodiments. The present embodiment is not particularly limited herein.
In another embodiment of the present invention, a computer program product is provided, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the generation method provided by the above-described embodiment. For example, the computer-implemented method for generating the pseudo-random sequence includes: s1, respectively acquiring N first initial data and N second initial data; n is an integer greater than 3; s2, calculating N first data based on a first recurrence formula according to the N first initial data, and using the N first data as initial data of a first shift register; s3, calculating N second data based on a second recursion formula according to the N second initial data, and taking the N second data as initial data of a second shift register; s4, generating the pseudo random sequence according to the initial data of the first shift register and the initial data of the second shift register.
In another embodiment of the present invention, a non-transitory computer-readable storage medium is provided, which stores computer instructions that cause the computer to perform the method for generating a pseudo-random sequence provided by the above-described embodiments. The pseudo-random sequence generation method may be: s1, respectively acquiring N first initial data and N second initial data; n is an integer greater than 3; s2, calculating N first data based on a first recurrence formula according to the N first initial data, and using the N first data as initial data of a first shift register; s3, calculating N second data based on a second recursion formula according to the N second initial data, and taking the N second data as initial data of a second shift register; s4, generating the pseudo random sequence according to the initial data of the first shift register and the initial data of the second shift register.
To sum up, an embodiment of the present invention provides a method for generating a pseudorandom sequence, which respectively calculates N first data and N second data according to N first initial data and N second initial data, and respectively uses the N first data and the N second data as initial data of a first shift register and initial data of a second shift register. The first data in the pseudo random sequence may be generated by one clock cycle according to initial data of the first shift register and the second shift register, and one data in the pseudo random sequence is generated every clock cycle, and finally the pseudo random sequence is generated. Only one clock cycle is required to generate the first data in the pseudo-random sequence. The first data of the pseudo-random sequence can be obtained directly according to the N first initial data and the N second initial data through the first shift register and the second shift register after a specified number of clock cycles. In the process of generating the first data of the pseudo-random sequence, iteration is not needed, and the generation can be completed only by one clock cycle, so that the speed of generating the pseudo-random sequence is greatly improved, and the generation time is shortened. Meanwhile, the interval between every two recursions can be increased through the first recursion formula and the second recursion formula, namely the recursion times are reduced, so that the recursion depth is exponentially reduced, the calculation complexity is close to linearity, the speed of generating the pseudo-random sequence is further improved, and the generation time is shortened.
Finally, the method of the present invention is only a preferred embodiment and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. A method for generating a pseudorandom sequence, comprising:
s1, respectively acquiring N first initial data and N second initial data; n is an integer greater than 3;
s2, calculating N first data based on a first recurrence formula according to the N first initial data, and using the N first data as initial data of a first shift register;
s3, calculating N second data based on a second recursion formula according to the N second initial data, and taking the N second data as initial data of a second shift register;
s4, generating the pseudo random sequence according to the initial data of the first shift register and the initial data of the second shift register;
the first recurrence formula is as follows:
Figure FDA0002886739080000011
wherein x is1(n) is said x1The (n +1) th data of (c),
Figure FDA0002886739080000012
represents the largest integer no greater than N/N,
Figure FDA0002886739080000013
means not more than
Figure FDA0002886739080000014
Is the XOR operation sign;
the second recurrence formula is as follows:
Figure FDA0002886739080000015
wherein x is2(n) is said x2The (n +1) th data of (c),
Figure FDA0002886739080000016
represents the largest integer no greater than N/N,
Figure FDA0002886739080000017
means not more than
Figure FDA0002886739080000018
Is the XOR operation sign.
2. The generation method according to claim 1, wherein S2 specifically includes:
and based on a first recursion formula, expressing each first data in the N first data through a plurality of first initial data in the N first initial data, and calculating the N first data.
3. The generation method according to claim 2, wherein the first recurrence formula is iteratively calculated by:
x1(n+N)=[x1(n+3)+x1(n)]mod2
wherein x is1(N + N) is the first subsequence x1N +1 th data, and the x1The first N data x in1(0)~x1And (N-1) is the N first initial data, and N is more than or equal to 0.
4. The generation method according to claim 2, wherein S3 specifically includes:
and based on a second recursion formula, representing each second data in the N second data by a plurality of second initial data in the N second initial data, and calculating the N second data.
5. The generation method according to claim 4, wherein the second recurrence formula is obtained by iterative calculation using the following formula:
x2(n+N)=[x2(n+3)+x2(n+2)+x2(n+1)+x2(n)]mod2
wherein x is2(N + N) is the second subsequence x2N +1 th data, and the x2The first N data x in2(0)~x2And (N-1) is the N second initial data, and N is more than or equal to 0.
6. A pseudo-random sequence generation apparatus, comprising:
at least one processor; and at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, the processor calling the program instructions to perform the generation method of any of claims 1 to 5.
7. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the generation method according to any one of claims 1 to 5.
CN201710657524.1A 2017-08-03 2017-08-03 Method for generating pseudo-random sequence Expired - Fee Related CN109375897B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710657524.1A CN109375897B (en) 2017-08-03 2017-08-03 Method for generating pseudo-random sequence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710657524.1A CN109375897B (en) 2017-08-03 2017-08-03 Method for generating pseudo-random sequence

Publications (2)

Publication Number Publication Date
CN109375897A CN109375897A (en) 2019-02-22
CN109375897B true CN109375897B (en) 2021-03-26

Family

ID=65404094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710657524.1A Expired - Fee Related CN109375897B (en) 2017-08-03 2017-08-03 Method for generating pseudo-random sequence

Country Status (1)

Country Link
CN (1) CN109375897B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112019324B (en) * 2019-05-31 2023-08-01 中国移动通信有限公司研究院 Pseudo-random sequence initial phase generation method and device and communication equipment
CN111694546B (en) * 2020-06-12 2021-07-06 成都海光集成电路设计有限公司 Method and device for generating pseudo-random binary sequence code
CN111813374A (en) * 2020-07-01 2020-10-23 浙江三维利普维网络有限公司 Method and device for generating pseudo-random sequence based on DSP (digital Signal processor), and storage medium
CN115223065B (en) * 2022-07-25 2023-04-07 中国人民解放军陆军航空兵学院 Method for analyzing mobility of aerial outburst ground equipment based on high-precision positioning and multi-disc analysis

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101071455B1 (en) * 2008-12-16 2011-10-10 한국전자통신연구원 Device for gold code generation capable of delaying sequence and operating high speed
JP2011097545A (en) * 2009-11-02 2011-05-12 Lyde:Llc 1/f fluctuation signal generation circuit
CN103812596B (en) * 2012-11-09 2017-07-04 联芯科技有限公司 The generation method and device of pseudo-random sequence
CN105262557B (en) * 2015-09-07 2019-02-01 东南大学 A kind of generation method of pseudo-random sequence in LTE system
CN105656620A (en) * 2016-02-19 2016-06-08 上海果路交通科技有限公司 Pseudorandom sequence generating method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
An improved implementation method of the gold sequence generator;Soo Yun Hwang等;《2008 IEEE International Symposium on Consumer Electronics》;IEEE;20080709;全文 *

Also Published As

Publication number Publication date
CN109375897A (en) 2019-02-22

Similar Documents

Publication Publication Date Title
CN109375897B (en) Method for generating pseudo-random sequence
US20120030548A1 (en) Method and device for implementing cyclic redundancy check codes
Von Maurich et al. Towards side-channel resistant implementations of QC-MDPC McEliece encryption on constrained devices
US8880574B2 (en) State machine and generator for generating a description of a state machine feedback function
CN104158557B (en) Gold sequence method for parameter estimation
CN105262557A (en) Method for generating pseudo-random sequences in LTE (Long Term Evolution) system
Condo et al. Pseudo‐random Gaussian distribution through optimised LFSR permutations
Massolino et al. Optimized and scalable co-processor for McEliece with binary Goppa codes
Michaels Improved RNS-based PRNGs
CN112579045A (en) Method and device for generating pseudorandom sequence and storage medium
RU2577588C1 (en) Method and device for generating scrambling code
US8909510B2 (en) LFSR emulation
EP3817251B1 (en) Data processing method, device, and computer-readable storage medium
CN114553386B (en) Sequence generation method and device and computer readable storage medium
Michaels et al. PRNG sequence combination techniques via Galois extension fields
Ma et al. A pseudo-random sequence generation scheme based on RNS and permutation polynomials
Zhang et al. PN code acquisition using belief propagation with adaptive parity check matrix
CN112764713B (en) Random number generation method and device
TWI387921B (en) A normal distributed random number generator by using the clt and the random number generating method thereof
CN110457008B (en) m sequence generation method, device and storage medium
CN113922913B (en) GOLD scrambling code sequence generation method, system and equipment of LTE system
CN107846272B (en) Device and method for rapidly generating Golden sequence
WO2022022311A1 (en) Method and apparatus for generating pseudo-random sequence, electronic device, and storage medium
RU99672U1 (en) RANDOM NUMBER GENERATOR
KR100564764B1 (en) Finite field polynomial multiplier and Method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210326