class_docstr: Thread which runs rtl_power_fftw process
docstr: Setup rtl_power_fftw params
code: def setup(
      self,
      start_freq,
      stop_freq,
      bin_size,
      interval=10.0,
      gain=-1,
      ppm=0,
      crop=0,
      single_shot=False,
      device=0,
      sample_rate=2560000,
      bandwidth=0,
      lnb_lo=0,
  ):
      """Setup rtl_power_fftw params"""
      crop = crop * 100
      overlap = crop * 2
      freq_range = stop_freq * 1e6 - start_freq * 1e6
      min_overhang = sample_rate * overlap * 0.01
      hops = math.ceil(
          (freq_range - min_overhang) / (sample_rate - min_overhang)
      )
      overhang = (
          (hops * sample_rate - freq_range) / (hops - 1)
          if hops > 1
          else 0
      )
      if bin_size > 2800:
          bin_size = 2800
      bins = math.ceil(sample_rate / (bin_size * 1e3))
      crop_freq = sample_rate * crop * 0.01
  
      self.params = {
          "start_freq": start_freq,
          "stop_freq": stop_freq,
          "freq_range": freq_range,
          "device": device,
          "sample_rate": int(sample_rate),
          "bin_size": bin_size,
          "bins": bins,
          "interval": interval,
          "hops": hops,
          "time": interval / hops,
          "gain": int(gain * 10),
          "ppm": ppm,
          "crop": crop,
          "overlap": overlap,
          "min_overhang": min_overhang,
          "overhang": overhang,
          "single_shot": single_shot,
      }
      self.lnb_lo = lnb_lo
      self.freqs = [self.get_hop_freq(hop) for hop in range(hops)]
      self.freqs_crop = [
          (f[0] + crop_freq, f[1] - crop_freq) for f in self.freqs
      ]
      self.databuffer = {"timestamp": [], "x": [], "y": []}
      self.databuffer_hop = {"timestamp": [], "x": [], "y": []}
      self.hop = 0
      self.prev_line = ""
  
file_path: qspectrumanalyzer/qspectrumanalyzer/backends/rtl_power_fftw.py
imports: import math, shlex
  from Qt import QtCore
  from qspectrumanalyzer import subprocess
  from qspectrumanalyzer.backends import BaseInfo, BasePowerThread
label_desc: Use image node_id 1 for calling the PowerThread obj's underlying member method code with example usage: obj.setup(start_freq, stop_freq, bin_size, interval, gain, ppm, crop, single_shot, device, sample_rate, bandwidth, lnb_lo) without return types