summaryrefslogtreecommitdiff
path: root/gr-wxgui/python
diff options
context:
space:
mode:
authorMichael Ossmann <mike@ossmann.com>2014-09-19 12:52:48 -0600
committerTom Rondeau <tom@trondeau.com>2014-10-15 09:59:17 -0400
commit2545114ad3710ca6be776a890122fb4abb851f22 (patch)
tree8b7d52da51eed2c00ea968d940e4ffb99b72f9b7 /gr-wxgui/python
parent4ba84a41da4db0ee0e68336449a6195bd15d571d (diff)
wxgui: use complex_to_mag_squared instead of complex_to_mag in wxgui fftsink_nongl
Diffstat (limited to 'gr-wxgui/python')
-rw-r--r--gr-wxgui/python/wxgui/fftsink_nongl.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/gr-wxgui/python/wxgui/fftsink_nongl.py b/gr-wxgui/python/wxgui/fftsink_nongl.py
index be69e41578..c63f0fb268 100644
--- a/gr-wxgui/python/wxgui/fftsink_nongl.py
+++ b/gr-wxgui/python/wxgui/fftsink_nongl.py
@@ -136,17 +136,17 @@ class fft_sink_f(gr.hier_block2, fft_sink_base):
for tap in mywindow:
power += tap*tap
- self.c2mag = blocks.complex_to_mag(self.fft_size)
+ self.c2magsq = blocks.complex_to_mag_squared(self.fft_size)
self.avg = grfilter.single_pole_iir_filter_ff(1.0, self.fft_size)
# FIXME We need to add 3dB to all bins but the DC bin
- self.log = blocks.nlog10_ff(20, self.fft_size,
+ self.log = blocks.nlog10_ff(10, self.fft_size,
-20*math.log10(self.fft_size) # Adjust for number of bins
-10*math.log10(power/self.fft_size) # Adjust for windowing loss
-20*math.log10(ref_scale/2)) # Adjust for reference scale
self.sink = blocks.message_sink(gr.sizeof_float * self.fft_size, self.msgq, True)
- self.connect(self, self.s2p, self.one_in_n, self.fft, self.c2mag, self.avg, self.log, self.sink)
+ self.connect(self, self.s2p, self.one_in_n, self.fft, self.c2magsq, self.avg, self.log, self.sink)
self.win = fft_window(self, parent, size=size)
self.set_average(self.average)
@@ -183,17 +183,17 @@ class fft_sink_c(gr.hier_block2, fft_sink_base):
for tap in mywindow:
power += tap*tap
- self.c2mag = blocks.complex_to_mag(self.fft_size)
+ self.c2magsq = blocks.complex_to_mag_squared(self.fft_size)
self.avg = grfilter.single_pole_iir_filter_ff(1.0, self.fft_size)
# FIXME We need to add 3dB to all bins but the DC bin
- self.log = blocks.nlog10_ff(20, self.fft_size,
+ self.log = blocks.nlog10_ff(10, self.fft_size,
-20*math.log10(self.fft_size) # Adjust for number of bins
-10*math.log10(power/self.fft_size) # Adjust for windowing loss
-20*math.log10(ref_scale/2)) # Adjust for reference scale
self.sink = blocks.message_sink(gr.sizeof_float * self.fft_size, self.msgq, True)
- self.connect(self, self.s2p, self.one_in_n, self.fft, self.c2mag, self.avg, self.log, self.sink)
+ self.connect(self, self.s2p, self.one_in_n, self.fft, self.c2magsq, self.avg, self.log, self.sink)
self.win = fft_window(self, parent, size=size)
self.set_average(self.average)