Pseudorandom binary sequence
p = prbs(O,N)
[PRBS,seed] = prbs(O,N)
[PRBS,seed] = prbs(O,N,seed)
example
p = prbs(O,N) calculates a pseudorandom binary sequence P of order O and length N.
p
O
N
P
[PRBS,seed] = prbs(O,N) calculates a pseudorandom binary sequence and the seed needed to continue the sequence.
PRBS
seed
[PRBS,seed] = prbs(O,N,seed) calculates a pseudorandom binary sequence and the seed needed to continue the sequence using the seed value.
collapse all
Create a vector using a pseudorandom binary sequence (PRBS) pattern of the order 4.
O = 4; N = 2^O-1; pattern1 = prbs(O,N);
Create another vector, this time using a PRBS pattern of order 4 one bit at a time.
pattern2 = zeros(1,N); [pattern2(1),seed] = prbs(O,1); for ii = 2:N [pattern2(ii),seed] = prbs(O,1,seed); end
Verify that both patterns are the same.
disp(isequal(pattern1,pattern2))
1
Order of the pseudorandom binary sequence pattern, specified as a positive integer scalar.
Data Types: double
double
Length of the pseudorandom binary sequence pattern, specified as a positive integer scalar.
Pseudorandom binary sequence pattern of order O and length N, returned as a vector.
Seed value of the pseudorandom binary sequence pattern, returned as a vector. seed is used in subsequent calls to continue the PRBS pattern.
pulse2wave | wave2pulse
pulse2wave
wave2pulse
You have a modified version of this example. Do you want to open this example with your edits?