Noise
struct WhiteNoise¶
Generate white noise samples.
Traits: AnyType, Copyable, Movable, UnknownDestructibility
WhiteNoise Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| num_chans | Int |
1 |
Number of SIMD channels. |
WhiteNoise Functions¶
struct WhiteNoise . fn init¶
Initialize the WhiteNoise struct.
fn init Signature
fn init Returns
: Self
Static Method
This is a static method.
struct WhiteNoise . fn next¶
Generate the next white noise sample.
fn next Signature
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| gain | SIMD |
1 |
Amplitude scaling factor. |
fn next Returns
: SIMD
A random value between -gain and gain.
struct PinkNoise¶
Generate pink noise samples.
Uses the Voss-McCartney algorithm.
Traits: AnyType, Copyable, Movable, UnknownDestructibility
PinkNoise Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| num_chans | Int |
1 |
Number of SIMD channels. |
PinkNoise Functions¶
struct PinkNoise . fn init¶
Initialize the PinkNoise struct.
fn init Signature
fn init Returns
: Self
Static Method
This is a static method.
struct PinkNoise . fn next¶
Generate the next pink noise sample.
fn next Signature
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| gain | SIMD |
1 |
Amplitude scaling factor. |
fn next Returns
: SIMD
The next pink noise sample scaled by gain.
struct BrownNoise¶
Generate brown noise samples.
Traits: AnyType, Copyable, Movable, UnknownDestructibility
BrownNoise Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| num_chans | Int |
1 |
Number of SIMD channels. |
BrownNoise Functions¶
struct BrownNoise . fn init¶
Initialize the BrownNoise struct.
fn init Signature
fn init Returns
: Self
Static Method
This is a static method.
struct BrownNoise . fn next¶
Generate the next brown noise sample.
fn next Signature
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| gain | SIMD |
1 |
Amplitude scaling factor. |
fn next Returns
: SIMD
The next brown noise sample scaled by gain.
struct TExpRand¶
Generate exponentially distributed random value upon receiving a trigger.
Traits: AnyType, Copyable, Movable, UnknownDestructibility
TExpRand Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| num_chans | Int |
1 |
Number of SIMD channels. |
TExpRand Functions¶
struct TExpRand . fn init¶
Initialize the TExpRand struct.
fn init Signature
fn init Returns
: Self
Static Method
This is a static method.
struct TExpRand . fn next¶
Output the exponentially distributed random value. The value is repeated until a new trigger is received, at which point a new value is generated. And that new value is repeated until the next trigger, and so on.
fn next Signature
next(mut self, min: SIMD[DType.float64, num_chans], max: SIMD[DType.float64, num_chans], trig: SIMD[DType.bool, num_chans]) -> SIMD[DType.float64, num_chans]
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| min | SIMD |
— | Minimum value for the random value. |
| max | SIMD |
— | Maximum value for the random value. |
| trig | SIMD |
— | Trigger to generate a new value. |
fn next Returns
: SIMD
The exponentially distributed random value.
struct TRand¶
Generate uniformly distributed random value upon receiving a trigger.
Traits: AnyType, Copyable, Movable, UnknownDestructibility
TRand Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| num_chans | Int |
1 |
Number of SIMD channels. |
TRand Functions¶
struct TRand . fn init¶
Initialize the TRand struct.
fn init Signature
fn init Returns
: Self
Static Method
This is a static method.
struct TRand . fn next¶
Output uniformly distributed random value. The value is repeated until a new trigger is received, at which point a new value is generated. And that new value is repeated until the next trigger, and so on.
fn next Signature
next(mut self, min: SIMD[DType.float64, num_chans], max: SIMD[DType.float64, num_chans], trig: SIMD[DType.bool, num_chans]) -> SIMD[DType.float64, num_chans]
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| min | SIMD |
— | Minimum value for the random value. |
| max | SIMD |
— | Maximum value for the random value. |
| trig | SIMD |
— | Trigger to generate a new value. |
fn next Returns
: SIMD
The uniformly distributed random value.
Documentation generated with mojo doc from Mojo version 0.25.6.1