Home >Common Problem >What is a pseudorandom sequence

What is a pseudorandom sequence

coldplay.xixi
coldplay.xixiOriginal
2020-10-29 09:37:233872browse

Pseudo-random sequence is a certain sequence with certain random characteristics. They are deterministic sequences generated by shift registers, yet they are random sequences with some random characteristics. Because it also has random characteristics, it is impossible to judge whether a generated sequence is a true random sequence or a pseudo-random sequence from the characteristics of the sequence. It can only be judged based on the method of generating the sequence.

What is a pseudorandom sequence

If a sequence, on the one hand, it can be predetermined and can be produced and copied repeatedly; on the other hand, it has some kind of random sequence Random characteristics (ie statistical characteristics), we call this sequence pseudo-random sequence.

Pseudo-random sequence is a certain sequence with certain random characteristics. They are deterministic sequences generated by shift registers, yet they are random sequences with some random characteristics. Because it also has random characteristics, it is impossible to judge whether a generated sequence is a true random sequence or a pseudo-random sequence from the characteristics of the sequence. It can only be judged based on the method of generating the sequence. The pseudo-random sequence series has good randomness and a correlation function close to white noise, and has pre-determinability and repeatability. These characteristics make pseudo-random sequences widely used, especially in CDMA systems as spreading codes, which have become a key issue in CDMA technology. The characteristic is that the number of occurrences of the two elements in the sequence is approximately equal.

If n elements appearing continuously are called an element run of length n, then the run of elements of length n in the sequence is twice as long as the run of elements of length n 1.

There is a certain relationship between sequence elements, but it has properties similar to random sequences. It can be expressed as

…, ɑ-1, ɑ0, ɑ1, ɑ2 ,...

where ɑi can take the value 0, 1 or 1, -1; it can also take the elements in the symbolic field GF(q) (see block code). The former is called a binary sequence, and the latter is called a q-ary sequence. But the most important thing in practice is the former. The sequence length can be finite or infinite. The latter mainly focuses on periodic sequences, that is, there is a minimum positive integer so that ɑp = ɑp i for all i, and p is the period.

When each element of the sequence is a random variable that is independent of each other and has the same distribution, it is called a random sequence. The main practical applications are pseudo-random columns. It refers to the existence of a definite relationship between sequence elements, but has the following properties similar to random sequences: ① The number of elements does not differ by more than 1 within a limited length or a period, that is, it is close to equal probability; ② The occurrence of l identical values ​​or is called The probability of l long run is close to 1/ql; ③The correlation function

is p when τ=0, and does not exceed ±1 when τ0, where p is the length or period of the sequence. In fact, sequences that generally meet the above conditions are sometimes also called pseudo-random sequences.

import numpy as np
import matplotlib.pyplot as plt
#用来正常显示中文标签
#plt.rcParams['font.family'] = ['Simhei']
plt.rcParams['font.sans-serif'] = ['Yahei consolas hybrid']
#用来正常显示负号
plt.rcParams['axes.unicode_minus']=False
# 
A = 6
N = 200
x0 = 1
M = 255
v = np.zeros([N,1])
#print(v)
x= np.arange(N)
for k in np.arange(N):
    x2 = A*x0
    x1 = x2 % M
    v1 = x1/256
    v[k] = 2*(v1 - 0.5)
    x0 = x1
#print(v.reshape(7,16))
plt.plot(x,v)
plt.xlabel('k')
plt.ylabel('v')
plt.title('伪随机序列')
plt.show()

Related free recommendations: Programming video course

The above is the detailed content of What is a pseudorandom sequence. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Related articles

See more