Skip to content

Commit

Permalink
grc: import radar -> from gnuradio import radar
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Volz <[email protected]>
  • Loading branch information
ryanvolz authored and mbr0wn committed Aug 17, 2023
1 parent c8bcd9b commit 8a71985
Show file tree
Hide file tree
Showing 32 changed files with 390 additions and 384 deletions.
2 changes: 1 addition & 1 deletion docs/README.radar
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This is the radar-write-a-block package meant as a guide to building
out-of-tree packages. To use the radar blocks, the Python namespaces
is in 'radar', which is imported as:

import radar
from gnuradio import radar

See the Doxygen documentation for details about the blocks available
in this package. A quick listing of the details can be found in Python
Expand Down
6 changes: 3 additions & 3 deletions examples/usrp/top_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from gnuradio.filter import firdes
from optparse import OptionParser
import PyQt4.Qwt5 as Qwt
import radar
from gnuradio import radar
import sip
import sys

Expand Down Expand Up @@ -255,7 +255,7 @@ def setValue(self, value):
self.qtgui_freq_sink_x_0.enable_autoscale(False)
self.qtgui_freq_sink_x_0.enable_grid(False)
self.qtgui_freq_sink_x_0.set_fft_average(1.0)

labels = ["", "", "", "", "",
"", "", "", "", ""]
widths = [1, 1, 1, 1, 1,
Expand All @@ -272,7 +272,7 @@ def setValue(self, value):
self.qtgui_freq_sink_x_0.set_line_width(i, widths[i])
self.qtgui_freq_sink_x_0.set_line_color(i, colors[i])
self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i])

self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget)
self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win)
self.blocks_tagged_stream_multiply_length_0_0 = blocks.tagged_stream_multiply_length(gr.sizeof_gr_complex*1, "packet_len", 1.0/float(decim_fac))
Expand Down
18 changes: 9 additions & 9 deletions grc/radar_crop_matrix_vcvc.block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@

id: radar_crop_matrix_vcvc
label: Matrix Crop
category: '[RADAR]/Tools'
category: "[RADAR]/Tools"

parameters:
- id: vlen
- id: vlen
label: Vector length
dtype: int
hide: ${ 'part' if vlen == 1 else 'none' }
- id: crop_x
- id: crop_x
label: Crop x
dtype: int_vector
hide: ${ 'part' if vlen == 1 else 'none' }
- id: crop_y
- id: crop_y
label: Crop y
dtype: int_vector
- id: len_key
- id: len_key
label: Packet length key
dtype: string
default: '"packet_len"'

inputs:
- label: IQ in
- label: IQ in
domain: stream
dtype: complex
vlen: ${ vlen }

outputs:
- label: IQ out
- label: IQ out
domain: stream
dtype: complex
vlen: ${ (crop_x)[1]-(crop_x)[0] }

templates:
imports: import radar
make: radar.crop_matrix_vcvc(${vlen}, ${crop_x}, ${crop_y}, ${len_key})
imports: from gnuradio import radar
make: radar.crop_matrix_vcvc(${vlen}, ${crop_x}, ${crop_y}, ${len_key})

file_format: 1
12 changes: 6 additions & 6 deletions grc/radar_estimator_cw.block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

id: radar_estimator_cw
label: Estimator CW
category: '[RADAR]/Estimators'
category: "[RADAR]/Estimators"

parameters:
- id: center_freq
- id: center_freq
label: Center frequency
dtype: float

inputs:
- domain: message
- domain: message
id: Msg in
optional: true

outputs:
- domain: message
- domain: message
id: Msg out
optional: true

templates:
imports: import radar
make: radar.estimator_cw(${center_freq})
imports: from gnuradio import radar
make: radar.estimator_cw(${center_freq})

file_format: 1
32 changes: 16 additions & 16 deletions grc/radar_estimator_fmcw.block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,49 @@

id: radar_estimator_fmcw
label: Estimator FMCW
category: '[RADAR]/Estimators'
category: "[RADAR]/Estimators"

parameters:
- id: samp_rate
- id: samp_rate
label: Sample rate
dtype: int
- id: center_freq
- id: center_freq
label: Center frequency
dtype: float
- id: sweep_freq
- id: sweep_freq
label: Sweep frequency
dtype: float
- id: samp_up
- id: samp_up
label: Samples up-chirp
dtype: int
- id: samp_down
- id: samp_down
label: Samples down-chirp
dtype: int
- id: push_power
- id: push_power
label: Push through power of peaks
dtype: bool
default: 'False'
options: ['True', 'False']
default: "False"
options: ["True", "False"]

inputs:
- domain: message
- domain: message
id: Msg in CW
optional: true
- domain: message
- domain: message
id: Msg in UP
optional: true
- domain: message
- domain: message
id: Msg in DOWN
optional: true

