diff options
author | ghostop14 <ghostop14@gmail.com> | 2020-03-02 17:48:46 -0500 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2020-03-30 09:57:31 -0400 |
commit | 6f18944f258d30a0038ab377532562f319d687cf (patch) | |
tree | b9d6e1daed61c820d880a078f9f5a9363c36c40d /gr-blocks/grc | |
parent | 553b51e295e6b9e03108fdae26a17679f71992d2 (diff) |
gr-blocks: Add Phase Shift Block with Msg Capabilities
This new block provides a native ability to phase shift signals
for solutions such as DoA and array-based projects. The block
supports both variable and message based updates such that
other blocks can provide the appropriate calculations for shifting
and only send message-based updates when necessary. Based on a
block configuration parameter, shift can be specified either
in radians or degrees. his block functions like a multiply const,
but with the const limited to abs() == 1 to provide a constant
phase shift.
Diffstat (limited to 'gr-blocks/grc')
-rw-r--r-- | gr-blocks/grc/blocks.tree.yml | 1 | ||||
-rw-r--r-- | gr-blocks/grc/blocks_phase_shift.block.yml | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/gr-blocks/grc/blocks.tree.yml b/gr-blocks/grc/blocks.tree.yml index f4a8ad8cd9..d01650f3fc 100644 --- a/gr-blocks/grc/blocks.tree.yml +++ b/gr-blocks/grc/blocks.tree.yml @@ -108,6 +108,7 @@ - blocks_copy - blocks_selector - blocks_nop + - blocks_phase_shift - xmlrpc_server - xmlrpc_client - Modulators: diff --git a/gr-blocks/grc/blocks_phase_shift.block.yml b/gr-blocks/grc/blocks_phase_shift.block.yml new file mode 100644 index 0000000000..7ce3ed8655 --- /dev/null +++ b/gr-blocks/grc/blocks_phase_shift.block.yml @@ -0,0 +1,40 @@ +id: blocks_phase_shift +label: Phase Shift + +parameters: +- id: shift + label: Phase Shift + dtype: float + default: '0.0' +- id: is_radians + label: Units + dtype: enum + options: ['True', 'False'] + option_labels: ['Radians', 'Degrees'] + +inputs: +- domain: stream + dtype: complex +- domain: message + id: shift + optional: true + +outputs: +- domain: stream + dtype: complex + +templates: + imports: from gnuradio import blocks + make: blocks.phase_shift(${shift}, ${is_radians}) + callbacks: + - set_shift(${shift}) + +documentation: "This block will phase shift the input signal by the specified phase\ + \ by multiplying the input times a shift value: \n\ + \ gr_complex(cos(d_shift_in_radians),sin(d_shift_in_radians))\n\n\ + \ Notes:\n\ + \ If degrees are provided, the block automatically handles the conversion.\n\ + \ This block functions like a multiply const, but with the const limited to \ + \ abs() == 1 to provide a constant phase shift." + +file_format: 1 |