diff options
author | ghostop14 <ghostop14@gmail.com> | 2020-02-04 18:37:41 -0500 |
---|---|---|
committer | Michael Dickens <michael.dickens@ettus.com> | 2020-02-15 19:20:26 -0500 |
commit | 012870af22ae873b3b998691de8e81752179d266 (patch) | |
tree | d294d2d83b4f94b11922cf2873ebaf473bb36df3 /gr-blocks/grc | |
parent | f6a346d8b59050b2da520c80f7fab9d85018e350 (diff) |
Blocks: Add DC Spike Removal and IQ Swap Native Blocks
This block incorporates the OOT modules in correctiq that provide
3 different techniques to remove the DC spike inherent in IQ sampling.
The first technique mirrors SDR GUI receivers with an IIR filter
approach, the second provides a time-limited IIR approach where after
a user-configurable number of seconds locks into a basic offset
correction to eliminate the effect of the filter on the signal while
maintaining the correction, and the last is manual I and Q
configurable offsets. The Swap IQ block is a drop-in block to help
correct for inverted spectrums and just swaps I<->Q.
Diffstat (limited to 'gr-blocks/grc')
-rw-r--r-- | gr-blocks/grc/blocks.tree.yml | 5 | ||||
-rw-r--r-- | gr-blocks/grc/blocks_correctiq.block.yml | 20 | ||||
-rw-r--r-- | gr-blocks/grc/blocks_correctiq_auto.block.yml | 56 | ||||
-rw-r--r-- | gr-blocks/grc/blocks_correctiq_man.block.yml | 39 | ||||
-rw-r--r-- | gr-blocks/grc/blocks_correctiq_swapiq.block.yml | 30 |
5 files changed, 150 insertions, 0 deletions
diff --git a/gr-blocks/grc/blocks.tree.yml b/gr-blocks/grc/blocks.tree.yml index 8fcdf26544..2c05555883 100644 --- a/gr-blocks/grc/blocks.tree.yml +++ b/gr-blocks/grc/blocks.tree.yml @@ -39,6 +39,11 @@ - blocks_file_meta_source - blocks_file_meta_sink - blocks_tagged_file_sink +- IQ Correction: + - blocks_correctiq_auto + - blocks_correctiq_man + - blocks_swapiq + - blocks_correctiq - Level Controllers: - blocks_mute_xx - blocks_sample_and_hold_xx diff --git a/gr-blocks/grc/blocks_correctiq.block.yml b/gr-blocks/grc/blocks_correctiq.block.yml new file mode 100644 index 0000000000..3a1051b07a --- /dev/null +++ b/gr-blocks/grc/blocks_correctiq.block.yml @@ -0,0 +1,20 @@ +id: blocks_correctiq +label: Remove DC Spike +category: '[Core]/IQ Correction' + +templates: + imports: from gnuradio import blocks + make: blocks.correctiq(${}) + +inputs: +- domain: stream + dtype: complex + +outputs: +- domain: stream + dtype: complex + +documentation: |- + This block to removes that center frequency IQ DC spike with an IIR filter. + +file_format: 1 diff --git a/gr-blocks/grc/blocks_correctiq_auto.block.yml b/gr-blocks/grc/blocks_correctiq_auto.block.yml new file mode 100644 index 0000000000..f6f0a7a056 --- /dev/null +++ b/gr-blocks/grc/blocks_correctiq_auto.block.yml @@ -0,0 +1,56 @@ +id: blocks_correctiq_auto +label: Remove DC Spike AutoSync +category: '[Core]/IQ Correction' + +templates: + imports: from gnuradio import blocks + make: blocks.correctiq_auto(${samp_rate}, ${freq}, ${gain}, ${syncWindow}) + callbacks: + - set_freq(${freq}) + - set_gain(${gain}) + +parameters: +- id: samp_rate + label: Sample Rate + dtype: float + default: samp_rate +- id: syncWindow + label: Sync Learning Period (sec) + dtype: float + default: '2' +- id: freq + label: Frequency + dtype: float +- id: gain + label: Upstream Gain + dtype: float + +inputs: +- domain: stream + dtype: complex +- domain: message + id: rsync + optional: true + +outputs: +- domain: stream + dtype: complex +- domain: message + id: sync_start + optional: true +- domain: message + id: offsets + optional: true + +documentation: |- + This block to removes that center frequency IQ DC spike with a slight variation. It automatically calculates the offset then switches to straight DC offset mode to prevent any possible IIR filtering after it's been tuned. However, if frequency or upstream gain is changed, it must retune, so frequency and upstream gain are all taken as parameters and monitored for changes. + + Notes: + + 1. Any message received on the rsync port will trigger a resync process. So it could be a frequency or gain change, or any other desired condition. + + 2. The optional sync_start output message will be sent whenever a resync is triggered. This can be used downstream to know the filter is calculating and adapting. Note that there is no initial syncing message (this is assumed on block start so downstream blocks that are interested should make the same assumption). + + 3. When a sync is finished, the real and imag offsets will be sent in the optional offsets message. Note that the work loop calculates out[].real(in[].real() - real_offset) and same for imag. So offsets are subtractive from the input values. + +file_format: 1 diff --git a/gr-blocks/grc/blocks_correctiq_man.block.yml b/gr-blocks/grc/blocks_correctiq_man.block.yml new file mode 100644 index 0000000000..7a465ed48d --- /dev/null +++ b/gr-blocks/grc/blocks_correctiq_man.block.yml @@ -0,0 +1,39 @@ +id: blocks_correctiq_man +label: IQ Correction Manual Offset +category: '[Core]/IQ Correction' + +templates: + imports: from gnuradio import blocks + make: blocks.correctiq_man(${real}, ${imag}) + callbacks: + - set_real(${real}) + - set_imag(${imag}) + +parameters: +- id: real + label: Real (I) + dtype: float + default: '0.0' +- id: imag + label: Imag (Q) + dtype: float + default: '0.0' + +inputs: +- domain: stream + dtype: complex +- domain: message + id: set_real + optional: true +- domain: message + id: set_imag + optional: true + +outputs: +- domain: stream + dtype: complex + +documentation: |- + This block provides a mechanism to manually provide a real and imaginary signal offset. Very similar to a complex add block, the block supports dynamic updating on the values. + +file_format: 1 diff --git a/gr-blocks/grc/blocks_correctiq_swapiq.block.yml b/gr-blocks/grc/blocks_correctiq_swapiq.block.yml new file mode 100644 index 0000000000..f29ebb6015 --- /dev/null +++ b/gr-blocks/grc/blocks_correctiq_swapiq.block.yml @@ -0,0 +1,30 @@ +id: blocks_swapiq +label: Swap IQ +category: '[Core]/IQ Correction' + +templates: + imports: from gnuradio import blocks + make: blocks.swap_iq(${datatype.datatype}, ${datatype.datasize}) + +parameters: +- id: datatype + label: Input Type + dtype: enum + options: [complex, short, byte] + option_attributes: + datasize: [gr.sizeof_gr_complex, gr.sizeof_short, gr.sizeof_char] + datatype: ['1', '2', '3'] + hide: part + +inputs: +- domain: stream + dtype: ${ type } + +outputs: +- domain: stream + dtype: ${ type } + +documentation: |- + This block will transpose the I and Q channels (Swap IQ) to correct for spectrally inverted inputs. + +file_format: 1 |