signal_design.signal
Module Contents
Classes
Class describing some kind of signal. |
Functions
|
|
|
|
|
|
|
Attributes
Instance of Signal. |
|
Instance of Signal or Spectrum or |
|
Instance of Signal or |
|
Instance of Signal or Spectrum or |
- signal_design.signal.S
Instance of Signal.
- signal_design.signal.SSPR
Instance of Signal or Spectrum or
signal_design.relation.Relation.
- signal_design.signal.SRN
Instance of Signal or
signal_design.relation.Relationor Number.
- signal_design.signal.SSPRN
Instance of Signal or Spectrum or
signal_design.relation.Relationor Number.
- signal_design.signal.input2signal_operation(func: Callable[[S, SRN], S]) Callable[[S, SSPRN], S][source]
- signal_design.signal.input2signal(func: Callable[[Type[S], Signal, Signal], S]) Callable[[Type[S], SSPR, SSPR], Signal][source]
- class signal_design.signal.Signal(time: Union[signal_design.core.RelationProtocol, signal_design.axis.Axis, signal_design.help_types.ArrayLike], amplitude: Optional[signal_design.help_types.ArrayLike] = None, spectrum: Optional[Signal.__init__.spectrum] = None)[source]
Bases:
signal_design.relation.RelationClass describing some kind of signal.
The Signal class inherits the
signal_design.relation.Relationclass.Each signal can be converted into a
signal_design.spectrum.Spectrumusing method get_spectrum. To convert the signal into a spectrum, the method defined in the default_functions module is used (default_functions.signal2spectrum). Current method can be overridden by own.When performing arithmetic operations on instances of the spectrum.Spectrum class, an instance of the Signal class will be extracted from the
signal_design.spectrum.Spectruminstance, and arithmetic operations will be performed on this instance. An instance ofsignal_design.relation.Relationclass will be converted into the instance of Signal class.Initialization of instance of Signal.
- Parameters:
time (Union[RelationProtocol, Axis, ArrayLike]) – An instance of Relation class or inherited from it, or ArrayLike, or array_like object containing numbers real.
amplitude (ArrayLike, optional) – None or array_like object containing numbers (real or complex). Defaults to None.
- property time: signal_design.axis.Axis
Time array axis.
Equal to property x.
- Returns:
time array axis.
- Return type:
- property amplitude: numpy.ndarray
Amplitude array.
Equal to property ‘y’
- Returns:
amplitude array.
- Return type:
np.ndarray
- get_spectrum(frequency: Optional[Union[signal_design.axis.Axis, int]] = None, is_start_zero=False, is_real_value_transform=True) signal_design.spectrum.Spectrum[source]
Get spectrum from signal.
- Parameters:
frequency (Axis, int, optional) – Define frequency to calculate
None. (spectrum. Defaults to) –
is_start_zero (bool, optional) – If True then the signal will be shifted to zero. Defaults to False.
- Returns:
instance of
signal_design.spectrum.Spectrumdescribed this Signal.- Return type:
- get_amplitude_spectrum(frequency: Optional[Union[signal_design.axis.Axis, int]] = None, is_start_zero=False) signal_design.relation.Relation[source]
Extract amplitude spectrum from
signal_design.spectrum.Spectrum.Method get_spectrum is used to get instance of
signal_design.spectrum.Spectrum. The amplitude spectrum is calculated from it using get_amp_spectrum method.
- get_phase_spectrum(frequency: Optional[Union[signal_design.axis.Axis, int]] = None, is_start_zero=False) signal_design.relation.Relation[source]
Extract amplitude spectrum from
signal_design.spectrum.Spectrum.Method get_spectrum is used to get instance of
signal_design.spectrum.Spectrum. The amplitude spectrum is calculated from it using get_amp_spectrum method.
- shift(x_shift: signal_design.help_types.RealNumber = 0) S[source]
Shifting of signal.
Shift signal using Fourier transform.
- Parameters:
x_shift – shift distance.
- Returns:
shifted signal.
- Return type:
- get_reverse_signal(percent: Union[float, int] = 5.0, subtract_phase: bool = True, frequency_start: Optional[float] = None, frequency_end: Optional[float] = None) S[source]
Calculate reversed signal.
- Parameters:
self (S) – instance of Signal.
percent (Union[float, int], optional) – level of added white noise in percent. Defaults to 5.0.
subtract_phase (bool, optional) – If True performs phase subtraction, If False succeeds, add the phase. Defaults to True.
frequency_start (float, optional) – The start frequency. Defaults to None.
frequency_end (float, optional) – The end frequency. Defaults to None.
- Returns:
instance of Signal.
- Return type:
S
- add_phase(other: SSPR) S[source]
Add phase to signal.
- Parameters:
self (S) – instance of Signal.
other (SSPR) – Extracting the
signal_design.spectrum.Spectrumfrom the object and adding the phasesignal_design.spectrum.Spectrumto the Signal.
- Returns:
new instance of Signal.
- Return type:
S
- sub_phase(other: SSPR) S[source]
Subtract phase from signal.
- Parameters:
self (S) – instance of Signal
other (SSPR) – Extracting the spectrum from the object and subtract the phase spectrum from the signal.
- Returns:
new instance of Signal.
- Return type:
S
- static get_time_from_frequency(frequency: signal_design.axis.Axis, size: Optional[int] = None, time_start: Optional[float] = None) signal_design.axis.Axis[source]
Get time axis from frequency axis and desired size of time axis.
Method for getting a time axis using frequency axis and desired size. Also setting with desired time start.
- classmethod convolve(s1: S, s2: S) S[source]
Convolution of two instances of
signal_design.relation.Relationand return new instance of Signal. Instances ofsignal_design.spectrum.Spectrumwill be converted to Signal- Parameters:
cls (Type[S]) – Signal class.
r1 (SSPR) – instance of
signal_design.relation.Relationor subclass of Relationr2 (SSPR) – instance of
signal_design.relation.Relationor subclass of Relation
- Returns:
new instance of Signal.
- Return type:
S
- classmethod correlate(r1: S, r2: S) S[source]
Correlation of two instances of
signal_design.relation.Relationand return new instance of Signal. Instance ofsignal_design.spectrum.Spectrumwill be converted to Signal- Parameters:
cls (Type[S]) – Signal class.
r1 (SSPR) – instance of
signal_design.relation.Relationor subclass of Relationr2 (SSPR) – instance of
signal_design.relation.Relationor subclass of Relation
- Returns:
new instance of Signal.
- Return type:
S