def setup(self, bins, repeats, base_buffer_size=<NUM_LIT:0>, max_buffer_size=<NUM_LIT:0>, fft_window='<STR_LIT>',<EOL>fft_overlap=<NUM_LIT:0.5>, crop_factor=<NUM_LIT:0>, log_scale=True, remove_dc=False, detrend=None,<EOL>lnb_lo=<NUM_LIT:0>, tune_delay=<NUM_LIT:0>, reset_stream=False, max_threads=<NUM_LIT:0>, max_queue_size=<NUM_LIT:0>):
if self.device.is_streaming:<EOL><INDENT>self.device.stop_stream()<EOL><DEDENT>base_buffer = self.device.start_stream(buffer_size=base_buffer_size)<EOL>self._bins = bins<EOL>self._repeats = repeats<EOL>self._base_buffer_size = len(base_buffer)<EOL>self._max_buffer_size = max_buffer_size<EOL>self._buffer_repeats, self._buffer = self.create_buffer(<EOL>bins, repeats, self._base_buffer_size, self._max_buffer_size<EOL>)<EOL>self._tune_delay = tune_delay<EOL>self._reset_stream = reset_stream<EOL>self._psd = psd.PSD(bins, self.device.sample_rate, fft_window=fft_window, fft_overlap=fft_overlap,<EOL>crop_factor=crop_factor, log_scale=log_scale, remove_dc=remove_dc, detrend=detrend,<EOL>lnb_lo=lnb_lo, max_threads=max_threads, max_queue_size=max_queue_size)<EOL>self._writer = writer.formats[self._output_format](self._output)<EOL>
Prepare samples buffer and start streaming samples from device