diff --git a/src/urh/controller/widgets/SignalFrame.py b/src/urh/controller/widgets/SignalFrame.py index 01f4fa976..97d9976c3 100644 --- a/src/urh/controller/widgets/SignalFrame.py +++ b/src/urh/controller/widgets/SignalFrame.py @@ -1268,7 +1268,7 @@ def on_bandpass_filter_triggered(self, f_low: float, f_high: float): time.sleep(0.1) filtered = np.frombuffer(filtered.get_obj(), dtype=np.complex64) - signal = self.signal.create_new(new_data=filtered.astype(np.complex64)) + signal = self.signal.create_new(new_data=filtered.astype(np.complex64), new_timestamp=self.signal.timestamp) signal.name = self.signal.name + " filtered with f_low={0:.4n} f_high={1:.4n} bw={2:.4n}".format(f_low, f_high, filter_bw) self.signal_created.emit(signal) diff --git a/src/urh/signalprocessing/Signal.py b/src/urh/signalprocessing/Signal.py index 3eb81ead8..ef89e8dac 100644 --- a/src/urh/signalprocessing/Signal.py +++ b/src/urh/signalprocessing/Signal.py @@ -447,13 +447,15 @@ def calc_relative_noise_threshold_from_range(self, noise_start: int, noise_end: logger.warning("Could not calculate noise threshold for range {}-{}".format(noise_start, noise_end)) return self.noise_threshold_relative - def create_new(self, start=0, end=0, new_data=None): + def create_new(self, start=0, end=0, new_data=None, new_timestamp=0): new_signal = Signal("", "New " + self.name) if new_data is None: new_signal.iq_array = IQArray(self.iq_array[start:end]) + new_signal.__timestamp = self.timestamp + (start / self.sample_rate) else: new_signal.iq_array = IQArray(new_data) + new_signal.__timestamp = new_timestamp new_signal._noise_threshold = self.noise_threshold new_signal.noise_min_plot = self.noise_min_plot