diff options
author | Josh Morman <jmorman@perspectalabs.com> | 2019-07-30 10:05:03 -0400 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2020-01-06 18:52:27 -0800 |
commit | dc0df099909d65a2ab15ce857ca667e40848e4db (patch) | |
tree | c047ed8469485343edc194866e9a14d0f5c4cde4 | |
parent | a4dc4dc4e1cd83990dac400b1970ac2a2e17f795 (diff) |
filter: fix issues with filter taps loader
Continuing the work previously done on the loader but polishing a few
remaining items in the yml
Adds an example as well
-rw-r--r-- | gr-filter/examples/filter_taps_example_complex_bandpass_taps | 22 | ||||
-rw-r--r-- | gr-filter/examples/filter_taps_loader.grc | 206 | ||||
-rw-r--r-- | gr-filter/grc/variable_file_filter_taps.block.yml | 8 |
3 files changed, 221 insertions, 15 deletions
diff --git a/gr-filter/examples/filter_taps_example_complex_bandpass_taps b/gr-filter/examples/filter_taps_example_complex_bandpass_taps index 24bbc052ed..537a1b55ac 100644 --- a/gr-filter/examples/filter_taps_example_complex_bandpass_taps +++ b/gr-filter/examples/filter_taps_example_complex_bandpass_taps @@ -1,11 +1,11 @@ -restype,fir -fs,320000.0 -pbend,80000.0 -gain,2.0 -filttype,bpf -atten,40.0 -ntaps,59 -tb,10000.0 -wintype,0 -pbstart,50000.0 -taps,0.0020944445859640837,-0.0013267543399706483,-0.00422978401184082,-0.0009732129983603954,0.0048430184833705425,0.0038606333546340466,-0.0021335079800337553,-0.002276926999911666,0.0001407891686540097,-0.006330752279609442,-0.00873428676277399,0.012056224048137665,0.028536280617117882,-6.226932271493447e-17,-0.03995516523718834,-0.023683074861764908,0.024168243631720543,0.02482188493013382,-0.0007882011705078185,0.018366731703281403,0.025039127096533775,-0.06653119623661041,-0.12338384985923767,0.03671892732381821,0.23510517179965973,0.10753083974123001,-0.24698470532894135,-0.29031240940093994,0.10677798837423325,0.3742202818393707,0.10677798837423325,-0.29031240940093994,-0.24698470532894135,0.10753083974123001,0.23510517179965973,0.03671892732381821,-0.12338384985923767,-0.06653119623661041,0.025039127096533775,0.018366731703281403,-0.0007882011705078185,0.02482188493013382,0.024168243631720543,-0.023683074861764908,-0.03995516523718834,-6.226932271493447e-17,0.028536280617117882,0.012056224048137665,-0.00873428676277399,-0.006330752279609442,0.0001407891686540097,-0.002276926999911666,-0.0021335079800337553,0.0038606333546340466,0.0048430184833705425,-0.0009732129983603954,-0.00422978401184082,-0.0013267543399706483,0.0020944445859640837 +restype,fir
+fs,320000.0
+gain,2.0
+wintype,0
+filttype,cbpf
+pbstart,50000.0
+pbend,80000.0
+tb,10000.0
+atten,40.0
+ntaps,59
+taps,(0.00104713102337+0.000859354797285j),(-0.000663314771373+0.00160139321815j),(-0.00211470457725-0.000208275203477j),(-0.000486569508212-0.00244611757807j),(0.00242129084654-0.00129421544261j),(0.0019301509019+0.0019301394932j),(-0.00106665294152+0.00199558236636j),(-0.00113836303353-0.000226430551265j),(7.03908444848e-05+0.000714664405677j),(-0.00316508999094+0.00131103699096j),(-0.00436677597463-0.00532088940963j),(0.00602753926069-0.00902093015611j),(0.0142668923363+0.00432774750516j),(8.32209465784e-08+0.0184846930206j),(-0.0199757795781+0.00605968898162j),(-0.0118405716494-0.0177204795182j),(0.0120829734951-0.0147232990712j),(0.0124098677188+0.00514025846496j),(-0.000394043658162+0.00400101719424j),(0.00918253883719-0.00182657479309j),(0.0125185884535+0.0234203021973j),(-0.0332624427974+0.0332628488541j),(-0.0616866499186-0.0329717062414j),(0.018357237801-0.0922911763191j),(0.11754206568-0.0115776723251j),(0.0537615381181+0.129789322615j),(-0.123480699956+0.101339399815j),(-0.145143970847-0.0969806835055j),(0.0533830672503-0.17598465085j),(0.187093526125-1.24898406284e-06j),(0.0533854179084+0.175983935595j),(-0.145142674446+0.0969826206565j),(-0.123482055962-0.101337753236j),(0.0537598058581-0.12979003787j),(0.117542222142+0.0115761030465j),(0.0183584690094+0.09229093045j),(-0.0616862103343+0.0329725295305j),(-0.0332628898323-0.0332624018192j),(0.0125182764605-0.0234204679728j),(0.00918256305158+0.00182645209134j),(-0.000394097092794-0.00400101207197j),(0.0124097988009-0.00514042424038j),(0.0120831700042+0.0147231379524j),(-0.0118403350934+0.017720637843j),(-0.0199758596718-0.0060594221577j),(-1.63576331147e-07-0.0184846930206j),(0.0142668345943-0.00432793796062j),(0.00602765986696+0.00902085006237j),(-0.00436670519412+0.00532094808295j),(-0.00316510745324-0.00131099473219j),(7.03813057044e-05-0.000714665395208j),(-0.00113836000673+0.000226445743465j),(-0.00106667960063-0.00199556816369j),(0.00193012517411-0.0019301653374j),(0.00242130807601+0.00129418307915j),(-0.000486541510327+0.00244612316601j),(-0.00211470224895+0.000208299403312j),(-0.000663333106786-0.00160138565116j),(0.00104712124448-0.000859366788063j)
diff --git a/gr-filter/examples/filter_taps_loader.grc b/gr-filter/examples/filter_taps_loader.grc new file mode 100644 index 0000000000..f58374b6c7 --- /dev/null +++ b/gr-filter/examples/filter_taps_loader.grc @@ -0,0 +1,206 @@ +options: + parameters: + author: '' + catch_exceptions: 'True' + category: '[GRC Hier Blocks]' + cmake_opt: '' + comment: '' + copyright: '' + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: filter_taps_loader + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: Complex Taps Loaded From File + window_size: '' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 8] + rotation: 0 + state: enabled + +blocks: +- name: bp_taps + id: variable_file_filter_taps + parameters: + comment: '' + file: filter_taps_example_complex_bandpass_taps + verbose: 'False' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [299, 16] + rotation: 0 + state: true +- name: samp_rate + id: variable + parameters: + comment: '' + value: '32000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [184, 12] + rotation: 0 + state: enabled +- name: analog_fastnoise_source_x_0 + id: analog_fastnoise_source_x + parameters: + affinity: '' + alias: '' + amp: '1' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + noise_type: analog.GR_GAUSSIAN + samples: '8192' + seed: '0' + type: complex + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [31, 137] + rotation: 0 + state: enabled +- name: blocks_throttle_0 + id: blocks_throttle + parameters: + affinity: '' + alias: '' + comment: '' + ignoretag: 'True' + maxoutbuf: '0' + minoutbuf: '0' + samples_per_second: samp_rate + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [524, 161] + rotation: 0 + state: true +- name: lp_filter + id: fir_filter_xxx + parameters: + affinity: '' + alias: '' + comment: Low-pass filter + decim: '1' + maxoutbuf: '0' + minoutbuf: '0' + samp_delay: '0' + taps: bp_taps + type: ccc + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [271, 153] + rotation: 0 + state: enabled +- name: qtgui_freq_sink_x_0 + id: qtgui_freq_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '0.9' + alpha10: '1.0' + alpha2: '0.9' + alpha3: '0.9' + alpha4: '0.9' + alpha5: '0.9' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + average: '0.2' + axislabels: 'True' + bw: samp_rate + color1: '"blue"' + color10: '"dark blue"' + color2: '"red"' + color3: '"green"' + color4: '"cyan"' + color5: '"magenta"' + color6: '"magenta"' + color7: '"yellow"' + color8: '"dark red"' + color9: '"dark green"' + comment: '' + ctrlpanel: 'True' + fc: '0' + fftsize: '4096' + freqhalf: 'False' + grid: 'True' + gui_hint: '' + label: Relative Gain + label1: Low-pass + label10: '' + label2: High-pass + label3: Band-pass + label4: Band-reject + label5: RRC + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + maxoutbuf: '0' + minoutbuf: '0' + name: '""' + nconnections: '1' + showports: 'True' + tr_chan: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_tag: '""' + type: complex + units: dB + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + wintype: firdes.WIN_BLACKMAN_hARRIS + ymax: '10' + ymin: '-140' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [806, 133] + rotation: 0 + state: enabled + +connections: +- [analog_fastnoise_source_x_0, '0', lp_filter, '0'] +- [blocks_throttle_0, '0', qtgui_freq_sink_x_0, '0'] +- [lp_filter, '0', blocks_throttle_0, '0'] + +metadata: + file_format: 1 diff --git a/gr-filter/grc/variable_file_filter_taps.block.yml b/gr-filter/grc/variable_file_filter_taps.block.yml index d15151e6d7..56f0506e2a 100644 --- a/gr-filter/grc/variable_file_filter_taps.block.yml +++ b/gr-filter/grc/variable_file_filter_taps.block.yml @@ -1,6 +1,6 @@ id: variable_file_filter_taps label: Filter Taps Loader -flags: [ python ] +flags: [show_id, python ] parameters: - id: file @@ -11,12 +11,12 @@ parameters: dtype: bool default: False +value: ${filter.file_taps_loader(file, verbose).get_taps()} + templates: imports: from gnuradio import filter var_make: |- - self.${id} = ${id} = filter.file_taps_loader($file, $verbose).get_taps() - var_value: |- - filter.file_taps_loader($file, $verbose).get_taps() + self.${id} = ${id} = filter.file_taps_loader(${file}, ${verbose}).get_taps() documentation: |- This block maps filter taps created with gr_filter_design to a variable. |