fix scaling in LUT generation

gr3.6
Dimitri Stolnikov 11 years ago
parent 0efd28de6b
commit 313334d54a
  1. 116
      apps/osmosdr_source.grc
  2. 6
      apps/osmosdr_source.py
  3. 4
      lib/rtl_source_c.cc

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
<timestamp>Fri Apr 6 14:59:58 2012</timestamp>
<timestamp>Fri Apr 6 15:57:44 2012</timestamp>
<block>
<key>options</key>
<param>
@ -169,6 +169,61 @@
<value>0</value>
</param>
</block>
<block>
<key>variable_slider</key>
<param>
<key>id</key>
<value>gain</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>label</key>
<value></value>
</param>
<param>
<key>value</key>
<value>10</value>
</param>
<param>
<key>min</key>
<value>0</value>
</param>
<param>
<key>max</key>
<value>30</value>
</param>
<param>
<key>num_steps</key>
<value>31</value>
</param>
<param>
<key>style</key>
<value>wx.SL_HORIZONTAL</value>
</param>
<param>
<key>converver</key>
<value>float_converter</value>
</param>
<param>
<key>grid_pos</key>
<value></value>
</param>
<param>
<key>notebook</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
<value>(472, 65)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
</block>
<block>
<key>wxgui_fftsink2</key>
<param>
@ -197,7 +252,7 @@
</param>
<param>
<key>y_per_div</key>
<value>5</value>
<value>10</value>
</param>
<param>
<key>y_divs</key>
@ -205,7 +260,7 @@
</param>
<param>
<key>ref_level</key>
<value>145</value>
<value>0</value>
</param>
<param>
<key>ref_scale</key>
@ -256,61 +311,6 @@
<value>0</value>
</param>
</block>
<block>
<key>variable_slider</key>
<param>
<key>id</key>
<value>gain</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>label</key>
<value></value>
</param>
<param>
<key>value</key>
<value>10</value>
</param>
<param>
<key>min</key>
<value>0</value>
</param>
<param>
<key>max</key>
<value>30</value>
</param>
<param>
<key>num_steps</key>
<value>31</value>
</param>
<param>
<key>style</key>
<value>wx.SL_HORIZONTAL</value>
</param>
<param>
<key>converver</key>
<value>float_converter</value>
</param>
<param>
<key>grid_pos</key>
<value></value>
</param>
<param>
<key>notebook</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
<value>(472, 65)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
</block>
<connection>
<source_block_id>osmosdr_source_c_0</source_block_id>
<sink_block_id>wxgui_fftsink2_0</sink_block_id>

@ -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
)

@ -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;

Loading…
Cancel
Save