diff options
author | Marcus Müller <mueller@kit.edu> | 2017-08-07 10:27:30 +0200 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2017-08-14 14:50:47 -0700 |
commit | 98b8d15c6936074a47ad27ac4cd337ea80e2a1ad (patch) | |
tree | 777341b965440e151043e7314a69c3ec714f1a4f /gr-fft | |
parent | 7f90308e80a60c478f7c0acdfe09ed51e85039cc (diff) |
logpwrfft did `ref_scale/2`, which led to integer div in Py2
That is especially hurt as the GRC template puts defaults to
`ref_scale=2` (int literal!) and if someone uses `1`, they'll get zero
internally in logpwrfft, and that leads to errors.
Diffstat (limited to 'gr-fft')
-rw-r--r-- | gr-fft/python/fft/logpwrfft.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gr-fft/python/fft/logpwrfft.py b/gr-fft/python/fft/logpwrfft.py index 356ec1217b..1ed9d6cacb 100644 --- a/gr-fft/python/fft/logpwrfft.py +++ b/gr-fft/python/fft/logpwrfft.py @@ -69,8 +69,8 @@ class _logpwrfft_base(gr.hier_block2): self._avg = filter.single_pole_iir_filter_ff(1.0, fft_size) self._log = blocks.nlog10_ff(10, fft_size, -20*math.log10(fft_size) # Adjust for number of bins - -10*math.log10(window_power/fft_size) # Adjust for windowing loss - -20*math.log10(ref_scale/2)) # Adjust for reference scale + -10*math.log10(float(window_power)/fft_size) # Adjust for windowing loss + -20*math.log10(float(ref_scale)/2)) # Adjust for reference scale self.connect(self, self._sd, fft, c2magsq, self._avg, self._log, self) self._average = average |