The prbs Reference Manual

This is the prbs Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 19:13:55 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 prbs

A library of higher-order functions for generating Pseudo-Random Binary Sequences of (practically) any degree

Author

Jason Lowdermilk <>

License

MIT

Version

0.1.0

Source

prbs.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 prbs/src

Source

prbs.asd.

Parent Component

prbs (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 prbs/prbs.asd

Source

prbs.asd.

Parent Component

prbs (system).

ASDF Systems

prbs.


4.1.2 prbs/src/taps.lisp

Source

prbs.asd.

Parent Component

src (module).

Packages

prbs.taps.

Public Interface

taps (function).

Internals

4.1.3 prbs/src/util.lisp

Source

prbs.asd.

Parent Component

src (module).

Packages

prbs.util.

Public Interface

4.1.4 prbs/src/prbs.lisp

Source

prbs.asd.

Parent Component

src (module).

Packages

prbs.

Public Interface
Internals

prbs-n (function).


4.1.5 prbs/src/err.lisp

Source

prbs.asd.

Parent Component

src (module).

Packages

prbs.err.

Public Interface
Internals

make-tracker (function).


5 Packages

Packages are listed by definition order.


5.1 prbs

Source

prbs.lisp.

Use List
Used By List

prbs.err.

Public Interface
Internals

prbs-n (function).


5.2 prbs.util

Source

util.lisp.

Use List

common-lisp.

Used By List
Public Interface

5.3 prbs.err

Source

err.lisp.

Use List
Public Interface
Internals

make-tracker (function).


5.4 prbs.taps

Source

taps.lisp.

Use List

common-lisp.

Used By List

prbs.

Public Interface

taps (function).

Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Ordinary functions

Function: bit-gen (n &key seed start)

=> lambda (x)

Create a closure representing PRBS-‘N‘. The lambda takes a single argument which is the number of the next bits to generate from the sequence (default 1 bit). The bits will be returned as a bitvector. ‘SEED‘ can be provided as the integer value of the initial vector. If ‘START‘ is provided, the generator will be initialized to that bit offset.

Package

prbs.

Source

prbs.lisp.

Function: bitbv (n)

Turn a 1 or 0 into a single-bit bitvector.

Package

prbs.util.

Source

util.lisp.

Function: bv->num (b &optional m a)

Convert a bitvector into an integer.

Package

prbs.util.

Source

util.lisp.

Function: bvlist-gen (n &key seed)

=> lambda (x)

Create a closure representing PRBS-‘N‘. The lambda takes a single argument which is the number of the next ‘N‘-bit bitvectors to generate from the sequence (default 1 value), which will be returned in a list. ‘SEED‘ can be provided as the integer value of the initial vector.

Package

prbs.

Source

prbs.lisp.

Function: byte-gen (n &key seed)

=> lambda (x)

Create a closure representing PRBS-‘N‘. The lambda takes a single argument which is the number of the next byte values to generate from the sequence (default 1 byte), which will be returned as a simple array of type (unsigned-byte 8). ‘SEED‘ can be provided as the integer value of the initial vector.

Package

prbs.

Source

prbs.lisp.

Function: bytes->bits (b)

Convert a list of integer values into a single bytevector.

Package

prbs.util.

Source

util.lisp.

Function: make-prbs (n &key seed)

=> lambda ()

Create a closure representing PRBS-‘N‘. Each call to the lambda will return the next bitvector of length ‘N‘ in the prbs-‘N‘ sequence. ‘SEED‘ can be provided as the integer value of the initial vector.

Package

prbs.

Source

prbs.lisp.

Function: num->bv (val &optional size)

Convert an integer into a bitvector. Specify ‘SIZE‘ if you want something other than 8 bits per value.

Package

prbs.util.

Source

util.lisp.

Function: num-gen (n &key seed)

=> lambda (x)

Create a closure representing PRBS-‘N‘. The lambda takes a single argument which is the number of the next integer values to generate from the sequence (default 1 value), which will be returned in a list. ‘SEED‘ can be provided as the integer value of the initial vector.

Package

prbs.

Source

prbs.lisp.

Function: prbs-detect (p &key max)

Attempt to identify which PRBS sequences the bitvector ‘P‘ belongs to. Return a list of all candidate polynomial degrees (up to ‘MAX‘) that can generate ‘P‘.

Package

prbs.err.

Source

err.lisp.

Function: prbs-lock (p n &optional rem)

=> lambda (x)

Attempt to lock on a PRBS-‘N‘ sequence using the bitvector ‘P‘. If successful, return a lambda that tracks bit errors for subsequent data in the sequence, or nil if unable to lock. The lambda can be repeatedly called with a bitvector containing subsequent data, and it will return the total number of bit errors detected and the total number of bits it has seen.

Package

prbs.err.

Source

err.lisp.

Function: seq-length (n)

return the number of bits in PRBS-‘N‘

Package

prbs.

Source

prbs.lisp.

Function: sfind (p n)

=> bit offset where ‘P‘ occurs in PRBS-‘N‘, or nil if not found

Brute-force search a PRBS-‘N‘ sequence for an arbitrary bit pattern.

Package

prbs.err.

Source

err.lisp.

Function: sfind-all (p n)

=> list of all bit offsets where ‘P‘ occurs in PRBS-‘N‘

Brute-force search a PRBS-‘N‘ sequence for all matches of an arbitrary bit pattern.

Package

prbs.err.

Source

err.lisp.

Function: take (n gen)

=> ‘N‘ values from ‘GEN‘

‘GEN‘ can be a lambda returned from any of the *-gen functions.

Package

prbs.

Source

prbs.lisp.

Function: taps (n)

return a list of register taps (counting from the left) for a polynomial of order n, favoring LFSR-4 taps over LFSR-2.

Package

prbs.taps.

Source

taps.lisp.


6.2 Internals


6.2.1 Special variables

Special Variable: *lfsr2*
Package

prbs.taps.

Source

taps.lisp.

Special Variable: *lfsr4*
Package

prbs.taps.

Source

taps.lisp.


6.2.2 Ordinary functions

Function: make-tracker (gen total-bits &optional error-bits)
Package

prbs.err.

Source

err.lisp.

Function: prbs-n (bv taps &optional len)

=> bit-vector

left-shift ‘BV‘ by one bit and apply ‘TAPS‘ to generate a new right-side bit.

Package

prbs.

Source

prbs.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   B   F   M   N   P   S   T  
Index Entry  Section

B
bit-gen: Public ordinary functions
bitbv: Public ordinary functions
bv->num: Public ordinary functions
bvlist-gen: Public ordinary functions
byte-gen: Public ordinary functions
bytes->bits: Public ordinary functions

F
Function, bit-gen: Public ordinary functions
Function, bitbv: Public ordinary functions
Function, bv->num: Public ordinary functions
Function, bvlist-gen: Public ordinary functions
Function, byte-gen: Public ordinary functions
Function, bytes->bits: Public ordinary functions
Function, make-prbs: Public ordinary functions
Function, make-tracker: Private ordinary functions
Function, num->bv: Public ordinary functions
Function, num-gen: Public ordinary functions
Function, prbs-detect: Public ordinary functions
Function, prbs-lock: Public ordinary functions
Function, prbs-n: Private ordinary functions
Function, seq-length: Public ordinary functions
Function, sfind: Public ordinary functions
Function, sfind-all: Public ordinary functions
Function, take: Public ordinary functions
Function, taps: Public ordinary functions

M
make-prbs: Public ordinary functions
make-tracker: Private ordinary functions

N
num->bv: Public ordinary functions
num-gen: Public ordinary functions

P
prbs-detect: Public ordinary functions
prbs-lock: Public ordinary functions
prbs-n: Private ordinary functions

S
seq-length: Public ordinary functions
sfind: Public ordinary functions
sfind-all: Public ordinary functions

T
take: Public ordinary functions
taps: Public ordinary functions