aspen.sounds.colored_noise¶
Colored noise
Functions
|
Generate colored noise. |
Classes
|
Generate colored noise. |
-
class
aspen.sounds.colored_noise.ColoredNoise(colored_noise_duration=[1000], colored_noise_color=['white'], colored_noise_num_signals=1, samp_freq=16000)[source]¶ Bases:
aspen.interfaces.abs_common_interface.AbsCommonInterface,aspen.interfaces.abs_sound_interface.AbsSoundInterfaceGenerate colored noise. Colored noise is generated according to the following table.
Color
Power/octave
Power density/octave
Inverse value of frequency scaling
White
+3 dB
0 dB
0
Pink
0 dB
-3 dB
1 (i.e. 1 / f)
Blue
+6 dB
+3 dB
-1 (i.e. f)
Brown
-3 dB
-6 dB
2 (i.e. 1 / f^2)
Violet
+9 dB
+6 dB
-2 (i.e. f^2)
- Parameters
colored_noise_duration¶ (
Sequence[float]) – The duration of colored noise in millisecond. Defaults to [1000].colored_noise_color¶ (
Sequence[str]) – The type of colored noise. The choices are white, pink, blue, brown and violet. Defaults to [“white”].colored_noise_num_signals¶ (
int) – Number of signals. If this value greater than 2, the other arguments should contain 2 types. Defaults to 1.
-
__call__()¶ Generate a specified number of signals.
-
aspen.sounds.colored_noise.colored_noise(duration=[1000], color=['white'], num_signals=1, samp_freq=16000)[source]¶ Generate colored noise. Colored noise is generated according to the following table.
Color
Power/octave
Power density/octave
Inverse value of frequency scaling
White
+3 dB
0 dB
0
Pink
0 dB
-3 dB
1 (i.e. 1 / f)
Blue
+6 dB
+3 dB
-1 (i.e. f)
Brown
-3 dB
-6 dB
2 (i.e. 1 / f^2)
Violet
+9 dB
+6 dB
-2 (i.e. f^2)
- Parameters
duration¶ (
Sequence[float]) – The duration of colored noise in millisecond. Defaults to [1000].color¶ (
Sequence[str]) – The type of colored noise. The choices are white, pink, blue, brown and violet. Defaults to [“white”].num_signals¶ (
int) – Number of signals. If this value greater than 2, the other arguments should contain 2 types. Defaults to 1.
- Return type
- Returns
Output signals.