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 __init__(self, signal, dt, signal_id, position, time_unit, show_T, parent=None): super().__init__() self.time_unit = time_unit self.show_T = show_T # --- calculate Fourier spectrum ------------------ self.fft_freqs, self.fpower = core.compute_fourier(signal, dt) # ------------------------------------------------- self.initUI(position, signal_id)