Last active
August 29, 2015 14:20
-
-
Save marcusmueller/1bbf7704afec20c4f00d to your computer and use it in GitHub Desktop.
Fading Model attenuation test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='ASCII'?> | |
<?grc format='1' created='3.7.8'?> | |
<flow_graph> | |
<timestamp>Fri May 8 09:31:33 2015</timestamp> | |
<block> | |
<key>options</key> | |
<param> | |
<key>id</key> | |
<value>fading_test</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>title</key> | |
<value></value> | |
</param> | |
<param> | |
<key>author</key> | |
<value></value> | |
</param> | |
<param> | |
<key>description</key> | |
<value></value> | |
</param> | |
<param> | |
<key>window_size</key> | |
<value>1280, 1024</value> | |
</param> | |
<param> | |
<key>generate_options</key> | |
<value>qt_gui</value> | |
</param> | |
<param> | |
<key>category</key> | |
<value>Custom</value> | |
</param> | |
<param> | |
<key>run_options</key> | |
<value>prompt</value> | |
</param> | |
<param> | |
<key>run</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>max_nouts</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>realtime_scheduling</key> | |
<value></value> | |
</param> | |
<param> | |
<key>thread_safe_setters</key> | |
<value></value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(0, 93)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>variable</key> | |
<param> | |
<key>id</key> | |
<value>samp_rate</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>value</key> | |
<value>1e6</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(168, 93)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>blocks_throttle</key> | |
<param> | |
<key>id</key> | |
<value>blocks_throttle_0</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>type</key> | |
<value>complex</value> | |
</param> | |
<param> | |
<key>samples_per_second</key> | |
<value>samp_rate</value> | |
</param> | |
<param> | |
<key>vlen</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>ignoretag</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>affinity</key> | |
<value></value> | |
</param> | |
<param> | |
<key>minoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>maxoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(168, 12)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>analog_noise_source_x</key> | |
<param> | |
<key>id</key> | |
<value>analog_noise_source_x_0</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>type</key> | |
<value>complex</value> | |
</param> | |
<param> | |
<key>noise_type</key> | |
<value>analog.GR_GAUSSIAN</value> | |
</param> | |
<param> | |
<key>amp</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>seed</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>affinity</key> | |
<value></value> | |
</param> | |
<param> | |
<key>minoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>maxoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(0, -2)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>blocks_complex_to_mag_squared</key> | |
<param> | |
<key>id</key> | |
<value>blocks_complex_to_mag_squared_1</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>vlen</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>affinity</key> | |
<value></value> | |
</param> | |
<param> | |
<key>minoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>maxoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(608, 88)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>blocks_complex_to_mag_squared</key> | |
<param> | |
<key>id</key> | |
<value>blocks_complex_to_mag_squared_0</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>vlen</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>affinity</key> | |
<value></value> | |
</param> | |
<param> | |
<key>minoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>maxoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(608, 16)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>fir_filter_xxx</key> | |
<param> | |
<key>id</key> | |
<value>fir_filter_xxx_0_0_0</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>type</key> | |
<value>fff</value> | |
</param> | |
<param> | |
<key>decim</key> | |
<value>100</value> | |
</param> | |
<param> | |
<key>taps</key> | |
<value>firdes.low_pass(1.0, samp_rate, samp_rate/200, samp_rate/200)</value> | |
</param> | |
<param> | |
<key>samp_delay</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>affinity</key> | |
<value></value> | |
</param> | |
<param> | |
<key>minoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>maxoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(800, 5)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>fir_filter_xxx</key> | |
<param> | |
<key>id</key> | |
<value>fir_filter_xxx_0_0_0_0</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>type</key> | |
<value>fff</value> | |
</param> | |
<param> | |
<key>decim</key> | |
<value>100</value> | |
</param> | |
<param> | |
<key>taps</key> | |
<value>firdes.low_pass(1.0, samp_rate, samp_rate/200, samp_rate/200)</value> | |
</param> | |
<param> | |
<key>samp_delay</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>affinity</key> | |
<value></value> | |
</param> | |
<param> | |
<key>minoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>maxoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(800, 77)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>channels_fading_model</key> | |
<param> | |
<key>id</key> | |
<value>channels_fading_model_0</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>N</key> | |
<value>8</value> | |
</param> | |
<param> | |
<key>fDTs</key> | |
<value>10.0/samp_rate</value> | |
</param> | |
<param> | |
<key>LOS</key> | |
<value>False</value> | |
</param> | |
<param> | |
<key>K</key> | |
<value>4.0</value> | |
</param> | |
<param> | |
<key>seed</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>affinity</key> | |
<value></value> | |
</param> | |
<param> | |
<key>minoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>maxoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(352, 63)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>qtgui_time_sink_x</key> | |
<param> | |
<key>id</key> | |
<value>vis</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>type</key> | |
<value>float</value> | |
</param> | |
<param> | |
<key>name</key> | |
<value>""</value> | |
</param> | |
<param> | |
<key>ylabel</key> | |
<value>Amplitude</value> | |
</param> | |
<param> | |
<key>yunit</key> | |
<value>""</value> | |
</param> | |
<param> | |
<key>size</key> | |
<value>10000</value> | |
</param> | |
<param> | |
<key>srate</key> | |
<value>samp_rate/100</value> | |
</param> | |
<param> | |
<key>grid</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>autoscale</key> | |
<value>False</value> | |
</param> | |
<param> | |
<key>ymin</key> | |
<value>-0.1</value> | |
</param> | |
<param> | |
<key>ymax</key> | |
<value>15</value> | |
</param> | |
<param> | |
<key>nconnections</key> | |
<value>2</value> | |
</param> | |
<param> | |
<key>update_time</key> | |
<value>0.10</value> | |
</param> | |
<param> | |
<key>entags</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>gui_hint</key> | |
<value></value> | |
</param> | |
<param> | |
<key>tr_mode</key> | |
<value>qtgui.TRIG_MODE_FREE</value> | |
</param> | |
<param> | |
<key>tr_slope</key> | |
<value>qtgui.TRIG_SLOPE_POS</value> | |
</param> | |
<param> | |
<key>tr_level</key> | |
<value>1.0</value> | |
</param> | |
<param> | |
<key>tr_delay</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>tr_chan</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>tr_tag</key> | |
<value>""</value> | |
</param> | |
<param> | |
<key>ctrlpanel</key> | |
<value>False</value> | |
</param> | |
<param> | |
<key>legend</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>label1</key> | |
<value>In/out power ratio [dB]</value> | |
</param> | |
<param> | |
<key>width1</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>color1</key> | |
<value>"blue"</value> | |
</param> | |
<param> | |
<key>style1</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>marker1</key> | |
<value>-1</value> | |
</param> | |
<param> | |
<key>alpha1</key> | |
<value>1.0</value> | |
</param> | |
<param> | |
<key>label2</key> | |
<value>Equal Power</value> | |
</param> | |
<param> | |
<key>width2</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>color2</key> | |
<value>"magenta"</value> | |
</param> | |
<param> | |
<key>style2</key> | |
<value>4</value> | |
</param> | |
<param> | |
<key>marker2</key> | |
<value>-1</value> | |
</param> | |
<param> | |
<key>alpha2</key> | |
<value>0.75</value> | |
</param> | |
<param> | |
<key>label3</key> | |
<value></value> | |
</param> | |
<param> | |
<key>width3</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>color3</key> | |
<value>"green"</value> | |
</param> | |
<param> | |
<key>style3</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>marker3</key> | |
<value>-1</value> | |
</param> | |
<param> | |
<key>alpha3</key> | |
<value>1.0</value> | |
</param> | |
<param> | |
<key>label4</key> | |
<value></value> | |
</param> | |
<param> | |
<key>width4</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>color4</key> | |
<value>"black"</value> | |
</param> | |
<param> | |
<key>style4</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>marker4</key> | |
<value>-1</value> | |
</param> | |
<param> | |
<key>alpha4</key> | |
<value>1.0</value> | |
</param> | |
<param> | |
<key>label5</key> | |
<value></value> | |
</param> | |
<param> | |
<key>width5</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>color5</key> | |
<value>"cyan"</value> | |
</param> | |
<param> | |
<key>style5</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>marker5</key> | |
<value>-1</value> | |
</param> | |
<param> | |
<key>alpha5</key> | |
<value>1.0</value> | |
</param> | |
<param> | |
<key>label6</key> | |
<value></value> | |
</param> | |
<param> | |
<key>width6</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>color6</key> | |
<value>"magenta"</value> | |
</param> | |
<param> | |
<key>style6</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>marker6</key> | |
<value>-1</value> | |
</param> | |
<param> | |
<key>alpha6</key> | |
<value>1.0</value> | |
</param> | |
<param> | |
<key>label7</key> | |
<value></value> | |
</param> | |
<param> | |
<key>width7</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>color7</key> | |
<value>"yellow"</value> | |
</param> | |
<param> | |
<key>style7</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>marker7</key> | |
<value>-1</value> | |
</param> | |
<param> | |
<key>alpha7</key> | |
<value>1.0</value> | |
</param> | |
<param> | |
<key>label8</key> | |
<value></value> | |
</param> | |
<param> | |
<key>width8</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>color8</key> | |
<value>"dark red"</value> | |
</param> | |
<param> | |
<key>style8</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>marker8</key> | |
<value>-1</value> | |
</param> | |
<param> | |
<key>alpha8</key> | |
<value>1.0</value> | |
</param> | |
<param> | |
<key>label9</key> | |
<value></value> | |
</param> | |
<param> | |
<key>width9</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>color9</key> | |
<value>"dark green"</value> | |
</param> | |
<param> | |
<key>style9</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>marker9</key> | |
<value>-1</value> | |
</param> | |
<param> | |
<key>alpha9</key> | |
<value>1.0</value> | |
</param> | |
<param> | |
<key>label10</key> | |
<value></value> | |
</param> | |
<param> | |
<key>width10</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>color10</key> | |
<value>"blue"</value> | |
</param> | |
<param> | |
<key>style10</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>marker10</key> | |
<value>-1</value> | |
</param> | |
<param> | |
<key>alpha10</key> | |
<value>1.0</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>affinity</key> | |
<value></value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(1144, 70)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>analog_const_source_x</key> | |
<param> | |
<key>id</key> | |
<value>thresh</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>type</key> | |
<value>float</value> | |
</param> | |
<param> | |
<key>const</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>affinity</key> | |
<value></value> | |
</param> | |
<param> | |
<key>minoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>maxoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(952, 124)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<block> | |
<key>blocks_divide_xx</key> | |
<param> | |
<key>id</key> | |
<value>blocks_divide_xx_0</value> | |
</param> | |
<param> | |
<key>_enabled</key> | |
<value>True</value> | |
</param> | |
<param> | |
<key>type</key> | |
<value>float</value> | |
</param> | |
<param> | |
<key>vlen</key> | |
<value>1</value> | |
</param> | |
<param> | |
<key>num_inputs</key> | |
<value>2</value> | |
</param> | |
<param> | |
<key>alias</key> | |
<value></value> | |
</param> | |
<param> | |
<key>affinity</key> | |
<value></value> | |
</param> | |
<param> | |
<key>minoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>maxoutbuf</key> | |
<value>0</value> | |
</param> | |
<param> | |
<key>comment</key> | |
<value></value> | |
</param> | |
<param> | |
<key>_coordinate</key> | |
<value>(1016, 56)</value> | |
</param> | |
<param> | |
<key>_rotation</key> | |
<value>0</value> | |
</param> | |
</block> | |
<connection> | |
<source_block_id>blocks_throttle_0</source_block_id> | |
<sink_block_id>blocks_complex_to_mag_squared_0</sink_block_id> | |
<source_key>0</source_key> | |
<sink_key>0</sink_key> | |
</connection> | |
<connection> | |
<source_block_id>channels_fading_model_0</source_block_id> | |
<sink_block_id>blocks_complex_to_mag_squared_1</sink_block_id> | |
<source_key>0</source_key> | |
<sink_key>0</sink_key> | |
</connection> | |
<connection> | |
<source_block_id>blocks_throttle_0</source_block_id> | |
<sink_block_id>channels_fading_model_0</sink_block_id> | |
<source_key>0</source_key> | |
<sink_key>0</sink_key> | |
</connection> | |
<connection> | |
<source_block_id>analog_noise_source_x_0</source_block_id> | |
<sink_block_id>blocks_throttle_0</sink_block_id> | |
<source_key>0</source_key> | |
<sink_key>0</sink_key> | |
</connection> | |
<connection> | |
<source_block_id>blocks_complex_to_mag_squared_1</source_block_id> | |
<sink_block_id>fir_filter_xxx_0_0_0_0</sink_block_id> | |
<source_key>0</source_key> | |
<sink_key>0</sink_key> | |
</connection> | |
<connection> | |
<source_block_id>fir_filter_xxx_0_0_0</source_block_id> | |
<sink_block_id>blocks_divide_xx_0</sink_block_id> | |
<source_key>0</source_key> | |
<sink_key>0</sink_key> | |
</connection> | |
<connection> | |
<source_block_id>fir_filter_xxx_0_0_0_0</source_block_id> | |
<sink_block_id>blocks_divide_xx_0</sink_block_id> | |
<source_key>0</source_key> | |
<sink_key>1</sink_key> | |
</connection> | |
<connection> | |
<source_block_id>blocks_complex_to_mag_squared_0</source_block_id> | |
<sink_block_id>fir_filter_xxx_0_0_0</sink_block_id> | |
<source_key>0</source_key> | |
<sink_key>0</sink_key> | |
</connection> | |
<connection> | |
<source_block_id>blocks_divide_xx_0</source_block_id> | |
<sink_block_id>vis</sink_block_id> | |
<source_key>0</source_key> | |
<sink_key>0</sink_key> | |
</connection> | |
<connection> | |
<source_block_id>thresh</source_block_id> | |
<sink_block_id>vis</sink_block_id> | |
<source_key>0</source_key> | |
<sink_key>1</sink_key> | |
</connection> | |
</flow_graph> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
################################################## | |
# GNU Radio Python Flow Graph | |
# Title: Fading Test | |
# Generated: Fri May 8 11:58:44 2015 | |
################################################## | |
if __name__ == '__main__': | |
import ctypes | |
import sys | |
if sys.platform.startswith('linux'): | |
try: | |
x11 = ctypes.cdll.LoadLibrary('libX11.so') | |
x11.XInitThreads() | |
except: | |
print "Warning: failed to XInitThreads()" | |
from PyQt4 import Qt | |
from gnuradio import analog | |
from gnuradio import blocks | |
from gnuradio import channels | |
from gnuradio import eng_notation | |
from gnuradio import filter | |
from gnuradio import gr | |
from gnuradio import qtgui | |
from gnuradio.eng_option import eng_option | |
from gnuradio.filter import firdes | |
from optparse import OptionParser | |
import sip | |
import sys | |
from distutils.version import StrictVersion | |
class fading_test(gr.top_block, Qt.QWidget): | |
def __init__(self): | |
gr.top_block.__init__(self, "Fading Test") | |
Qt.QWidget.__init__(self) | |
self.setWindowTitle("Fading Test") | |
try: | |
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) | |
except: | |
pass | |
self.top_scroll_layout = Qt.QVBoxLayout() | |
self.setLayout(self.top_scroll_layout) | |
self.top_scroll = Qt.QScrollArea() | |
self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) | |
self.top_scroll_layout.addWidget(self.top_scroll) | |
self.top_scroll.setWidgetResizable(True) | |
self.top_widget = Qt.QWidget() | |
self.top_scroll.setWidget(self.top_widget) | |
self.top_layout = Qt.QVBoxLayout(self.top_widget) | |
self.top_grid_layout = Qt.QGridLayout() | |
self.top_layout.addLayout(self.top_grid_layout) | |
self.settings = Qt.QSettings("GNU Radio", "fading_test") | |
self.restoreGeometry(self.settings.value("geometry").toByteArray()) | |
################################################## | |
# Variables | |
################################################## | |
self.samp_rate = samp_rate = 1e6 | |
################################################## | |
# Blocks | |
################################################## | |
self.vis = qtgui.time_sink_f( | |
10000, #size | |
samp_rate/100, #samp_rate | |
"", #name | |
2 #number of inputs | |
) | |
self.vis.set_update_time(0.10) | |
self.vis.set_y_axis(-0.1, 15) | |
self.vis.set_y_label("Amplitude", "") | |
self.vis.enable_tags(-1, True) | |
self.vis.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 1.0, 0, 0, "") | |
self.vis.enable_autoscale(False) | |
self.vis.enable_grid(True) | |
self.vis.enable_control_panel(False) | |
if not True: | |
self.vis.disable_legend() | |
labels = ["In/out power ratio [dB]", "Equal Power", "", "", "", | |
"", "", "", "", ""] | |
widths = [1, 1, 1, 1, 1, | |
1, 1, 1, 1, 1] | |
colors = ["blue", "magenta", "green", "black", "cyan", | |
"magenta", "yellow", "dark red", "dark green", "blue"] | |
styles = [1, 4, 1, 1, 1, | |
1, 1, 1, 1, 1] | |
markers = [-1, -1, -1, -1, -1, | |
-1, -1, -1, -1, -1] | |
alphas = [1.0, 0.75, 1.0, 1.0, 1.0, | |
1.0, 1.0, 1.0, 1.0, 1.0] | |
for i in xrange(2): | |
if len(labels[i]) == 0: | |
self.vis.set_line_label(i, "Data {0}".format(i)) | |
else: | |
self.vis.set_line_label(i, labels[i]) | |
self.vis.set_line_width(i, widths[i]) | |
self.vis.set_line_color(i, colors[i]) | |
self.vis.set_line_style(i, styles[i]) | |
self.vis.set_line_marker(i, markers[i]) | |
self.vis.set_line_alpha(i, alphas[i]) | |
self._vis_win = sip.wrapinstance(self.vis.pyqwidget(), Qt.QWidget) | |
self.top_layout.addWidget(self._vis_win) | |
self.thresh = analog.sig_source_f(0, analog.GR_CONST_WAVE, 0, 0, 1) | |
self.fir_filter_xxx_0_0_0_0 = filter.fir_filter_fff(100, (firdes.low_pass(1.0, samp_rate, samp_rate/200, samp_rate/200))) | |
self.fir_filter_xxx_0_0_0_0.declare_sample_delay(0) | |
self.fir_filter_xxx_0_0_0 = filter.fir_filter_fff(100, (firdes.low_pass(1.0, samp_rate, samp_rate/200, samp_rate/200))) | |
self.fir_filter_xxx_0_0_0.declare_sample_delay(0) | |
self.channels_fading_model_0 = channels.fading_model( 8, 10.0/samp_rate, False, 4.0, 0 ) | |
self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) | |
self.blocks_divide_xx_0 = blocks.divide_ff(1) | |
self.blocks_complex_to_mag_squared_1 = blocks.complex_to_mag_squared(1) | |
self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1) | |
self.analog_noise_source_x_0 = analog.noise_source_c(analog.GR_GAUSSIAN, 1, 0) | |
################################################## | |
# Connections | |
################################################## | |
self.connect((self.analog_noise_source_x_0, 0), (self.blocks_throttle_0, 0)) | |
self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.fir_filter_xxx_0_0_0, 0)) | |
self.connect((self.blocks_complex_to_mag_squared_1, 0), (self.fir_filter_xxx_0_0_0_0, 0)) | |
self.connect((self.blocks_divide_xx_0, 0), (self.vis, 0)) | |
self.connect((self.blocks_throttle_0, 0), (self.blocks_complex_to_mag_squared_0, 0)) | |
self.connect((self.blocks_throttle_0, 0), (self.channels_fading_model_0, 0)) | |
self.connect((self.channels_fading_model_0, 0), (self.blocks_complex_to_mag_squared_1, 0)) | |
self.connect((self.fir_filter_xxx_0_0_0, 0), (self.blocks_divide_xx_0, 0)) | |
self.connect((self.fir_filter_xxx_0_0_0_0, 0), (self.blocks_divide_xx_0, 1)) | |
self.connect((self.thresh, 0), (self.vis, 1)) | |
def closeEvent(self, event): | |
self.settings = Qt.QSettings("GNU Radio", "fading_test") | |
self.settings.setValue("geometry", self.saveGeometry()) | |
event.accept() | |
def get_samp_rate(self): | |
return self.samp_rate | |
def set_samp_rate(self, samp_rate): | |
self.samp_rate = samp_rate | |
self.blocks_throttle_0.set_sample_rate(self.samp_rate) | |
self.fir_filter_xxx_0_0_0.set_taps((firdes.low_pass(1.0, self.samp_rate, self.samp_rate/200, self.samp_rate/200))) | |
self.fir_filter_xxx_0_0_0_0.set_taps((firdes.low_pass(1.0, self.samp_rate, self.samp_rate/200, self.samp_rate/200))) | |
self.channels_fading_model_0.set_fDTs(10.0/self.samp_rate) | |
self.vis.set_samp_rate(self.samp_rate/100) | |
if __name__ == '__main__': | |
parser = OptionParser(option_class=eng_option, usage="%prog: [options]") | |
(options, args) = parser.parse_args() | |
if(StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0")): | |
Qt.QApplication.setGraphicsSystem(gr.prefs().get_string('qtgui','style','raster')) | |
qapp = Qt.QApplication(sys.argv) | |
tb = fading_test() | |
tb.start() | |
tb.show() | |
def quitting(): | |
tb.stop() | |
tb.wait() | |
qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) | |
qapp.exec_() | |
tb = None #to clean up Qt widgets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment