def __init__(self, parent, sharedGLWidget, logger=PrintLogger()): super().__init__(parent) self.logger = logger self.audiobuffer = None self.setObjectName("Spectrum_Widget") self.gridLayout = QtWidgets.QGridLayout(self) self.gridLayout.setObjectName("gridLayout") self.PlotZoneSpect = SpectrumPlotWidget(self, sharedGLWidget, self.logger) self.PlotZoneSpect.setObjectName("PlotZoneSpect") self.gridLayout.addWidget(self.PlotZoneSpect, 0, 0, 1, 1) # initialize the class instance that will do the fft self.proc = audioproc(self.logger) self.maxfreq = DEFAULT_MAXFREQ self.proc.set_maxfreq(self.maxfreq) self.minfreq = DEFAULT_MINFREQ self.fft_size = 2**DEFAULT_FFT_SIZE * 32 self.proc.set_fftsize(self.fft_size) self.spec_min = DEFAULT_SPEC_MIN self.spec_max = DEFAULT_SPEC_MAX self.weighting = DEFAULT_WEIGHTING self.dual_channels = False self.response_time = DEFAULT_RESPONSE_TIME self.update_weighting() self.freq = self.proc.get_freq_scale() self.old_index = 0 self.overlap = 3. / 4. self.update_display_buffers() # set kernel and parameters for the smoothing filter self.setresponsetime(self.response_time) self.PlotZoneSpect.setlogfreqscale() #DEFAULT_FREQ_SCALE = 1 #log10 self.PlotZoneSpect.setfreqrange(self.minfreq, self.maxfreq) self.PlotZoneSpect.setspecrange(self.spec_min, self.spec_max) self.PlotZoneSpect.setweighting(self.weighting) self.PlotZoneSpect.set_peaks_enabled(True) self.PlotZoneSpect.set_baseline_displayUnits(0.) self.PlotZoneSpect.setShowFreqLabel(DEFAULT_SHOW_FREQ_LABELS) # initialize the settings dialog self.settings_dialog = Spectrum_Settings_Dialog(self, self.logger)