Skip to content

Commit

Permalink
Signal: retain the sample_rate on create_new
Browse files Browse the repository at this point in the history
When using "Create signal from selection" feature, the newly created
signal does not retain sample rate of the original so all the time of
the selection is computed wrong which is very confusing to the user.

This simple patch makes sure the sample_rate of the original Signal is
copied to the newly created one which fixes the problem.
  • Loading branch information
kadamski authored and jopohl committed Oct 3, 2021
1 parent 0c85ee0 commit 5c52ffb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/urh/signalprocessing/Signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ def create_new(self, start=0, end=0, new_data=None):
new_signal.wav_mode = self.wav_mode
new_signal.__already_demodulated = self.__already_demodulated
new_signal.changed = True
new_signal.sample_rate = self.sample_rate
return new_signal

def get_thresholds_for_center(self, center: float, spacing=None):
Expand Down

0 comments on commit 5c52ffb

Please sign in to comment.