From 9d1f4b4603f181fb02100de77501ebbfd99f1df6 Mon Sep 17 00:00:00 2001 From: eb Date: Sat, 16 Dec 2006 23:53:13 +0000 Subject: [PATCH] fix for ticket:114 git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@4106 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-examples/python/usrp/usrp_spectrum_sense.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnuradio-examples/python/usrp/usrp_spectrum_sense.py b/gnuradio-examples/python/usrp/usrp_spectrum_sense.py index 87768649..182d055a 100755 --- a/gnuradio-examples/python/usrp/usrp_spectrum_sense.py +++ b/gnuradio-examples/python/usrp/usrp_spectrum_sense.py @@ -156,7 +156,8 @@ class my_graph(gr.flow_graph): self.freq_step = 0.75 * usrp_rate self.min_center_freq = self.min_freq + self.freq_step/2 - self.max_center_freq = self.max_freq - self.freq_step/2 + nsteps = math.ceil((self.max_freq - self.min_freq) / self.freq_step) + self.max_center_freq = self.min_center_freq + (nsteps * self.freq_step) self.next_freq = self.min_center_freq @@ -184,7 +185,7 @@ class my_graph(gr.flow_graph): def set_next_freq(self): target_freq = self.next_freq self.next_freq = self.next_freq + self.freq_step - if self.next_freq > self.max_center_freq: + if self.next_freq >= self.max_center_freq: self.next_freq = self.min_center_freq if not self.set_freq(target_freq): -- 2.47.2