aspen.sounds.fm_tone¶
Frequency-modulated (FM) tone
Functions
|
Generate frequency modulated tone. |
Classes
|
Generate frequency modulated tone. |
-
class
aspen.sounds.fm_tone.
FmTone
(fm_tone_duration=[1000], fm_tone_freq=[440], fm_tone_method=['sin'], fm_tone_modulation_freq=[2], fm_tone_freq_excursion=[25], fm_tone_num_signals=1, samp_freq=16000)[source]¶ Bases:
aspen.interfaces.abs_common_interface.AbsCommonInterface
,aspen.interfaces.abs_sound_interface.AbsSoundInterface
Generate frequency modulated tone.
- Parameters
fm_tone_duration¶ (
Sequence
[float
]) – The duration of am tone in millisecond. Defaults to [1000].fm_tone_freq¶ (
Sequence
[float
]) – The frequency of the carrier in Hz. Defaults to [440].fm_tone_method¶ (
Sequence
[str
]) – The type of frequency sweep. The choices are sin, upward, downward, updown or downup. Defaults to [“sin”].fm_tone_modulation_freq¶ (
Sequence
[float
]) – The frequency of the modulation. Defaults to [2].fm_tone_freq_excursion¶ (
Sequence
[float
]) – The frequency excusion of modulator in Hz. Defaults to [25].fm_tone_num_signals¶ (
int
) – The number of signals. If this value greater than 2, the other arguments should contain 2 types. Defaults to 1.
Todo
- Other chirp method (e.g. logarithmic).
Ref: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.chirp.html
- A rectangular approximation of the integral of the instantaneous frequency formula.
Ref: https://www.mathworks.com/help/signal/ref/modulate.html
- Randomly changed phase for fm-sin (refer the frequency modulation detection limens).
-
__call__
()¶ Generate a specified number of signals.
-
aspen.sounds.fm_tone.
fm_tone
(duration=[1000], freq=[440], method=['sin'], modulation_freq=[2], freq_excursion=[25], num_signals=1, samp_freq=16000)[source]¶ Generate frequency modulated tone.
- Parameters
duration¶ (
Sequence
[float
]) – The duration of am tone in millisecond. Defaults to [1000].freq¶ (
Sequence
[float
]) – The frequency of the carrier in Hz. Defaults to [440].method¶ (
Sequence
[str
]) – The type of frequency sweep. The choices are sin, linear, updown or downup. Defaults to [“sin”].modulation_freq¶ (
Sequence
[float
]) – The frequency of the modulation. Defaults to [2].freq_excursion¶ (
Sequence
[float
]) – The frequency excusion of modulator in Hz. Defaults to [25].num_signals¶ (
int
) – The number of signals. If this value greater than 2, the other arguments should contain 2 types. Defaults to 1.
- Return type
- Returns
Output signals.