From 313334d54a07752e7cb9198284e5329a7e381176 Mon Sep 17 00:00:00 2001 From: Dimitri Stolnikov Date: Fri, 6 Apr 2012 15:58:12 +0200 Subject: [PATCH] fix scaling in LUT generation --- apps/osmosdr_source.grc | 176 ++++++++++++++++++++-------------------- apps/osmosdr_source.py | 6 +- lib/rtl_source_c.cc | 4 +- 3 files changed, 93 insertions(+), 93 deletions(-) diff --git a/apps/osmosdr_source.grc b/apps/osmosdr_source.grc index de97388..e661ae1 100644 --- a/apps/osmosdr_source.grc +++ b/apps/osmosdr_source.grc @@ -1,6 +1,6 @@ - Fri Apr 6 14:59:58 2012 + Fri Apr 6 15:57:44 2012 options @@ -169,93 +169,6 @@ 0 - - wxgui_fftsink2 - - id - wxgui_fftsink2_0 - - - _enabled - True - - - type - complex - - - title - FFT Plot - - - samp_rate - samp_rate - - - baseband_freq - freq - - - y_per_div - 5 - - - y_divs - 10 - - - ref_level - 145 - - - ref_scale - 2.0 - - - fft_size - 1024 - - - fft_rate - 15 - - - peak_hold - False - - - average - False - - - avg_alpha - 0 - - - win - None - - - win_size - - - - grid_pos - - - - notebook - - - - _coordinate - (681, 242) - - - _rotation - 0 - - variable_slider @@ -311,6 +224,93 @@ 0 + + wxgui_fftsink2 + + id + wxgui_fftsink2_0 + + + _enabled + True + + + type + complex + + + title + FFT Plot + + + samp_rate + samp_rate + + + baseband_freq + freq + + + y_per_div + 10 + + + y_divs + 10 + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_size + 1024 + + + fft_rate + 15 + + + peak_hold + False + + + average + False + + + avg_alpha + 0 + + + win + None + + + win_size + + + + grid_pos + + + + notebook + + + + _coordinate + (681, 242) + + + _rotation + 0 + + osmosdr_source_c_0 wxgui_fftsink2_0 diff --git a/apps/osmosdr_source.py b/apps/osmosdr_source.py index a6bde0d..f2ed63d 100755 --- a/apps/osmosdr_source.py +++ b/apps/osmosdr_source.py @@ -38,10 +38,10 @@ class osmosdr_source_c(grc_wxgui.top_block_gui): self.GetWin(), fft_size=1024, sample_rate=samp_rate, - ref_scale=50.0, - ref_level=145, + ref_scale=2.0, + ref_level=0, y_divs=10, - fft_rate=20, + fft_rate=15, average=False, avg_alpha=0.5 ) diff --git a/lib/rtl_source_c.cc b/lib/rtl_source_c.cc index 82001f9..6bdaed2 100644 --- a/lib/rtl_source_c.cc +++ b/lib/rtl_source_c.cc @@ -79,8 +79,8 @@ rtl_source_c::rtl_source_c (const std::string &args) // create a lookup table for gr_complex values for (unsigned int i = 0; i <= 0xffff; i++) { - _lut.push_back( gr_complex( ((i >> 8) - 127) * 0.00787, - ((i & 0xff) - 127) * 0.00787 ) ); + _lut.push_back( gr_complex( (float(i >> 8) - 127.0) * 0.00787, + (float(i & 0xff) - 127.0) * 0.00787 ) ); } std::cout << "Opening " << rtlsdr_get_device_name(dev_index) << std::endl;