modelPRBS
Extends from Modelica.Blocks.Interfaces.SO (Single Output continuous control block).
Information
Predefined generator values that give the max length sequence are taken from: https://en.wikipedia.org/wiki/Linear-feedback_shift_register#Some_polynomials_for_maximal_LFSRs
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | amplitude | 1 | Amplitude of signal |
| SI.Frequency | freqHz | Frequency of signal | |
| Real | offset | 0 | Offset of output signal |
| SI.Time | startTime | 0 | Output = offset for time < startTime |
| Real[integer(2^nBits - 1)] | mls | TRANSFORM.Math.max_len_seq(seed, generator, bias) | |
| Sequence | |||
| Real | bias | 0 | Bias from nominal middle value of signal |
| Integer | nBits | 3 | Sequence bit length |
| Integer[nBits] | seed | cat(1, {1}, fill(0, nBits - 2), {1}) | Seed sequence array of 1 and 0, size(seed) = nBits |
| Integer[nBits + 1] | generator | if nBits == 2 then {1, 1, 1} elseif nBits == 3 then {1, 1, 0, 1} elseif nBits == 4 then {1, 1, 0, 0, 1} elseif nBits == 5 then {1, 0, 1, 0, 0, 1} elseif nBits == 6 then {1, 1, 0, 0, 0, 0, 1} elseif nBits == 7 then {1, 1, 0, 0, 0, 0, 0, 1} elseif nBits == 8 then {1, 0, 1, 1, 1, 0, 0, 0, 1} elseif nBits == 9 then {1, 0, 0, 0, 1, 0, 0, 0, 0, 1} elseif nBits == 10 then {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1} elseif nBits == 11 then {1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1} elseif nBits == 12 then {1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1} elseif nBits == 13 then {1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1} elseif nBits == 14 then {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1} elseif nBits == 15 then {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1} else fill(0, nBits + 1) | Generator for sequence. size(generator) = nBits+1 |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| RealOutput | y (from SO) | Connector of Real output signal |