Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

need MATLAB m-file on Generate pseudo-random binary sequence

Status
Not open for further replies.

zahedi79

Member level 1
Joined
Nov 1, 2005
Messages
39
Helped
20
Reputation
40
Reaction score
17
Trophy points
1,288
Activity points
1,476
prbs generator matlab

mlbs

Generate maximum length binary sequence (pseudo-random binary sequence).

Syntax

bitseries = mlbs(log2N)
[bitseries,nextstnum] = mlbs(log2N,bitno,startnum)

*******

Is there a Pseudo-Random Binary Sequence (PRBS) generator in MATLAB?

There is a PRBS generating M-file in the new Frequency Domain System Identification Toolbox, for lengths 2^2-1 to 2^30-1. Its name is mlbs (for Maximum Length Binary Sequence). Also, the idinput function in the System Identification Toolbox (version 4.0) contains a PRBS generator.
 

mlbs matlab

This is the Linear Feedback shift register implemented directly out of Skolnik's Intro to Radar Systems

clear

%Bit length of the shiftRegister
shiftRegLength = 7;

%Start value of the shiftReg
shiftReg = round(rand(1,shiftRegLength));

%Generate output

%Note that this only has length 2^n-1 before it starts repeating
for i = 1:2^shiftRegLength-1

%Pull the output of the register (the last bit)
outputSeq(i)= shiftReg(shiftRegLength);

%Feedback (modulo 2) as implemented on pg 351 of Skolnik
c = xor(shiftReg(shiftRegLength),shiftReg(shiftRegLength-1));

%Insert that value in the beginning and shift the rest to the right
shiftReg = [c shiftReg(1:shiftRegLength-1)];
end

%Check to see how uncorrelated the output is.
plot(xcorr(outputSeq,outputSeq))
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top