outputs:
- domain: message
- domain: message
id: Msg out
optional: true

templates:
imports: import radar
make: radar.estimator_fmcw(${samp_rate}, ${center_freq}, ${sweep_freq}, ${samp_up},
${samp_down}, ${push_power})
imports: from gnuradio import radar
make: radar.estimator_fmcw(${samp_rate}, ${center_freq}, ${sweep_freq}, ${samp_up},
${samp_down}, ${push_power})

file_format: 1
20 changes: 10 additions & 10 deletions grc/radar_estimator_fsk.block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

id: radar_estimator_fsk
label: Estimator FSK
category: '[RADAR]/Estimators'
category: "[RADAR]/Estimators"

parameters:
- id: center_freq
- id: center_freq
label: Center frequency
dtype: float
- id: delta_freq
- id: delta_freq
label: Delta frequency
dtype: float
- id: push_power
- id: push_power
label: Push through power of peaks
dtype: bool
default: 'False'
options: ['True', 'False']
default: "False"
options: ["True", "False"]

inputs:
- domain: message
- domain: message
id: Msg in
optional: true

outputs:
- domain: message
- domain: message
id: Msg out
optional: true

templates:
imports: import radar
make: radar.estimator_fsk(${center_freq}, ${delta_freq}, ${push_power})
imports: from gnuradio import radar
make: radar.estimator_fsk(${center_freq}, ${delta_freq}, ${push_power})

file_format: 1
30 changes: 15 additions & 15 deletions grc/radar_estimator_ofdm.block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,46 @@

id: radar_estimator_ofdm
label: Estimator OFDM
category: '[RADAR]/Estimators'
category: "[RADAR]/Estimators"

parameters:
- id: symbol_x
- id: symbol_x
label: Symbol x
dtype: string
- id: len_x
- id: len_x
label: Length x
dtype: int
- id: axis_x
- id: axis_x
label: Axis x
dtype: real_vector
- id: symbol_y
- id: symbol_y
label: Symbol y
dtype: string
- id: len_y
- id: len_y
label: Length y
dtype: int
- id: axis_y
- id: axis_y
label: Axis y
dtype: real_vector
- id: merge_consecutive
- id: merge_consecutive
label: Merge consecutive peaks
dtype: bool
default: 'True'
options: ['True', 'False']
default: "True"
options: ["True", "False"]

inputs:
- domain: message
- domain: message
id: Msg in
optional: true

outputs:
- domain: message
- domain: message
id: Msg out
optional: true

templates:
imports: import radar
make: radar.estimator_ofdm(${symbol_x}, ${len_x}, ${axis_x}, ${symbol_y}, ${len_y},
${axis_y}, ${merge_consecutive})
imports: from gnuradio import radar
make: radar.estimator_ofdm(${symbol_x}, ${len_x}, ${axis_x}, ${symbol_y}, ${len_y},
${axis_y}, ${merge_consecutive})

file_format: 1
33 changes: 17 additions & 16 deletions grc/radar_estimator_rcs.block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,51 @@

id: radar_estimator_rcs
label: Estimator RCS
category: '[RADAR]/Estimators'
category: "[RADAR]/Estimators"

parameters:
- id: num_mean
- id: num_mean
label: Mean Samples
dtype: int
- id: center_freq
- id: center_freq
label: Center frequency
dtype: float
- id: antenna_gain_tx
- id: antenna_gain_tx
label: Antenna Gain Tx [dBi]
dtype: float
- id: antenna_gain_rx
- id: antenna_gain_rx
label: Antenna Gain Rx [dBi]
dtype: float
- id: usrp_gain_rx
- id: usrp_gain_rx
label: Usrp Gain Rx [dB]
dtype: float
- id: power_tx
- id: power_tx
label: Power Tx [W]
dtype: float
- id: corr_factor
- id: corr_factor
label: Correction factor
dtype: float
- id: exponent
- id: exponent
label: Exponent
dtype: float
default: '1'
default: "1"

inputs:
- domain: message
- domain: message
id: Msg in
optional: true

outputs:
- domain: message
- domain: message
id: Msg out
optional: true

templates:
imports: import radar
make: radar.estimator_rcs(${num_mean}, ${center_freq}, ${antenna_gain_tx}, ${antenna_gain_rx},
${usrp_gain_rx}, ${power_tx}, ${corr_factor}, ${exponent})
callbacks:
imports: from gnuradio import radar
make:
radar.estimator_rcs(${num_mean}, ${center_freq}, ${antenna_gain_tx}, ${antenna_gain_rx},
${usrp_gain_rx}, ${power_tx}, ${corr_factor}, ${exponent})
callbacks:
- set_num_mean(${num_mean})
- set_center_freq(${center_freq})
- set_antenna_gain_tx(${antenna_gain_tx})
Expand Down
Loading

0 comments on commit 8a71985

Please sign in to comment.