pyrex.Signal¶
-
class
pyrex.Signal(times, values, value_type=None)¶ Base class for time-domain signals.
Stores the time-domain information for signal values. Supports adding between signals with the same times array and value type.
- Parameters
- timesarray_like
1D array of times (s) for which the signal is defined.
- valuesarray_like
1D array of values of the signal corresponding to the given times. Will be resized to the size of times by zero-padding or truncating as necessary.
- value_typeoptional
Type of signal, representing the units of the values. Values should be from the
Signal.Typeenum, but integer or string values may work if carefully chosen.Signal.Type.undefinedby default.
- Attributes
- times, valuesndarray
1D arrays of times (s) and corresponding values which define the signal.
value_typeSignal.TypeType of signal, representing the units of the values.
TypeEnumEnum containing possible types (units) for signal values.
dtThe time spacing of the times array, or
Noneif invalid.frequenciesThe FFT frequencies of the signal.
spectrumThe FFT complex spectrum values of the signal.
envelopeThe envelope of the signal by Hilbert transform.
Methods
Type(value)Enum containing possible types (units) for signal values.
copy()Get a copy of the
Signalobject.filter_frequencies(freq_response[, force_real])Apply the given frequency response function to the signal, in-place.
resample(n)Resamples the signal into n points in the same time range, in-place.
shift(dt)Shifts the signal values in time by
dt.with_times(new_times)Returns a representation of this signal over a different times array.
