ShiftSamples¶
- class baseband_tasks.sampling.ShiftSamples(ih, shift, *, samples_per_frame=None)[source] [edit on github]¶
Bases:
baseband_tasks.base.PaddedTaskBase
Shift channels in a stream by integer numbers of samples.
The shifts are interpreted as additive to the sample times, i.e., positive shifts imply that a stream will appear delayed in time.
Note that no resampling is done; for shifting by non-integer numbers of samples, use
ShiftAndResample
.- Parameters
- ihtask or
baseband
stream reader Input data stream, with time as the first axis.
- shiftint or float array-like, or
Quantity
Amount by which to shift samples along the stream. Normally integer, but can also be float or quantity with units of time, in which case the shifts will be rounded to the nearest integer. Should broadcast to the sample shape. For instance, to shift along the one-but-last axis with length
N
, the shape of shift should be(N, 1)
.- samples_per_frameint
Number of shifted samples which should be produced in one go. The number of input samples used will be larger to avoid wrapping. If not given, as produced by the minimum power of 2 of input samples that yields at least 75% efficiency.
- ihtask or
See also
ShiftAndResample
shift channels by fractional samples and resample
Resample
resample a stream to a new grid, without time shifts
Methods Summary
task
(data)Methods Documentation
- task(data)[source] [edit on github]¶