Signal generation
Generate signal functions for system excitation.
dynax.aprbs(key, length, num_jumps, initial_value=None)
Generate an amplitude-modulated pseudo-random binary sequence (APRBS).
The output sequence contains numbers from [0, 1).
PARAMETER | DESCRIPTION |
---|---|
key
|
JAX PRNGKey.
TYPE:
|
length
|
Number of samples in the sequence.
TYPE:
|
num_jumps
|
Number of jumps in the sequence.
TYPE:
|
initial_value
|
The inital value of the sequence. If None, it is chosen randomly.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If the number of jumps exceeds the number
of possible jumping points ( |
RETURNS | DESCRIPTION |
---|---|
Array
|
Array with shape |
dynax.smooth_noise(key, length, sigma, start_at_zero=False)
Generate smooth noise.
Produces a smoothly varying signal with unit variance by convonvling a Gaussian kernel with white noise.
PARAMETER | DESCRIPTION |
---|---|
key
|
JAX PRNGKey.
TYPE:
|
length
|
Number of samples in the sequence.
TYPE:
|
sigma
|
Standard deviation of the Gaussian kernel. Larger values produce smoother outputs.
TYPE:
|
start_at_zero
|
If true starts the sequence at zero. Otherwise it starts with a random normaly distributed value. Defaults to False.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Array
|
Array with shape |
dynax.bandlimited_noise(key, length, max_freq=20, dt=None, normalize=True)
Generate 1D band-limited random noise using Fourier synthesis.
Note
The signal is periodic due to the Fourier-based construction.
PARAMETER | DESCRIPTION |
---|---|
key
|
JAX PRNGKey.
TYPE:
|
length
|
Number of points
TYPE:
|
max_freq
|
Cutoff frequency (max Fourier mode kept)
TYPE:
|
dt
|
Time increment between samples. If none provided, uses
TYPE:
|
normalize
|
If true, normalizes the signal to zero mean and unit variance.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Array
|
Smooth noise of length N |