pulsarbat.snippet#

pulsarbat.snippet(z, /, t, n)[source]#

Extracts a snippet of a signal in time.

If t corresponds to non-integer number of samples from the start of z, time-shifting via FFT (by applying a phase gradient in the Fourier domain) is used. This usually only makes sense if z is a BasebandSignal. For non-baseband signals, the output might not be meaningful.

Parameters:
zSignal

Input signal.

tint, float, Quantity, or Time

Start location of snippet. Given as either a number of samples (int or float) or a Quantity (units of time) relative to the start of the signal, or a Time object specifying the start time of the snippet.

nint

Length of snippet in number of samples. Must be an integer.

Returns:
Signal

Snippet of z starting at t with length n.

Notes

Since an FFT is used, it is efficient to provide a signal with a fast FFT length via pulsarbat.fast_len().