PaddedTaskBase

class baseband_tasks.base.PaddedTaskBase(ih, pad_start=0, pad_end=0, *, samples_per_frame=None, next_fast_len=None, **kwargs)[source] [edit on github]

Bases: TaskBase

Base for tasks which need more points than they produce.

Like TaskBase, subclasses should define:

task(self, data) : return processed data from one frame.

Where data will contain extra padding. The task method has to ensure the right selection is returned, and can use the _pad_start and _pad_end attributes for this purpose.

Parameters:
ihstream handle

Handle of a stream reader or another task.

pad_start, pad_endint

Padding to apply at the start and end. Default: 0.

samples_per_frameint, optional

Number of output samples which should be produced in each frame. The number of input samples will be larger by the padding. If not given, the minimum length that gives at least 75% efficiency.

next_fast_lencallable, optional

Routine that helps ensure efficient calculation. It should take a possible input number of samples and return a number that is larger or equal and allows for efficient calculation. If larger, samples_per_frame is adjusted accordingly. Typically, tasks pass in fft_maker.get().next_fast_len. Default: None, i.e., do not adjust the number of samples.

**kwargs

Possible further arguments; see BaseTaskBase.