diff options
author | Johnathan Corgan | 2009-09-19 20:38:24 -0700 |
---|---|---|
committer | Johnathan Corgan | 2009-09-19 20:38:24 -0700 |
commit | 7d8dd5e122e0201d96410eec6549b903881f8b3a (patch) | |
tree | fae29c5eab77296bfbf2b7b744b79f6f7588d1f8 /grc | |
parent | 81cc58739a57946265e027b5d91365df16fbcd11 (diff) | |
download | gnuradio-7d8dd5e122e0201d96410eec6549b903881f8b3a.tar.gz gnuradio-7d8dd5e122e0201d96410eec6549b903881f8b3a.tar.bz2 gnuradio-7d8dd5e122e0201d96410eec6549b903881f8b3a.zip |
Added CVSD encoder/decoder to GRC, example app
Used blks2.cvsd* wrappers, not bare gnuradio.vocoder.cvsd*
Example application sweeps 0-4KHz through encoder/decoder pair configured
as Bluetooth standard
Diffstat (limited to 'grc')
-rw-r--r-- | grc/blocks/Makefile.am | 2 | ||||
-rw-r--r-- | grc/blocks/blks2_cvsd_decode.xml | 32 | ||||
-rw-r--r-- | grc/blocks/blks2_cvsd_encode.xml | 32 | ||||
-rw-r--r-- | grc/blocks/block_tree.xml | 5 | ||||
-rw-r--r-- | grc/examples/Makefile.am | 3 | ||||
-rw-r--r-- | grc/examples/audio/cvsd_sweep.grc | 918 |
6 files changed, 991 insertions, 1 deletions
diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index 32ddc6567..617a3bf60 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -30,6 +30,8 @@ dist_ourdata_DATA = \ band_reject_filter.xml \ blks2_am_demod_cf.xml \ blks2_analysis_filterbank.xml \ + blks2_cvsd_encode.xml \ + blks2_cvsd_decode.xml \ blks2_dxpsk_demod.xml \ blks2_dxpsk_mod.xml \ blks2_error_rate.xml \ diff --git a/grc/blocks/blks2_cvsd_decode.xml b/grc/blocks/blks2_cvsd_decode.xml new file mode 100644 index 000000000..6be7daa22 --- /dev/null +++ b/grc/blocks/blks2_cvsd_decode.xml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- +################################################### +## CVSD Encoder +################################################### + --> +<block> + <name>CVSD Decoder</name> + <key>blks2_cvsd_decode</key> + <import>from gnuradio import blks2</import> + <make>blks2.cvsd_decode($resample,$bw)</make> + <param> + <name>Resample</name> + <key>resample</key> + <value>8</value> + <type>int</type> + </param> + <param> + <name>Frac. Bandwidth</name> + <key>bw</key> + <value>0.5</value> + <type>real</type> + </param> + <sink> + <name>in</name> + <type>byte</type> + </sink> + <source> + <name>out</name> + <type>float</type> + </source> +</block> diff --git a/grc/blocks/blks2_cvsd_encode.xml b/grc/blocks/blks2_cvsd_encode.xml new file mode 100644 index 000000000..3123b1aa9 --- /dev/null +++ b/grc/blocks/blks2_cvsd_encode.xml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- +################################################### +## CVSD Encoder +################################################### + --> +<block> + <name>CVSD Encoder</name> + <key>blks2_cvsd_encode</key> + <import>from gnuradio import blks2</import> + <make>blks2.cvsd_encode($resample,$bw)</make> + <param> + <name>Resample</name> + <key>resample</key> + <value>8</value> + <type>int</type> + </param> + <param> + <name>Frac. Bandwidth</name> + <key>bw</key> + <value>0.5</value> + <type>real</type> + </param> + <sink> + <name>in</name> + <type>float</type> + </sink> + <source> + <name>out</name> + <type>byte</type> + </source> +</block> diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 5a989cc01..296f0ee91 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -252,6 +252,11 @@ <block>gr_descrambler_bb</block> </cat> <cat> + <name>Vocoders</name> + <block>blks2_cvsd_encode</block> + <block>blks2_cvsd_decode</block> + </cat> + <cat> <name>Probes</name> <block>gr_probe_avg_mag_sqrd_x</block> <block>gr_probe_density_b</block> diff --git a/grc/examples/Makefile.am b/grc/examples/Makefile.am index 969485c0d..78321ce0a 100644 --- a/grc/examples/Makefile.am +++ b/grc/examples/Makefile.am @@ -25,7 +25,8 @@ grc_examples_prefix = $(exampledir)/grc audiodatadir = $(grc_examples_prefix)/audio dist_audiodata_DATA = \ - audio/dial_tone.grc + audio/dial_tone.grc \ + audio/cvsd_sweep.grc simpledatadir = $(grc_examples_prefix)/simple dist_simpledata_DATA = \ diff --git a/grc/examples/audio/cvsd_sweep.grc b/grc/examples/audio/cvsd_sweep.grc new file mode 100644 index 000000000..8d0b385ce --- /dev/null +++ b/grc/examples/audio/cvsd_sweep.grc @@ -0,0 +1,918 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Sat Sep 19 20:30:08 2009</timestamp> + <block> + <key>import</key> + <param> + <key>id</key> + <value>import_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>import</key> + <value>import math</value> + </param> + <param> + <key>_coordinate</key> + <value>(157, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blks2_cvsd_decode</key> + <param> + <key>id</key> + <value>blks2_cvsd_decode_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>resample</key> + <value>resample</value> + </param> + <param> + <key>bw</key> + <value>bw</value> + </param> + <param> + <key>_coordinate</key> + <value>(887, 340)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sig_source_x</key> + <param> + <key>id</key> + <value>tri_source</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate</value> + </param> + <param> + <key>waveform</key> + <value>gr.GR_TRI_WAVE</value> + </param> + <param> + <key>freq</key> + <value>0.05</value> + </param> + <param> + <key>amp</key> + <value>0.5</value> + </param> + <param> + <key>offset</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(44, 316)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>throttle</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>samples_per_second</key> + <value>audio_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(238, 348)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_vco_f</key> + <param> + <key>id</key> + <value>vco</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate</value> + </param> + <param> + <key>sensitivity</key> + <value>audio_rate*2*math.pi</value> + </param> + <param> + <key>amplitude</key> + <value>0.9</value> + </param> + <param> + <key>_coordinate</key> + <value>(427, 332)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blks2_cvsd_encode</key> + <param> + <key>id</key> + <value>enc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>resample</key> + <value>resample</value> + </param> + <param> + <key>bw</key> + <value>bw</value> + </param> + <param> + <key>_coordinate</key> + <value>(655, 340)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_packed_to_unpacked_xx</key> + <param> + <key>id</key> + <value>p2u</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>bits_per_chunk</key> + <value>1</value> + </param> + <param> + <key>endianness</key> + <value>gr.GR_MSB_FIRST</value> + </param> + <param> + <key>_coordinate</key> + <value>(648, 415)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>gr_char_to_float</key> + <param> + <key>id</key> + <value>c2f</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(676, 483)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>audio_sink</key> + <param> + <key>id</key> + <value>audio_sink</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate</value> + </param> + <param> + <key>device_name</key> + <value>plughw:0,0</value> + </param> + <param> + <key>ok_to_block</key> + <value>True</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(1127, 340)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>audio_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>8000</value> + </param> + <param> + <key>_coordinate</key> + <value>(251, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>resample</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>8</value> + </param> + <param> + <key>_coordinate</key> + <value>(344, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>bw</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>0.5</value> + </param> + <param> + <key>_coordinate</key> + <value>(431, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>notebook</key> + <param> + <key>id</key> + <value>displays</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>style</key> + <value>wx.NB_TOP</value> + </param> + <param> + <key>labels</key> + <value>['Original','Encoded','Decoded']</value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(12, 106)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_fftsink2</key> + <param> + <key>id</key> + <value>orig_fft</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Original Spectrum</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate</value> + </param> + <param> + <key>baseband_freq</key> + <value>0</value> + </param> + <param> + <key>y_per_div</key> + <value>10</value> + </param> + <param> + <key>y_divs</key> + <value>10</value> + </param> + <param> + <key>ref_level</key> + <value>0</value> + </param> + <param> + <key>ref_scale</key> + <value>2.0</value> + </param> + <param> + <key>fft_size</key> + <value>1024</value> + </param> + <param> + <key>fft_rate</key> + <value>30</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>False</value> + </param> + <param> + <key>avg_alpha</key> + <value>0</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 0, 1, 1</value> + </param> + <param> + <key>notebook</key> + <value>displays, 0</value> + </param> + <param> + <key>_coordinate</key> + <value>(415, 97)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>wxgui_scopesink2</key> + <param> + <key>id</key> + <value>orig_scope</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Original Waveform</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate</value> + </param> + <param> + <key>v_scale</key> + <value>0</value> + </param> + <param> + <key>t_scale</key> + <value>0</value> + </param> + <param> + <key>ac_couple</key> + <value>False</value> + </param> + <param> + <key>xy_mode</key> + <value>False</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 0, 1, 1</value> + </param> + <param> + <key>notebook</key> + <value>displays, 0</value> + </param> + <param> + <key>_coordinate</key> + <value>(414, 425)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>wxgui_fftsink2</key> + <param> + <key>id</key> + <value>enc_fft</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Encoded Spectrum</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate*resample</value> + </param> + <param> + <key>baseband_freq</key> + <value>0</value> + </param> + <param> + <key>y_per_div</key> + <value>10</value> + </param> + <param> + <key>y_divs</key> + <value>8</value> + </param> + <param> + <key>ref_level</key> + <value>10</value> + </param> + <param> + <key>ref_scale</key> + <value>2.0</value> + </param> + <param> + <key>fft_size</key> + <value>1024</value> + </param> + <param> + <key>fft_rate</key> + <value>30</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>False</value> + </param> + <param> + <key>avg_alpha</key> + <value>0</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 0, 1, 1</value> + </param> + <param> + <key>notebook</key> + <value>displays, 1</value> + </param> + <param> + <key>_coordinate</key> + <value>(610, 551)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>wxgui_scopesink2</key> + <param> + <key>id</key> + <value>enc_scope</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Encoded Waveform</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate*resample</value> + </param> + <param> + <key>v_scale</key> + <value>0.5</value> + </param> + <param> + <key>t_scale</key> + <value>20.0/(audio_rate*resample)</value> + </param> + <param> + <key>ac_couple</key> + <value>False</value> + </param> + <param> + <key>xy_mode</key> + <value>False</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 0, 1, 1</value> + </param> + <param> + <key>notebook</key> + <value>displays, 1</value> + </param> + <param> + <key>_coordinate</key> + <value>(858, 591)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_fftsink2</key> + <param> + <key>id</key> + <value>dec_fft</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Decoded Spectrum</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate</value> + </param> + <param> + <key>baseband_freq</key> + <value>0</value> + </param> + <param> + <key>y_per_div</key> + <value>5</value> + </param> + <param> + <key>y_divs</key> + <value>10</value> + </param> + <param> + <key>ref_level</key> + <value>10</value> + </param> + <param> + <key>ref_scale</key> + <value>0.1</value> + </param> + <param> + <key>fft_size</key> + <value>1024</value> + </param> + <param> + <key>fft_rate</key> + <value>30</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>False</value> + </param> + <param> + <key>avg_alpha</key> + <value>0</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 0, 1, 1</value> + </param> + <param> + <key>notebook</key> + <value>displays, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(891, 98)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>wxgui_scopesink2</key> + <param> + <key>id</key> + <value>dec_scope</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Decoded Waveform</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate</value> + </param> + <param> + <key>v_scale</key> + <value>0</value> + </param> + <param> + <key>t_scale</key> + <value>0</value> + </param> + <param> + <key>ac_couple</key> + <value>False</value> + </param> + <param> + <key>xy_mode</key> + <value>False</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 0, 1, 1</value> + </param> + <param> + <key>notebook</key> + <value>displays, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(889, 422)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>options</key> + <param> + <key>id</key> + <value>cvsd_sweep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>CVSD Vocoder Test</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>wx_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>vco</source_block_id> + <sink_block_id>orig_fft</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>tri_source</source_block_id> + <sink_block_id>throttle</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>throttle</source_block_id> + <sink_block_id>vco</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>vco</source_block_id> + <sink_block_id>enc</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>enc</source_block_id> + <sink_block_id>blks2_cvsd_decode_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>vco</source_block_id> + <sink_block_id>orig_scope</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blks2_cvsd_decode_0</source_block_id> + <sink_block_id>dec_fft</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blks2_cvsd_decode_0</source_block_id> + <sink_block_id>dec_scope</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blks2_cvsd_decode_0</source_block_id> + <sink_block_id>audio_sink</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>enc</source_block_id> + <sink_block_id>p2u</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>p2u</source_block_id> + <sink_block_id>c2f</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>c2f</source_block_id> + <sink_block_id>enc_fft</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>c2f</source_block_id> + <sink_block_id>enc_scope</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> |