diff options
Diffstat (limited to 'gr-channels')
50 files changed, 870 insertions, 1102 deletions
diff --git a/gr-channels/grc/CMakeLists.txt b/gr-channels/grc/CMakeLists.txt index c85170b4ea..a268d69380 100644 --- a/gr-channels/grc/CMakeLists.txt +++ b/gr-channels/grc/CMakeLists.txt @@ -17,7 +17,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -file(GLOB xml_files "*.xml") -install(FILES ${xml_files} +file(GLOB yml_files "*.yml") +install(FILES ${yml_files} DESTINATION ${GRC_BLOCKS_DIR} ) diff --git a/gr-channels/grc/channels.tree.yml b/gr-channels/grc/channels.tree.yml new file mode 100644 index 0000000000..588246defc --- /dev/null +++ b/gr-channels/grc/channels.tree.yml @@ -0,0 +1,20 @@ +'[Core]': +- Channel Models: + - channels_channel_model + - channels_channel_model2 + - channels_conj_fs_iqcorr + - channels_fading_model + - channels_dynamic_channel_model + - channels_selective_fading_model + - channels_selective_fading_model2 +- Impairment Models: + - channels_impairments + - channels_quantizer + - channels_phase_noise_gen + - channels_iqbal_gen + - channels_distortion_2_gen + - channels_distortion_3_gen + - channels_amp_bal + - channels_phase_bal + - channels_cfo_model + - channels_sro_model diff --git a/gr-channels/grc/channels_amp_bal.block.yml b/gr-channels/grc/channels_amp_bal.block.yml new file mode 100644 index 0000000000..6cefa2b581 --- /dev/null +++ b/gr-channels/grc/channels_amp_bal.block.yml @@ -0,0 +1,24 @@ +id: channels_amp_bal +label: Amplitude Balance + +parameters: +- id: alpha + label: Alpha + dtype: float + default: '0' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.amp_bal(${alpha}) + callbacks: + - set_alpha(${alpha}) + +file_format: 1 diff --git a/gr-channels/grc/channels_amp_bal.xml b/gr-channels/grc/channels_amp_bal.xml deleted file mode 100644 index 7e0738ec98..0000000000 --- a/gr-channels/grc/channels_amp_bal.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Amplitude balance -################################################### - --> -<block> - <name>Amplitude Balance</name> - <key>channels_amp_bal</key> - <import>from gnuradio import channels</import> - <make>channels.amp_bal($alpha)</make> - <callback>set_alpha($alpha)</callback> - <param> - <name>Alpha</name> - <key>alpha</key> - <value>0</value> - <type>float</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_block_tree.xml b/gr-channels/grc/channels_block_tree.xml deleted file mode 100644 index 80aabaf478..0000000000 --- a/gr-channels/grc/channels_block_tree.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0"?> - -<!-- - Copyright 2012 Free Software Foundation, Inc. - - This file is part of GNU Radio - - GNU Radio is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - GNU Radio is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNU Radio; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, - Boston, MA 02110-1301, USA. ---> - -<!-- -################################################### -##Block Tree for GR Channel Model blocks. -################################################### - --> -<cat> - <name>[Core]</name> - <cat> - <name>Channel Models</name> - <block>channels_channel_model</block> - <block>channels_channel_model2</block> - <block>channels_conj_fs_iqcorr</block> - <block>channels_fading_model</block> - <block>channels_dynamic_channel_model</block> - <block>channels_selective_fading_model</block> - <block>channels_selective_fading_model2</block> - </cat> - <cat> - <name>Impairment Models</name> - <block>channels_impairments</block> - <block>channels_quantizer</block> - <block>channels_phase_noise_gen</block> - <block>channels_iqbal_gen</block> - <block>channels_distortion_2_gen</block> - <block>channels_distortion_3_gen</block> - <block>channels_amp_bal</block> - <block>channels_phase_bal</block> - <block>channels_cfo_model</block> - <block>channels_sro_model</block> - </cat> -</cat> - diff --git a/gr-channels/grc/channels_cfo_model.block.yml b/gr-channels/grc/channels_cfo_model.block.yml new file mode 100644 index 0000000000..daa4eb7032 --- /dev/null +++ b/gr-channels/grc/channels_cfo_model.block.yml @@ -0,0 +1,44 @@ +id: channels_cfo_model +label: CFO Model + +parameters: +- id: srate + label: Sample Rate Hz + dtype: real + default: samp_rate +- id: stdev + label: CFO Standard Deviation Hz per sample + dtype: real + default: '0.01' +- id: maxdev + label: Max CFO Bound Hz + dtype: real + default: 1e3 +- id: seed + label: Seed + dtype: int + default: '0' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: |- + channels.cfo_model( + ${srate}, + ${stdev}, + ${maxdev}, + ${seed} + ) + callbacks: + - set_std_dev(${stdev}) + - set_max_dev(${maxdev}) + - set_samp_rate(${srate}) + +file_format: 1 diff --git a/gr-channels/grc/channels_cfo_model.xml b/gr-channels/grc/channels_cfo_model.xml deleted file mode 100644 index 7d44f7fe87..0000000000 --- a/gr-channels/grc/channels_cfo_model.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##CFO Model -################################################### - --> -<block> - <name>CFO Model</name> - <key>channels_cfo_model</key> - <import>from gnuradio import channels</import> - <make>channels.cfo_model( - $srate, - $stdev, - $maxdev, - $seed -)</make> - <callback>set_std_dev($stdev)</callback> - <callback>set_max_dev($maxdev)</callback> - <callback>set_samp_rate($srate)</callback> - <param> - <name>Sample Rate Hz</name> - <key>srate</key> - <value>samp_rate</value> - <type>real</type> - </param> - <param> - <name>CFO Standard Deviation Hz per sample</name> - <key>stdev</key> - <value>0.01</value> - <type>real</type> - </param> - <param> - <name>Max CFO Bound Hz</name> - <key>maxdev</key> - <value>1e3</value> - <type>real</type> - </param> - <param> - <name>Seed</name> - <key>seed</key> - <value>0</value> - <type>int</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_channel_model.block.yml b/gr-channels/grc/channels_channel_model.block.yml new file mode 100644 index 0000000000..d2e166924e --- /dev/null +++ b/gr-channels/grc/channels_channel_model.block.yml @@ -0,0 +1,56 @@ +id: channels_channel_model +label: Channel Model + +parameters: +- id: noise_voltage + label: Noise Voltage + dtype: real + default: '0.0' +- id: freq_offset + label: Frequency Offset + dtype: real + default: '0.0' +- id: epsilon + label: Epsilon + dtype: real + default: '1.0' +- id: taps + label: Taps + dtype: complex_vector + default: 1.0 + 1.0j +- id: seed + label: Seed + dtype: int + default: '0' +- id: block_tags + label: Block Tag Propagation + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + option_attributes: + hide_block: ['', part] + hide: ${ block_tags.hide_block } + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: |- + from gnuradio import channels + from gnuradio.filter import firdes + make: "channels.channel_model(\n\tnoise_voltage=${noise_voltage},\n\tfrequency_offset=${freq_offset},\n\ + \tepsilon=${epsilon},\n\ttaps=${taps},\n\tnoise_seed=${seed},\n\tblock_tags=${block_tags}\n\ + )" + callbacks: + - set_noise_voltage(${noise_voltage}) + - set_frequency_offset(${freq_offset}) + - set_taps(${taps}) + - set_timing_offset(${epsilon}) + +file_format: 1 diff --git a/gr-channels/grc/channels_channel_model.xml b/gr-channels/grc/channels_channel_model.xml deleted file mode 100644 index 909301de94..0000000000 --- a/gr-channels/grc/channels_channel_model.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Channel Model -################################################### - --> -<block> - <name>Channel Model</name> - <key>channels_channel_model</key> - <import>from gnuradio import channels</import> - <import>from gnuradio.filter import firdes</import> - <make>channels.channel_model( - noise_voltage=$noise_voltage, - frequency_offset=$freq_offset, - epsilon=$epsilon, - taps=$taps, - noise_seed=$seed, - block_tags=$block_tags -)</make> - <callback>set_noise_voltage($noise_voltage)</callback> - <callback>set_frequency_offset($freq_offset)</callback> - <callback>set_taps($taps)</callback> - <callback>set_timing_offset($epsilon)</callback> - <param> - <name>Noise Voltage</name> - <key>noise_voltage</key> - <value>0.0</value> - <type>real</type> - </param> - <param> - <name>Frequency Offset</name> - <key>freq_offset</key> - <value>0.0</value> - <type>real</type> - </param> - <param> - <name>Epsilon</name> - <key>epsilon</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Taps</name> - <key>taps</key> - <value>1.0 + 1.0j</value> - <type>complex_vector</type> - </param> - <param> - <name>Seed</name> - <key>seed</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Block Tag Propagation</name> - <key>block_tags</key> - <value>False</value> - <type>enum</type> - <hide>$block_tags.hide_block</hide> - <option> - <name>Yes</name> - <key>True</key> - <opt>hide_block:</opt> - </option> - <option> - <name>No</name> - <key>False</key> - <opt>hide_block:part</opt> - </option> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_channel_model2.block.yml b/gr-channels/grc/channels_channel_model2.block.yml new file mode 100644 index 0000000000..f42a77c8dd --- /dev/null +++ b/gr-channels/grc/channels_channel_model2.block.yml @@ -0,0 +1,56 @@ +id: channels_channel_model2 +label: Channel Model 2 + +parameters: +- id: noise_voltage + label: Noise Voltage + dtype: real + default: '0.0' +- id: epsilon + label: Time Offset + dtype: real + default: '1.0' +- id: taps + label: Taps + dtype: complex_vector + default: 1.0 + 1.0j +- id: seed + label: Seed + dtype: int + default: '0' +- id: block_tags + label: Block Tag Propagation + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + option_attributes: + hide_block: ['', part] + hide: ${ block_tags.hide_block } + +inputs: +- domain: stream + dtype: complex +- label: freq + domain: stream + dtype: float +- label: time + domain: stream + dtype: float + +outputs: +- domain: stream + dtype: complex + +templates: + imports: |- + from gnuradio import channels + from gnuradio.filter import firdes + make: "channels.channel_model2(\n\tnoise_voltage=${noise_voltage},\n\tepsilon=${epsilon},\n\ + \ttaps=${taps},\n\tnoise_seed=${seed},\n\tblock_tags=${block_tags}\n)" + callbacks: + - set_noise_voltage(${noise_voltage}) + - set_taps(${taps}) + - set_timing_offset(${epsilon}) + +file_format: 1 diff --git a/gr-channels/grc/channels_channel_model2.xml b/gr-channels/grc/channels_channel_model2.xml deleted file mode 100644 index 85355a1029..0000000000 --- a/gr-channels/grc/channels_channel_model2.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Channel Model -################################################### - --> -<block> - <name>Channel Model 2</name> - <key>channels_channel_model2</key> - <import>from gnuradio import channels</import> - <import>from gnuradio.filter import firdes</import> - <make>channels.channel_model2( - noise_voltage=$noise_voltage, - epsilon=$epsilon, - taps=$taps, - noise_seed=$seed, - block_tags=$block_tags -)</make> - <callback>set_noise_voltage($noise_voltage)</callback> - <callback>set_taps($taps)</callback> - <callback>set_timing_offset($epsilon)</callback> - <param> - <name>Noise Voltage</name> - <key>noise_voltage</key> - <value>0.0</value> - <type>real</type> - </param> - <param> - <name>Time Offset</name> - <key>epsilon</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Taps</name> - <key>taps</key> - <value>1.0 + 1.0j</value> - <type>complex_vector</type> - </param> - <param> - <name>Seed</name> - <key>seed</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Block Tag Propagation</name> - <key>block_tags</key> - <value>False</value> - <type>enum</type> - <hide>$block_tags.hide_block</hide> - <option> - <name>Yes</name> - <key>True</key> - <opt>hide_block:</opt> - </option> - <option> - <name>No</name> - <key>False</key> - <opt>hide_block:part</opt> - </option> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <sink> - <name>freq</name> - <type>float</type> - </sink> - <sink> - <name>time</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_conj_fs_iqcorr.block.yml b/gr-channels/grc/channels_conj_fs_iqcorr.block.yml new file mode 100644 index 0000000000..66f9e1d3a5 --- /dev/null +++ b/gr-channels/grc/channels_conj_fs_iqcorr.block.yml @@ -0,0 +1,29 @@ +id: channels_conj_fs_iqcorr +label: Freq. Selective IQ Correction + +parameters: +- id: delay + label: Delay + dtype: int + default: '0' +- id: taps + label: Taps + dtype: complex_vector + default: '0' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.conj_fs_iqcorr(${delay}, ${taps}) + callbacks: + - set_delay(${delay}) + - set_taps(${taps}) + +file_format: 1 diff --git a/gr-channels/grc/channels_conj_fs_iqcorr.xml b/gr-channels/grc/channels_conj_fs_iqcorr.xml deleted file mode 100644 index 354f1a2030..0000000000 --- a/gr-channels/grc/channels_conj_fs_iqcorr.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Freq. Selective IQ Correction -################################################### - --> -<block> - <name>Freq. Selective IQ Correction</name> - <key>channels_conj_fs_iqcorr</key> - <import>from gnuradio import channels</import> - <make>channels.conj_fs_iqcorr($delay, $taps)</make> - <callback>set_delay($delay)</callback> - <callback>set_taps($taps)</callback> - <param> - <name>Delay</name> - <key>delay</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Taps</name> - <key>taps</key> - <value>0</value> - <type>complex_vector</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_distortion_2_gen.block.yml b/gr-channels/grc/channels_distortion_2_gen.block.yml new file mode 100644 index 0000000000..f45bd06e7d --- /dev/null +++ b/gr-channels/grc/channels_distortion_2_gen.block.yml @@ -0,0 +1,24 @@ +id: channels_distortion_2_gen +label: Second Order Distortion + +parameters: +- id: beta + label: Distortion + dtype: float + default: '0' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.distortion_2_gen(${beta}) + callbacks: + - set_beta(${beta}) + +file_format: 1 diff --git a/gr-channels/grc/channels_distortion_2_gen.xml b/gr-channels/grc/channels_distortion_2_gen.xml deleted file mode 100644 index 5b117a9d00..0000000000 --- a/gr-channels/grc/channels_distortion_2_gen.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Second Order Distortion Generator -################################################### - --> -<block> - <name>Second Order Distortion</name> - <key>channels_distortion_2_gen</key> - <import>from gnuradio import channels</import> - <make>channels.distortion_2_gen($beta)</make> - <callback>set_beta($beta)</callback> - <param> - <name>Distortion</name> - <key>beta</key> - <value>0</value> - <type>float</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_distortion_3_gen.block.yml b/gr-channels/grc/channels_distortion_3_gen.block.yml new file mode 100644 index 0000000000..f92677757d --- /dev/null +++ b/gr-channels/grc/channels_distortion_3_gen.block.yml @@ -0,0 +1,24 @@ +id: channels_distortion_3_gen +label: Third Order Distortion + +parameters: +- id: beta + label: Distortion + dtype: float + default: '0' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.distortion_3_gen(${beta}) + callbacks: + - set_beta(${beta}) + +file_format: 1 diff --git a/gr-channels/grc/channels_distortion_3_gen.xml b/gr-channels/grc/channels_distortion_3_gen.xml deleted file mode 100644 index 7bf145c27e..0000000000 --- a/gr-channels/grc/channels_distortion_3_gen.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Third Order Distortion Generator -################################################### - --> -<block> - <name>Third Order Distortion</name> - <key>channels_distortion_3_gen</key> - <import>from gnuradio import channels</import> - <make>channels.distortion_3_gen($beta)</make> - <callback>set_beta($beta)</callback> - <param> - <name>Distortion</name> - <key>beta</key> - <value>0</value> - <type>float</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_dynamic_channel_model.block.yml b/gr-channels/grc/channels_dynamic_channel_model.block.yml new file mode 100644 index 0000000000..a18adf8780 --- /dev/null +++ b/gr-channels/grc/channels_dynamic_channel_model.block.yml @@ -0,0 +1,98 @@ +id: channels_dynamic_channel_model +label: Dynamic Channel Model + +parameters: +- id: samp_rate + label: Sample Rate Hz + dtype: real + default: samp_rate +- id: cfo_stdev + label: CFO Standard Deviation Hz per sample + dtype: real + default: '0.01' +- id: cfo_maxdev + label: Max CFO Bound Hz + dtype: real + default: 1e3 +- id: sro_stdev + label: SRO Standard Deviation Hz per sample + dtype: real + default: '0.01' +- id: sro_maxdev + label: Max SRO Bound Hz + dtype: real + default: 1e3 +- id: noise_amp + label: White Noise Amplitude + dtype: real + default: '1.0' +- id: N + label: Num Sinusoids (SoS model) + dtype: int + default: '8' +- id: fD + label: Max Doppler Freq (Hz) + dtype: real + default: '2.0' +- id: LOS + label: LOS Model + dtype: enum + options: ['False', 'True'] + option_labels: [Rayleigh/NLOS, Rician/LOS] + option_attributes: + hide_K: [all, ''] +- id: K + label: Rician factor (K) + dtype: real + default: '4.0' + hide: ${ LOS.hide_K } +- id: seed + label: Seed + dtype: int + default: '0' +- id: delays + label: PDP Delays (samp) + dtype: real_vector + default: 0.0,0.1,1.3 +- id: mags + label: PDP Magnitudes + dtype: real_vector + default: 1,0.99,0.97 +- id: ntaps + label: Num Taps + dtype: int + default: '8' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.dynamic_channel_model( ${samp_rate}, ${sro_stdev}, ${sro_maxdev}, + ${cfo_stdev}, ${cfo_maxdev}, ${N}, ${fD}, ${LOS}, ${K}, ${delays}, ${mags}, + ${ntaps}, ${noise_amp}, ${seed} ) + callbacks: + - set_samp_rate(${samp_rate}) + - set_sro_dev_std(${sro_stdev}) + - set_sro_dev_max(${sro_maxdev}) + - set_cfo_dev_std(${cfo_stdev}) + - set_cfo_dev_max(${cfo_maxdev}) + - set_noise_amp(${noise_amp}) + - set_doppler_freq(${fD}) + - set_K(${K}) + +documentation: |- + The dynamic channel model is a hier block consisting of the following effects: + - Dynamic Frequency Selective Fading Channel + - Dynamic Center Frequency Offset Model + - Dynamic Sample Rate Offset Model + - Additive White Gaussian Noise + + The desired power delay profile and max doppler frequency may be provided to achieve the desired Ricean or Rayleigh fading scenario. For center frequency and sample rate offset models, a gaussian random walk process is conducted for each. The single sample step variance and maximum deviation for these two processes is specified and may be modified to simulate various desired stability effects. Lastly AWGN is added to simulate a typical receiver/thermal noise floor after propagation, and the variance may be modified here as desired. + +file_format: 1 diff --git a/gr-channels/grc/channels_dynamic_channel_model.xml b/gr-channels/grc/channels_dynamic_channel_model.xml deleted file mode 100644 index d9022c5792..0000000000 --- a/gr-channels/grc/channels_dynamic_channel_model.xml +++ /dev/null @@ -1,136 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -# Dynamic Channel Model -################################################### - --> -<block> - <name>Dynamic Channel Model</name> - <key>channels_dynamic_channel_model</key> - <import>from gnuradio import channels</import> - <make>channels.dynamic_channel_model( $samp_rate, $sro_stdev, $sro_maxdev, $cfo_stdev, $cfo_maxdev, $N, $fD, $LOS, $K, $delays, $mags, $ntaps, $noise_amp, $seed )</make> - - <callback>set_samp_rate($samp_rate)</callback> - <callback>set_sro_dev_std($sro_stdev)</callback> - <callback>set_sro_dev_max($sro_maxdev)</callback> - <callback>set_cfo_dev_std($cfo_stdev)</callback> - <callback>set_cfo_dev_max($cfo_maxdev)</callback> - <callback>set_noise_amp($noise_amp)</callback> - <callback>set_doppler_freq($fD)</callback> - <callback>set_K($K)</callback> - - <param> - <name>Sample Rate Hz</name> - <key>samp_rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - <param> - <name>CFO Standard Deviation Hz per sample</name> - <key>cfo_stdev</key> - <value>0.01</value> - <type>real</type> - </param> - <param> - <name>Max CFO Bound Hz</name> - <key>cfo_maxdev</key> - <value>1e3</value> - <type>real</type> - </param> - - <param> - <name>SRO Standard Deviation Hz per sample</name> - <key>sro_stdev</key> - <value>0.01</value> - <type>real</type> - </param> - <param> - <name>Max SRO Bound Hz</name> - <key>sro_maxdev</key> - <value>1e3</value> - <type>real</type> - </param> - - <param> - <name>White Noise Amplitude</name> - <key>noise_amp</key> - <value>1.0</value> - <type>real</type> - </param> - - <param> - <name>Num Sinusoids (SoS model)</name> - <key>N</key> - <value>8</value> - <type>int</type> - </param> - <param> - <name>Max Doppler Freq (Hz)</name> - <key>fD</key> - <value>2.0</value> - <type>real</type> - </param> - <param> - <name>LOS Model</name> - <key>LOS</key> - <type>enum</type> - <option> - <name>Rayleigh/NLOS</name> - <key>False</key> - <opt>hide_K:all</opt> - </option> - <option> - <name>Rician/LOS</name> - <key>True</key> - <opt>hide_K:</opt> - </option> - </param> - <param> - <name>Rician factor (K)</name> - <key>K</key> - <value>4.0</value> - <type>real</type> - <hide>$LOS.hide_K</hide> - </param> - <param> - <name>Seed</name> - <key>seed</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>PDP Delays (samp)</name> - <key>delays</key> - <value>0.0,0.1,1.3</value> - <type>real_vector</type> - </param> - <param> - <name>PDP Magnitudes</name> - <key>mags</key> - <value>1,0.99,0.97</value> - <type>real_vector</type> - </param> - <param> - <name>Num Taps</name> - <key>ntaps</key> - <value>8</value> - <type>int</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> - <doc> - The dynamic channel model is a hier block consisting of the following effects: - - Dynamic Frequency Selective Fading Channel - - Dynamic Center Frequency Offset Model - - Dynamic Sample Rate Offset Model - - Additive White Gaussian Noise - - The desired power delay profile and max doppler frequency may be provided to achieve the desired Ricean or Rayleigh fading scenario. For center frequency and sample rate offset models, a gaussian random walk process is conducted for each. The single sample step variance and maximum deviation for these two processes is specified and may be modified to simulate various desired stability effects. Lastly AWGN is added to simulate a typical receiver/thermal noise floor after propagation, and the variance may be modified here as desired. - </doc> -</block> diff --git a/gr-channels/grc/channels_fading_model.block.yml b/gr-channels/grc/channels_fading_model.block.yml new file mode 100644 index 0000000000..7e1587feb6 --- /dev/null +++ b/gr-channels/grc/channels_fading_model.block.yml @@ -0,0 +1,57 @@ +id: channels_fading_model +label: Fading Model + +parameters: +- id: N + label: Num Sinusoids (SoS model) + dtype: int + default: '8' +- id: fDTs + label: Normalized Max Doppler (fD*Ts) + dtype: real + default: 10.0/samp_rate +- id: LOS + label: LOS Model + dtype: enum + options: ['False', 'True'] + option_labels: [Rayleigh/NLOS, Rician/LOS] + option_attributes: + hide_K: [all, ''] +- id: K + label: Rician factor (K) + dtype: real + default: '4.0' + hide: ${ LOS.hide_K } +- id: seed + label: Seed + dtype: int + default: '0' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.fading_model( ${N}, ${fDTs}, ${LOS}, ${K}, ${seed} ) + callbacks: + - set_fDTs(${fDTs}) + - set_K(${K}) + +documentation: |- + This algorithm implements the method described in + Compact Rayleigh and Rician fading simulator based on random walk processes + A. Alimohammad S.F. Fard B.F. Cockburn C. Schlegel + 26th November 2008 + + int d_N=8; // number of sinusoids + float d_fDTs=0.01 // normalized maximum doppler frequency (f_doppler / f_samprate) + float d_K=4; // Rician factor (ratio of the specular power to the scattered power) + bool d_LOS=true; // LOS path exists? chooses Rician (LOS) vs Rayleigh (NLOS) model. + int seed=0; // noise seed + +file_format: 1 diff --git a/gr-channels/grc/channels_fading_model.xml b/gr-channels/grc/channels_fading_model.xml deleted file mode 100644 index d47f0624f1..0000000000 --- a/gr-channels/grc/channels_fading_model.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Fading Model -################################################### - --> -<block> - <name>Fading Model</name> - <key>channels_fading_model</key> - <import>from gnuradio import channels</import> - <make>channels.fading_model( $N, $fDTs, $LOS, $K, $seed )</make> - <callback>set_fDTs($fDTs)</callback> - <callback>set_K($K)</callback> - <param> - <name>Num Sinusoids (SoS model)</name> - <key>N</key> - <value>8</value> - <type>int</type> - </param> - <param> - <name>Normalized Max Doppler (fD*Ts)</name> - <key>fDTs</key> - <value>10.0/samp_rate</value> - <type>real</type> - </param> - <param> - <name>LOS Model</name> - <key>LOS</key> - <type>enum</type> - <option> - <name>Rayleigh/NLOS</name> - <key>False</key> - <opt>hide_K:all</opt> - </option> - <option> - <name>Rician/LOS</name> - <key>True</key> - <opt>hide_K:</opt> - </option> - </param> - <param> - <name>Rician factor (K)</name> - <key>K</key> - <value>4.0</value> - <type>real</type> - <hide>$LOS.hide_K</hide> - </param> - <param> - <name>Seed</name> - <key>seed</key> - <value>0</value> - <type>int</type> - </param> - - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> - <doc> - This algorithm implements the method described in - Compact Rayleigh and Rician fading simulator based on random walk processes - A. Alimohammad S.F. Fard B.F. Cockburn C. Schlegel - 26th November 2008 - - int d_N=8; // number of sinusoids - float d_fDTs=0.01 // normalized maximum doppler frequency (f_doppler / f_samprate) - float d_K=4; // Rician factor (ratio of the specular power to the scattered power) - bool d_LOS=true; // LOS path exists? chooses Rician (LOS) vs Rayleigh (NLOS) model. - int seed=0; // noise seed - </doc> -</block> diff --git a/gr-channels/grc/channels_impairments.block.yml b/gr-channels/grc/channels_impairments.block.yml new file mode 100644 index 0000000000..ccbdff9f45 --- /dev/null +++ b/gr-channels/grc/channels_impairments.block.yml @@ -0,0 +1,60 @@ +id: channels_impairments +label: HW Impairments + +parameters: +- id: phase_noise_mag + label: Phase Noise Mag. + dtype: float + default: '0' +- id: magbal + label: IQ Mag. Imbalance + dtype: float + default: '0' +- id: phasebal + label: IQ Phase. Imbalance + dtype: float + default: '0' +- id: q_ofs + label: Quadrature Offset + dtype: float + default: '0' +- id: i_ofs + label: Inphase Offset + dtype: float + default: '0' +- id: freq_offset + label: Frequency Offset + dtype: float + default: '0' +- id: gamma + label: Second Order Distortion + dtype: float + default: '0' +- id: beta + label: Third Order Distortion + dtype: float + default: '0' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.impairments(${phase_noise_mag}, ${magbal}, ${phasebal}, ${q_ofs}, + ${i_ofs}, ${freq_offset}, ${gamma}, ${beta}) + callbacks: + - set_phase_noise_mag(${phase_noise_mag}) + - set_magbal(${magbal}) + - set_phasebal(${phasebal}) + - set_q_ofs(${q_ofs}) + - set_i_ofs(${i_ofs}) + - set_freq_offset(${freq_offset}) + - set_gamma(${gamma}) + - set_beta(${beta}) + +file_format: 1 diff --git a/gr-channels/grc/channels_impairments.xml b/gr-channels/grc/channels_impairments.xml deleted file mode 100644 index 12ee65c740..0000000000 --- a/gr-channels/grc/channels_impairments.xml +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Impairments Model -################################################### - --> -<block> - <name>HW Impairments</name> - <key>channels_impairments</key> - <import>from gnuradio import channels</import> - <make>channels.impairments($phase_noise_mag, $magbal, $phasebal, $q_ofs, $i_ofs, $freq_offset, $gamma, $beta)</make> - <callback>set_phase_noise_mag($phase_noise_mag)</callback> - <callback>set_magbal($magbal)</callback> - <callback>set_phasebal($phasebal)</callback> - <callback>set_q_ofs($q_ofs)</callback> - <callback>set_i_ofs($i_ofs)</callback> - <callback>set_freq_offset($freq_offset)</callback> - <callback>set_gamma($gamma)</callback> - <callback>set_beta($beta)</callback> - <param> - <name>Phase Noise Mag.</name> - <key>phase_noise_mag</key> - <value>0</value> - <type>float</type> - </param> - <param> - <name>IQ Mag. Imbalance</name> - <key>magbal</key> - <value>0</value> - <type>float</type> - </param> - <param> - <name>IQ Phase. Imbalance</name> - <key>phasebal</key> - <value>0</value> - <type>float</type> - </param> - <param> - <name>Quadrature Offset</name> - <key>q_ofs</key> - <value>0</value> - <type>float</type> - </param> - <param> - <name>Inphase Offset</name> - <key>i_ofs</key> - <value>0</value> - <type>float</type> - </param> - <param> - <name>Frequency Offset</name> - <key>freq_offset</key> - <value>0</value> - <type>float</type> - </param> - <param> - <name>Second Order Distortion</name> - <key>gamma</key> - <value>0</value> - <type>float</type> - </param> - <param> - <name>Third Order Distortion</name> - <key>beta</key> - <value>0</value> - <type>float</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_iqbal_gen.block.yml b/gr-channels/grc/channels_iqbal_gen.block.yml new file mode 100644 index 0000000000..5b424761c1 --- /dev/null +++ b/gr-channels/grc/channels_iqbal_gen.block.yml @@ -0,0 +1,29 @@ +id: channels_iqbal_gen +label: IQ Imbalance Generator + +parameters: +- id: mag + label: Magnitude + dtype: float + default: '0' +- id: phase + label: Phase + dtype: float + default: '0' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.iqbal_gen(${mag}, ${phase}) + callbacks: + - set_magnitude(${mag}) + - set_phase(${phase}) + +file_format: 1 diff --git a/gr-channels/grc/channels_iqbal_gen.xml b/gr-channels/grc/channels_iqbal_gen.xml deleted file mode 100644 index 9cb267adec..0000000000 --- a/gr-channels/grc/channels_iqbal_gen.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##IQ Imbalance Generator -################################################### - --> -<block> - <name>IQ Imbalance Generator</name> - <key>channels_iqbal_gen</key> - <import>from gnuradio import channels</import> - <make>channels.iqbal_gen($mag, $phase)</make> - <callback>set_magnitude($mag)</callback> - <callback>set_phase($phase)</callback> - <param> - <name>Magnitude</name> - <key>mag</key> - <value>0</value> - <type>float</type> - </param> - <param> - <name>Phase</name> - <key>phase</key> - <value>0</value> - <type>float</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_phase_bal.block.yml b/gr-channels/grc/channels_phase_bal.block.yml new file mode 100644 index 0000000000..70244cffeb --- /dev/null +++ b/gr-channels/grc/channels_phase_bal.block.yml @@ -0,0 +1,24 @@ +id: channels_phase_bal +label: Phase Balance + +parameters: +- id: alpha + label: Alpha + dtype: float + default: '0' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.phase_bal(${alpha}) + callbacks: + - set_alpha(${alpha}) + +file_format: 1 diff --git a/gr-channels/grc/channels_phase_bal.xml b/gr-channels/grc/channels_phase_bal.xml deleted file mode 100644 index ce17ab79ab..0000000000 --- a/gr-channels/grc/channels_phase_bal.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Phase balance -################################################### - --> -<block> - <name>Phase Balance</name> - <key>channels_phase_bal</key> - <import>from gnuradio import channels</import> - <make>channels.phase_bal($alpha)</make> - <callback>set_alpha($alpha)</callback> - <param> - <name>Alpha</name> - <key>alpha</key> - <value>0</value> - <type>float</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_phase_noise_gen.block.yml b/gr-channels/grc/channels_phase_noise_gen.block.yml new file mode 100644 index 0000000000..1310caad89 --- /dev/null +++ b/gr-channels/grc/channels_phase_noise_gen.block.yml @@ -0,0 +1,29 @@ +id: channels_phase_noise_gen +label: Phase Noise Generator + +parameters: +- id: noise_mag + label: Noise Magnitude + dtype: float + default: '0' +- id: alpha + label: Alpha + dtype: float + default: '0.1' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.phase_noise_gen(${noise_mag}, ${alpha}) + callbacks: + - set_noise_mag(${noise_mag}) + - set_alpha(${alpha}) + +file_format: 1 diff --git a/gr-channels/grc/channels_phase_noise_gen.xml b/gr-channels/grc/channels_phase_noise_gen.xml deleted file mode 100644 index 852b4c9966..0000000000 --- a/gr-channels/grc/channels_phase_noise_gen.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Phase Noise Generator -################################################### - --> -<block> - <name>Phase Noise Generator</name> - <key>channels_phase_noise_gen</key> - <import>from gnuradio import channels</import> - <make>channels.phase_noise_gen($noise_mag, $alpha)</make> - <callback>set_noise_mag($noise_mag)</callback> - <callback>set_alpha($alpha)</callback> - <param> - <name>Noise Magnitude</name> - <key>noise_mag</key> - <value>0</value> - <type>float</type> - </param> - <param> - <name>Alpha</name> - <key>alpha</key> - <value>0.1</value> - <type>float</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/grc/channels_quantizer.block.yml b/gr-channels/grc/channels_quantizer.block.yml new file mode 100644 index 0000000000..68fcf50299 --- /dev/null +++ b/gr-channels/grc/channels_quantizer.block.yml @@ -0,0 +1,24 @@ +id: channels_quantizer +label: Quantizer + +parameters: +- id: bits + label: Bits + dtype: int + default: '16' + +inputs: +- domain: stream + dtype: float + +outputs: +- domain: stream + dtype: float + +templates: + imports: from gnuradio import channels + make: channels.quantizer(${bits}) + callbacks: + - set_bits(${bits}) + +file_format: 1 diff --git a/gr-channels/grc/channels_quantizer.xml b/gr-channels/grc/channels_quantizer.xml deleted file mode 100644 index 57bed74ee7..0000000000 --- a/gr-channels/grc/channels_quantizer.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Quantization -################################################### - --> -<block> - <name>Quantizer</name> - <key>channels_quantizer</key> - <import>from gnuradio import channels</import> - <make>channels.quantizer($bits)</make> - <callback>set_bits($bits)</callback> - <param> - <name>Bits</name> - <key>bits</key> - <value>16</value> - <type>int</type> - </param> - <sink> - <name>in</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>float</type> - </source> -</block> diff --git a/gr-channels/grc/channels_selective_fading_model.block.yml b/gr-channels/grc/channels_selective_fading_model.block.yml new file mode 100644 index 0000000000..9898ee75ab --- /dev/null +++ b/gr-channels/grc/channels_selective_fading_model.block.yml @@ -0,0 +1,87 @@ +id: channels_selective_fading_model +label: Frequency Selective Fading Model + +parameters: +- id: N + label: Num Sinusoids (SoS model) + dtype: int + default: '8' +- id: fDTs + label: Normalized Max Doppler (fD*Ts) + dtype: real + default: 10.0/samp_rate +- id: LOS + label: LOS Model + dtype: enum + options: ['False', 'True'] + option_labels: [Rayleigh/NLOS, Rician/LOS] + option_attributes: + hide_K: [all, ''] +- id: K + label: Rician factor (K) + dtype: real + default: '4.0' + hide: ${ LOS.hide_K } +- id: seed + label: Seed + dtype: int + default: '0' +- id: delays + label: PDP Delays (samp) + dtype: real_vector + default: 0.0,0.1,1.3 +- id: mags + label: PDP Magnitudes + dtype: real_vector + default: 1,0.99,0.97 +- id: ntaps + label: Num Taps + dtype: int + default: '8' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: channels.selective_fading_model( ${N}, ${fDTs}, ${LOS}, ${K}, ${seed}, ${delays}, + ${mags}, ${ntaps} ) + callbacks: + - set_fDTs(${fDTs}) + - set_K(${K}) + +documentation: |- + int d_N=8; // number of sinusoids used to simulate gain on each ray + float d_fDTs=0.01 // normalized maximum doppler frequency (f_doppler / f_samprate) + float d_K=4; // Rician factor (ratio of the specular power to the scattered power) + bool d_LOS=true; // LOS path exists? chooses Rician (LOS) vs Rayleigh (NLOS) model. + int seed=0; // noise seed + int ntaps; // Number of FIR taps to use in selective fading model + + These two vectors comprise the Power Delay Profile of the signal + float_vector delays // Time delay in the fir filter (in samples) for each arriving WSSUS Ray + float_vector mags // Magnitude corresponding to each WSSUS Ray + + If using a LOS model, the first delay and mag should correspond with the LOS component + + References: + + The flat-fading portion of the algorithm implements the following + Compact Rayleigh and Rician fading simulator based on random walk processes + A. Alimohammad S.F. Fard B.F. Cockburn C. Schlegel + 26th November 2008 + + The frequency selective extension of the block roughly implements + A Low-Complexity Hardware Implementation of Discrete-Time + Frequency-Selective Rayleigh Fading Channels + F. Ren and Y. Zheng + 24-27 May 2009 + + Implementation by Tim O'Shea + +file_format: 1 diff --git a/gr-channels/grc/channels_selective_fading_model.xml b/gr-channels/grc/channels_selective_fading_model.xml deleted file mode 100644 index c9b89a0da9..0000000000 --- a/gr-channels/grc/channels_selective_fading_model.xml +++ /dev/null @@ -1,109 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Frequency Selective Fading Model -################################################### - --> -<block> - <name>Frequency Selective Fading Model</name> - <key>channels_selective_fading_model</key> - <import>from gnuradio import channels</import> - <make>channels.selective_fading_model( $N, $fDTs, $LOS, $K, $seed, $delays, $mags, $ntaps )</make> - <callback>set_fDTs($fDTs)</callback> - <callback>set_K($K)</callback> - <param> - <name>Num Sinusoids (SoS model)</name> - <key>N</key> - <value>8</value> - <type>int</type> - </param> - <param> - <name>Normalized Max Doppler (fD*Ts)</name> - <key>fDTs</key> - <value>10.0/samp_rate</value> - <type>real</type> - </param> - <param> - <name>LOS Model</name> - <key>LOS</key> - <type>enum</type> - <option> - <name>Rayleigh/NLOS</name> - <key>False</key> - <opt>hide_K:all</opt> - </option> - <option> - <name>Rician/LOS</name> - <key>True</key> - <opt>hide_K:</opt> - </option> - </param> - <param> - <name>Rician factor (K)</name> - <key>K</key> - <value>4.0</value> - <type>real</type> - <hide>$LOS.hide_K</hide> - </param> - <param> - <name>Seed</name> - <key>seed</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>PDP Delays (samp)</name> - <key>delays</key> - <value>0.0,0.1,1.3</value> - <type>real_vector</type> - </param> - <param> - <name>PDP Magnitudes</name> - <key>mags</key> - <value>1,0.99,0.97</value> - <type>real_vector</type> - </param> - <param> - <name>Num Taps</name> - <key>ntaps</key> - <value>8</value> - <type>int</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> - <doc> - int d_N=8; // number of sinusoids used to simulate gain on each ray - float d_fDTs=0.01 // normalized maximum doppler frequency (f_doppler / f_samprate) - float d_K=4; // Rician factor (ratio of the specular power to the scattered power) - bool d_LOS=true; // LOS path exists? chooses Rician (LOS) vs Rayleigh (NLOS) model. - int seed=0; // noise seed - int ntaps; // Number of FIR taps to use in selective fading model - - These two vectors comprise the Power Delay Profile of the signal - float_vector delays // Time delay in the fir filter (in samples) for each arriving WSSUS Ray - float_vector mags // Magnitude corresponding to each WSSUS Ray - - If using a LOS model, the first delay and mag should correspond with the LOS component - - References: - - The flat-fading portion of the algorithm implements the following - Compact Rayleigh and Rician fading simulator based on random walk processes - A. Alimohammad S.F. Fard B.F. Cockburn C. Schlegel - 26th November 2008 - - The frequency selective extension of the block roughly implements - A Low-Complexity Hardware Implementation of Discrete-Time - Frequency-Selective Rayleigh Fading Channels - F. Ren and Y. Zheng - 24-27 May 2009 - - Implementation by Tim O'Shea - </doc> -</block> diff --git a/gr-channels/grc/channels_selective_fading_model2.block.yml b/gr-channels/grc/channels_selective_fading_model2.block.yml new file mode 100644 index 0000000000..1506c03fbc --- /dev/null +++ b/gr-channels/grc/channels_selective_fading_model2.block.yml @@ -0,0 +1,100 @@ +id: channels_selective_fading_model2 +label: Frequency Selective Fading Model2 + +parameters: +- id: N + label: Num Sinusoids (Stochastic SoS model + delay drift) + dtype: int + default: '8' +- id: fDTs + label: Normalized Max Doppler (fD*Ts) + dtype: real + default: 0.2/samp_rate +- id: LOS + label: LOS Model + dtype: enum + options: ['False', 'True'] + option_labels: [Rayleigh/NLOS, Rician/LOS] + option_attributes: + hide_K: [all, ''] +- id: K + label: Rician factor (K) + dtype: real + default: '4.0' + hide: ${ LOS.hide_K } +- id: seed + label: Seed + dtype: int + default: '0' +- id: delays + label: PDP Delays (in samps) + dtype: real_vector + default: 1.0,1.9,2.7 +- id: delay_std + label: PDP Delay StdDev (per samp) + dtype: real_vector + default: 1e-4,1e-4,1e-4 +- id: delay_maxdev + label: PDP Delay Max-Dev (per samp) + dtype: real_vector + default: 0.5,0.7,0.9 +- id: mags + label: PDP Magnitudes + dtype: real_vector + default: 1,0.95,0.8 +- id: ntaps + label: Num Taps + dtype: int + default: '8' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex +- domain: message + id: taps + optional: true + +templates: + imports: from gnuradio import channels + make: channels.selective_fading_model2( ${N}, ${fDTs}, ${LOS}, ${K}, ${seed}, + ${delays}, ${delay_std}, ${delay_maxdev}, ${mags}, ${ntaps} ) + callbacks: + - set_fDTs(${fDTs}) + - set_K(${K}) + +documentation: |- + int d_N=8; // number of sinusoids used to simulate gain on each ray + float d_fDTs=0.01 // normalized maximum doppler frequency (f_doppler / f_samprate) + float d_K=4; // Rician factor (ratio of the specular power to the scattered power) + bool d_LOS=true; // LOS path exists? chooses Rician (LOS) vs Rayleigh (NLOS) model. + int seed=0; // noise seed + int ntaps; // Number of FIR taps to use in selective fading model + + These two vectors comprise the Power Delay Profile of the signal + float_vector delays // Time delay in the fir filter (in samples) for each arriving WSSUS Ray + float_vector mags // Magnitude corresponding to each WSSUS Ray + + If using a LOS model, the first delay and mag should correspond with the LOS component + + References: + + The flat-fading portion of the algorithm implements the following + Compact Rayleigh and Rician fading simulator based on random walk processes + A. Alimohammad S.F. Fard B.F. Cockburn C. Schlegel + 26th November 2008 + (Alogrithm III) + ( with a novel addition of time delay tap random walk ) + + The frequency selective extension of the block roughly implements + A Low-Complexity Hardware Implementation of Discrete-Time + Frequency-Selective Rayleigh Fading Channels + F. Ren and Y. Zheng + 24-27 May 2009 + + Implementation by Tim O'Shea + +file_format: 1 diff --git a/gr-channels/grc/channels_selective_fading_model2.xml b/gr-channels/grc/channels_selective_fading_model2.xml deleted file mode 100644 index 1e1ea3a70c..0000000000 --- a/gr-channels/grc/channels_selective_fading_model2.xml +++ /dev/null @@ -1,128 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Frequency Selective Fading Model -################################################### - --> -<block> - <name>Frequency Selective Fading Model2</name> - <key>channels_selective_fading_model2</key> - <import>from gnuradio import channels</import> - <make>channels.selective_fading_model2( $N, $fDTs, $LOS, $K, $seed, $delays, $delay_std, $delay_maxdev, $mags, $ntaps )</make> - <callback>set_fDTs($fDTs)</callback> - <callback>set_K($K)</callback> - <param> - <name>Num Sinusoids (Stochastic SoS model + delay drift)</name> - <key>N</key> - <value>8</value> - <type>int</type> - </param> - <param> - <name>Normalized Max Doppler (fD*Ts)</name> - <key>fDTs</key> - <value>0.2/samp_rate</value> - <type>real</type> - </param> - <param> - <name>LOS Model</name> - <key>LOS</key> - <type>enum</type> - <option> - <name>Rayleigh/NLOS</name> - <key>False</key> - <opt>hide_K:all</opt> - </option> - <option> - <name>Rician/LOS</name> - <key>True</key> - <opt>hide_K:</opt> - </option> - </param> - <param> - <name>Rician factor (K)</name> - <key>K</key> - <value>4.0</value> - <type>real</type> - <hide>$LOS.hide_K</hide> - </param> - <param> - <name>Seed</name> - <key>seed</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>PDP Delays (in samps)</name> - <key>delays</key> - <value>1.0,1.9,2.7</value> - <type>real_vector</type> - </param> - <param> - <name>PDP Delay StdDev (per samp)</name> - <key>delay_std</key> - <value>1e-4,1e-4,1e-4</value> - <type>real_vector</type> - </param> - <param> - <name>PDP Delay Max-Dev (per samp)</name> - <key>delay_maxdev</key> - <value>0.5,0.7,0.9</value> - <type>real_vector</type> - </param> - <param> - <name>PDP Magnitudes</name> - <key>mags</key> - <value>1,0.95,0.8</value> - <type>real_vector</type> - </param> - <param> - <name>Num Taps</name> - <key>ntaps</key> - <value>8</value> - <type>int</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> - <source> - <name>taps</name> - <type>message</type> - <optional>1</optional> - </source> - <doc> - int d_N=8; // number of sinusoids used to simulate gain on each ray - float d_fDTs=0.01 // normalized maximum doppler frequency (f_doppler / f_samprate) - float d_K=4; // Rician factor (ratio of the specular power to the scattered power) - bool d_LOS=true; // LOS path exists? chooses Rician (LOS) vs Rayleigh (NLOS) model. - int seed=0; // noise seed - int ntaps; // Number of FIR taps to use in selective fading model - - These two vectors comprise the Power Delay Profile of the signal - float_vector delays // Time delay in the fir filter (in samples) for each arriving WSSUS Ray - float_vector mags // Magnitude corresponding to each WSSUS Ray - - If using a LOS model, the first delay and mag should correspond with the LOS component - - References: - - The flat-fading portion of the algorithm implements the following - Compact Rayleigh and Rician fading simulator based on random walk processes - A. Alimohammad S.F. Fard B.F. Cockburn C. Schlegel - 26th November 2008 - (Alogrithm III) - ( with a novel addition of time delay tap random walk ) - - The frequency selective extension of the block roughly implements - A Low-Complexity Hardware Implementation of Discrete-Time - Frequency-Selective Rayleigh Fading Channels - F. Ren and Y. Zheng - 24-27 May 2009 - - Implementation by Tim O'Shea - </doc> -</block> diff --git a/gr-channels/grc/channels_sro_model.block.yml b/gr-channels/grc/channels_sro_model.block.yml new file mode 100644 index 0000000000..8da9a5b25b --- /dev/null +++ b/gr-channels/grc/channels_sro_model.block.yml @@ -0,0 +1,44 @@ +id: channels_sro_model +label: SRO Model + +parameters: +- id: srate + label: Sample Rate Hz + dtype: real + default: samp_rate +- id: stdev + label: SRO Standard Deviation Hz per sample + dtype: real + default: '0.01' +- id: maxdev + label: Max SRO Bound Hz + dtype: real + default: 1e3 +- id: seed + label: Seed + dtype: int + default: '0' + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import channels + make: |- + channels.sro_model( + ${srate}, + ${stdev}, + ${maxdev}, + ${seed} + ) + callbacks: + - set_std_dev(${stdev}) + - set_max_dev(${maxdev}) + - set_samp_rate(${srate}) + +file_format: 1 diff --git a/gr-channels/grc/channels_sro_model.xml b/gr-channels/grc/channels_sro_model.xml deleted file mode 100644 index 63752aaefd..0000000000 --- a/gr-channels/grc/channels_sro_model.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##SRO Model -################################################### - --> -<block> - <name>SRO Model</name> - <key>channels_sro_model</key> - <import>from gnuradio import channels</import> - <make>channels.sro_model( - $srate, - $stdev, - $maxdev, - $seed -)</make> - <callback>set_std_dev($stdev)</callback> - <callback>set_max_dev($maxdev)</callback> - <callback>set_samp_rate($srate)</callback> - <param> - <name>Sample Rate Hz</name> - <key>srate</key> - <value>samp_rate</value> - <type>real</type> - </param> - <param> - <name>SRO Standard Deviation Hz per sample</name> - <key>stdev</key> - <value>0.01</value> - <type>real</type> - </param> - <param> - <name>Max SRO Bound Hz</name> - <key>maxdev</key> - <value>1e3</value> - <type>real</type> - </param> - <param> - <name>Seed</name> - <key>seed</key> - <value>0</value> - <type>int</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/gr-channels/python/channels/CMakeLists.txt b/gr-channels/python/channels/CMakeLists.txt index a91033df75..391b868931 100644 --- a/gr-channels/python/channels/CMakeLists.txt +++ b/gr-channels/python/channels/CMakeLists.txt @@ -50,6 +50,6 @@ if(ENABLE_TESTING) file (GLOB py_qa_test_files "qa_*.py") foreach(py_qa_test_file ${py_qa_test_files}) get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) - GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) + GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} -B ${py_qa_test_file}) endforeach(py_qa_test_file) endif(ENABLE_TESTING) diff --git a/gr-channels/python/channels/__init__.py b/gr-channels/python/channels/__init__.py index ae4c4ab715..1bae9b44e2 100644 --- a/gr-channels/python/channels/__init__.py +++ b/gr-channels/python/channels/__init__.py @@ -22,23 +22,25 @@ ''' Blocks for channel models and related functions. ''' +from __future__ import absolute_import +from __future__ import unicode_literals import os try: - from channels_swig import * + from .channels_swig import * except ImportError: dirname, filename = os.path.split(os.path.abspath(__file__)) __path__.append(os.path.join(dirname, "..", "..", "swig")) - from channels_swig import * + from .channels_swig import * # Blocks for Hardware Impairments -from amp_bal import * -from conj_fs_iqcorr import * -from distortion_2_gen import * -from distortion_3_gen import * -from iqbal_gen import * -from impairments import * -from phase_bal import * -from phase_noise_gen import * -from quantizer import * +from .amp_bal import * +from .conj_fs_iqcorr import * +from .distortion_2_gen import * +from .distortion_3_gen import * +from .iqbal_gen import * +from .impairments import * +from .phase_bal import * +from .phase_noise_gen import * +from .quantizer import * diff --git a/gr-channels/python/channels/amp_bal.py b/gr-channels/python/channels/amp_bal.py index 30e0f0d8e2..0ec3db8ab5 100644 --- a/gr-channels/python/channels/amp_bal.py +++ b/gr-channels/python/channels/amp_bal.py @@ -7,6 +7,7 @@ # Generated: Thu Aug 1 11:47:46 2013 ################################################## +from __future__ import unicode_literals from gnuradio import blocks from gnuradio import gr from gnuradio.filter import firdes diff --git a/gr-channels/python/channels/conj_fs_iqcorr.py b/gr-channels/python/channels/conj_fs_iqcorr.py index 700eb645c2..f9873f1606 100644 --- a/gr-channels/python/channels/conj_fs_iqcorr.py +++ b/gr-channels/python/channels/conj_fs_iqcorr.py @@ -7,6 +7,7 @@ # Generated: Thu Aug 1 13:00:27 2013 ################################################## +from __future__ import unicode_literals from gnuradio import blocks from gnuradio import filter from gnuradio import gr diff --git a/gr-channels/python/channels/distortion_2_gen.py b/gr-channels/python/channels/distortion_2_gen.py index f8933cf7aa..cf44fd8d29 100644 --- a/gr-channels/python/channels/distortion_2_gen.py +++ b/gr-channels/python/channels/distortion_2_gen.py @@ -6,6 +6,7 @@ # Generated: Thu Aug 1 12:30:23 2013 ################################################## +from __future__ import unicode_literals from gnuradio import blocks from gnuradio import gr from gnuradio.filter import firdes diff --git a/gr-channels/python/channels/distortion_3_gen.py b/gr-channels/python/channels/distortion_3_gen.py index 1607e01bf2..9cb388806e 100644 --- a/gr-channels/python/channels/distortion_3_gen.py +++ b/gr-channels/python/channels/distortion_3_gen.py @@ -6,6 +6,7 @@ # Generated: Thu Aug 1 12:37:59 2013 ################################################## +from __future__ import unicode_literals from gnuradio import blocks from gnuradio import gr from gnuradio.filter import firdes diff --git a/gr-channels/python/channels/impairments.py b/gr-channels/python/channels/impairments.py index 3da838a902..5e2319a5d9 100644 --- a/gr-channels/python/channels/impairments.py +++ b/gr-channels/python/channels/impairments.py @@ -6,6 +6,9 @@ # Generated: Thu Aug 1 12:46:10 2013 ################################################## +from __future__ import absolute_import +from __future__ import division +from __future__ import unicode_literals from gnuradio import analog from gnuradio import blocks from gnuradio import gr @@ -13,10 +16,10 @@ from gnuradio.filter import firdes import math #Import locally -from phase_noise_gen import * -from iqbal_gen import * -from distortion_2_gen import * -from distortion_3_gen import * +from .phase_noise_gen import * +from .iqbal_gen import * +from .distortion_2_gen import * +from .distortion_3_gen import * class impairments(gr.hier_block2): @@ -42,7 +45,7 @@ class impairments(gr.hier_block2): ################################################## # Blocks ################################################## - self.channels_phase_noise_gen_0_0 = phase_noise_gen(math.pow(10.0,phase_noise_mag/20.0), .01) + self.channels_phase_noise_gen_0_0 = phase_noise_gen(math.pow(10.0,phase_noise_mag / 20.0), .01) self.channels_iqbal_gen_0 = iqbal_gen(magbal, phasebal) self.channels_distortion_3_gen_0 = distortion_3_gen(beta) self.channels_distortion_2_gen_0 = distortion_2_gen(gamma) @@ -75,7 +78,7 @@ class impairments(gr.hier_block2): def set_phase_noise_mag(self, phase_noise_mag): self.phase_noise_mag = phase_noise_mag - self.channels_phase_noise_gen_0_0.set_noise_mag(math.pow(10.0,self.phase_noise_mag/20.0)) + self.channels_phase_noise_gen_0_0.set_noise_mag(math.pow(10.0,self.phase_noise_mag / 20.0)) def get_magbal(self): return self.magbal diff --git a/gr-channels/python/channels/iqbal_gen.py b/gr-channels/python/channels/iqbal_gen.py index d42ca22778..bfe439350f 100644 --- a/gr-channels/python/channels/iqbal_gen.py +++ b/gr-channels/python/channels/iqbal_gen.py @@ -6,6 +6,8 @@ # Generated: Thu Aug 1 12:08:07 2013 ################################################## +from __future__ import division +from __future__ import unicode_literals from gnuradio import blocks from gnuradio import gr from gnuradio.filter import firdes @@ -29,7 +31,7 @@ class iqbal_gen(gr.hier_block2): ################################################## # Blocks ################################################## - self.mag = blocks.multiply_const_vff((math.pow(10,magnitude/20.0), )) + self.mag = blocks.multiply_const_vff((math.pow(10,magnitude / 20.0), )) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff((math.sin(phase*math.pi/180.0), )) self.blocks_float_to_complex_0 = blocks.float_to_complex(1) self.blocks_complex_to_float_0 = blocks.complex_to_float(1) @@ -55,7 +57,7 @@ class iqbal_gen(gr.hier_block2): def set_magnitude(self, magnitude): self.magnitude = magnitude - self.mag.set_k((math.pow(10,self.magnitude/20.0), )) + self.mag.set_k((math.pow(10,self.magnitude / 20.0), )) def get_phase(self): return self.phase diff --git a/gr-channels/python/channels/phase_bal.py b/gr-channels/python/channels/phase_bal.py index b760e6f439..2ebdebcc27 100644 --- a/gr-channels/python/channels/phase_bal.py +++ b/gr-channels/python/channels/phase_bal.py @@ -6,6 +6,7 @@ # Generated: Thu Aug 1 11:49:41 2013 ################################################## +from __future__ import unicode_literals from gnuradio import blocks from gnuradio import filter from gnuradio import gr diff --git a/gr-channels/python/channels/phase_noise_gen.py b/gr-channels/python/channels/phase_noise_gen.py index 95c5676e40..5e05c0a100 100644 --- a/gr-channels/python/channels/phase_noise_gen.py +++ b/gr-channels/python/channels/phase_noise_gen.py @@ -6,6 +6,7 @@ # Generated: Thu Aug 1 11:59:39 2013 ################################################## +from __future__ import unicode_literals from gnuradio import analog from gnuradio import blocks from gnuradio import filter diff --git a/gr-channels/python/channels/qa_channel_model.py b/gr-channels/python/channels/qa_channel_model.py index fed542f44f..53cc80f911 100755..100644 --- a/gr-channels/python/channels/qa_channel_model.py +++ b/gr-channels/python/channels/qa_channel_model.py @@ -20,6 +20,7 @@ # Boston, MA 02110-1301, USA. # + from gnuradio import gr, gr_unittest, analog, blocks, channels import math diff --git a/gr-channels/python/channels/qa_fading_model.py b/gr-channels/python/channels/qa_fading_model.py index 1e99312e82..84ca531d6d 100644 --- a/gr-channels/python/channels/qa_fading_model.py +++ b/gr-channels/python/channels/qa_fading_model.py @@ -20,6 +20,7 @@ # Boston, MA 02110-1301, USA. # + from gnuradio import gr, gr_unittest, analog, blocks, channels import math diff --git a/gr-channels/python/channels/quantizer.py b/gr-channels/python/channels/quantizer.py index a3d918c7c2..897a1eb432 100644 --- a/gr-channels/python/channels/quantizer.py +++ b/gr-channels/python/channels/quantizer.py @@ -5,6 +5,8 @@ # Generated: Thu Aug 1 11:09:51 2013 ################################################## +from __future__ import division +from __future__ import unicode_literals from gnuradio import blocks from gnuradio import gr from gnuradio.filter import firdes @@ -27,7 +29,7 @@ class quantizer(gr.hier_block2): # Blocks ################################################## self.blocks_short_to_float_0 = blocks.short_to_float(1, 1) - self.blocks_multiply_const_vxx_0_0 = blocks.multiply_const_vff((1.0/pow(2.0,bits-1.0), )) + self.blocks_multiply_const_vxx_0_0 = blocks.multiply_const_vff((1.0 / pow(2.0,bits-1.0), )) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff((pow(2,bits-1.0), )) self.blocks_float_to_short_0 = blocks.float_to_short(1, 1) @@ -48,7 +50,7 @@ class quantizer(gr.hier_block2): def set_bits(self, bits): self.bits = bits - self.blocks_multiply_const_vxx_0_0.set_k((1.0/pow(2.0,self.bits-1.0), )) + self.blocks_multiply_const_vxx_0_0.set_k((1.0 / pow(2.0,self.bits-1.0), )) self.blocks_multiply_const_vxx_0.set_k((pow(2,self.bits-1.0), )) |