def plot_FFT(self, signal, show_periods=True): fig = ppl.figure(figsize=(5, 2.5)) ax = pl.mk_Fourier_ax(fig, time_unit=self.time_unit_label, show_periods=show_periods) fft_freqs, fft_power = core.compute_fourier(signal, self.dt) print(f"mean fourier power: {np.mean(fft_power):.2f}") pl.Fourier_spec(ax, fft_freqs, fft_power, show_periods) fig.tight_layout()
def initUI(self, position, signal_id): self.setWindowTitle('Fourier spectrum ' + signal_id) self.setGeometry(510 + position, 80 + position, 520, 600) main_frame = QWidget() self.fCanvas = mkFourierCanvas() self.fCanvas.setParent(main_frame) ntb = NavigationToolbar(self.fCanvas, main_frame) # plot it ax = pl.mk_Fourier_ax(self.fCanvas.fig, self.time_unit, self.show_T) pl.Fourier_spec(ax, self.fft_freqs, self.fpower, self.show_T) main_layout = QGridLayout() main_layout.addWidget(self.fCanvas, 0, 0, 9, 1) main_layout.addWidget(ntb, 10, 0, 1, 1) self.setLayout(main_layout) self.show()