Compare commits

...

2 commits

Author SHA1 Message Date
c834684688 Improve GRC demo 2025-06-21 13:30:26 +02:00
c5ff369fa5 Add missing byte swap 2025-06-21 12:47:43 +02:00
3 changed files with 124 additions and 146 deletions

View file

@ -135,7 +135,7 @@ blocks:
alpha8: '1.0' alpha8: '1.0'
alpha9: '1.0' alpha9: '1.0'
autoscale: 'False' autoscale: 'False'
average: '1.0' average: '0.1'
axislabels: 'True' axislabels: 'True'
bw: samp_rate bw: samp_rate
color1: '"blue"' color1: '"blue"'
@ -151,7 +151,7 @@ blocks:
comment: '' comment: ''
ctrlpanel: 'False' ctrlpanel: 'False'
fc: '0' fc: '0'
fftsize: '8192' fftsize: '4096'
freqhalf: 'False' freqhalf: 'False'
grid: 'True' grid: 'True'
gui_hint: '' gui_hint: ''
@ -326,7 +326,7 @@ blocks:
color9: '0' color9: '0'
comment: '' comment: ''
fc: '0' fc: '0'
fftsize: '8192' fftsize: '4096'
freqhalf: 'False' freqhalf: 'False'
grid: 'False' grid: 'False'
gui_hint: '' gui_hint: ''

View file

@ -69,6 +69,29 @@ blocks:
coordinate: [168, 16.0] coordinate: [168, 16.0]
rotation: 0 rotation: 0
state: enabled state: enabled
- name: analog_sig_source_x_0
id: analog_sig_source_x
parameters:
affinity: ''
alias: ''
amp: '1'
comment: ''
freq: '38_000'
maxoutbuf: '0'
minoutbuf: '0'
offset: '0'
phase: '0'
samp_rate: samp_rate
showports: 'False'
type: complex
waveform: analog.GR_SQR_WAVE
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [472, 232.0]
rotation: 0
state: enabled
- name: blocks_char_to_float_0 - name: blocks_char_to_float_0
id: blocks_char_to_float id: blocks_char_to_float
parameters: parameters:
@ -83,7 +106,7 @@ blocks:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
bus_structure: null bus_structure: null
coordinate: [224, 280.0] coordinate: [216, 144.0]
rotation: 0 rotation: 0
state: enabled state: enabled
- name: blocks_complex_to_mag_squared_0 - name: blocks_complex_to_mag_squared_0
@ -99,8 +122,8 @@ blocks:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
bus_structure: null bus_structure: null
coordinate: [928, 448.0] coordinate: [1072, 560.0]
rotation: 180 rotation: 0
state: enabled state: enabled
- name: blocks_file_source_0 - name: blocks_file_source_0
id: blocks_file_source id: blocks_file_source
@ -121,7 +144,7 @@ blocks:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
bus_structure: null bus_structure: null
coordinate: [8, 248.0] coordinate: [8, 112.0]
rotation: 0 rotation: 0
state: enabled state: enabled
- name: blocks_float_to_complex_0 - name: blocks_float_to_complex_0
@ -137,24 +160,7 @@ blocks:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
bus_structure: null bus_structure: null
coordinate: [408, 288.0] coordinate: [504, 160.0]
rotation: 0
state: enabled
- name: blocks_freqshift_cc_0
id: blocks_freqshift_cc
parameters:
affinity: ''
alias: ''
comment: ''
freq: -38e3
maxoutbuf: '0'
minoutbuf: '0'
sample_rate: samp_rate
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [680, 288.0]
rotation: 0 rotation: 0
state: enabled state: enabled
- name: blocks_message_debug_0 - name: blocks_message_debug_0
@ -172,6 +178,24 @@ blocks:
coordinate: [856, 64.0] coordinate: [856, 64.0]
rotation: 0 rotation: 0
state: enabled state: enabled
- name: blocks_multiply_xx_0
id: blocks_multiply_xx
parameters:
affinity: ''
alias: ''
comment: ''
maxoutbuf: '0'
minoutbuf: '0'
num_inputs: '2'
type: complex
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [712, 208.0]
rotation: 0
state: enabled
- name: blocks_probe_rate_0 - name: blocks_probe_rate_0
id: blocks_probe_rate id: blocks_probe_rate
parameters: parameters:
@ -183,13 +207,13 @@ blocks:
minoutbuf: '0' minoutbuf: '0'
mintime: 10e3 mintime: 10e3
name: '' name: ''
type: complex type: float
vlen: '1' vlen: '1'
states: states:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
bus_structure: null bus_structure: null
coordinate: [592, 72.0] coordinate: [504, 72.0]
rotation: 0 rotation: 0
state: enabled state: enabled
- name: fir_filter_xxx_0 - name: fir_filter_xxx_0
@ -217,15 +241,13 @@ blocks:
0.013583143648022388, 0.012203828541343623, 0.010895730688633577, 0.009666763243126521, 0.013583143648022388, 0.012203828541343623, 0.010895730688633577, 0.009666763243126521,
0.008522563837635781, 0.007466617484016239, 0.006500428742502637, 0.005623731273043186, 0.008522563837635781, 0.007466617484016239, 0.006500428742502637, 0.005623731273043186,
0.004834722781341408, 0.004130313846119902, 0.003506380063969166, 0.002958008261689403, 0.004834722781341408, 0.004130313846119902, 0.003506380063969166, 0.002958008261689403,
0.002479729084898883, 0.002065729959831640, 0.001710044136011884, 0.001406713158940830] 0.002479729084898883, 0.002065729959831640, 0.001710044136011884, 0.001406713158940830]'
'
type: ccf type: ccf
states: states:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
bus_structure: null bus_structure: null
coordinate: [872, 288.0] coordinate: [856, 208.0]
rotation: 0 rotation: 0
state: enabled state: enabled
- name: qtgui_freq_sink_x_0 - name: qtgui_freq_sink_x_0
@ -306,104 +328,7 @@ blocks:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
bus_structure: null bus_structure: null
coordinate: [1168, 376.0] coordinate: [856, 408.0]
rotation: 0
state: enabled
- name: qtgui_time_sink_x_0
id: qtgui_time_sink_x
parameters:
affinity: ''
alias: ''
alpha1: '1.0'
alpha10: '1.0'
alpha2: '1.0'
alpha3: '1.0'
alpha4: '1.0'
alpha5: '1.0'
alpha6: '1.0'
alpha7: '1.0'
alpha8: '1.0'
alpha9: '1.0'
autoscale: 'False'
axislabels: 'True'
color1: blue
color10: dark blue
color2: red
color3: green
color4: black
color5: cyan
color6: magenta
color7: yellow
color8: dark red
color9: dark green
comment: ''
ctrlpanel: 'False'
entags: 'False'
grid: 'False'
gui_hint: ''
label1: IR
label10: Signal 10
label2: Signal 2
label3: Signal 3
label4: Signal 4
label5: Signal 5
label6: Signal 6
label7: Signal 7
label8: Signal 8
label9: Signal 9
legend: 'False'
marker1: '-1'
marker10: '-1'
marker2: '-1'
marker3: '-1'
marker4: '-1'
marker5: '-1'
marker6: '-1'
marker7: '-1'
marker8: '-1'
marker9: '-1'
name: '""'
nconnections: '1'
size: '1024'
srate: data_rate
stemplot: 'True'
style1: '1'
style10: '1'
style2: '1'
style3: '1'
style4: '1'
style5: '1'
style6: '1'
style7: '1'
style8: '1'
style9: '1'
tr_chan: '0'
tr_delay: '0'
tr_level: '0'
tr_mode: qtgui.TRIG_MODE_FREE
tr_slope: qtgui.TRIG_SLOPE_POS
tr_tag: '""'
type: complex
update_time: 1/30
width1: '1'
width10: '1'
width2: '1'
width3: '1'
width4: '1'
width5: '1'
width6: '1'
width7: '1'
width8: '1'
width9: '1'
ylabel: Amplitude
ymax: '1'
ymin: '-1'
yunit: '""'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [1168, 280.0]
rotation: 0 rotation: 0
state: enabled state: enabled
- name: qtgui_time_sink_x_0_0 - name: qtgui_time_sink_x_0_0
@ -436,7 +361,7 @@ blocks:
comment: '' comment: ''
ctrlpanel: 'False' ctrlpanel: 'False'
entags: 'False' entags: 'False'
grid: 'False' grid: 'True'
gui_hint: '' gui_hint: ''
label1: IR label1: IR
label10: Signal 10 label10: Signal 10
@ -461,9 +386,9 @@ blocks:
marker9: '-1' marker9: '-1'
name: '""' name: '""'
nconnections: '1' nconnections: '1'
size: '1024' size: 32768 // decimation
srate: data_rate srate: data_rate
stemplot: 'False' stemplot: 'True'
style1: '1' style1: '1'
style10: '1' style10: '1'
style2: '1' style2: '1'
@ -476,13 +401,13 @@ blocks:
style9: '1' style9: '1'
tr_chan: '0' tr_chan: '0'
tr_delay: 10e-3 tr_delay: 10e-3
tr_level: 1e-6 tr_level: 1e-5
tr_mode: qtgui.TRIG_MODE_AUTO tr_mode: qtgui.TRIG_MODE_AUTO
tr_slope: qtgui.TRIG_SLOPE_POS tr_slope: qtgui.TRIG_SLOPE_POS
tr_tag: '""' tr_tag: '""'
type: float type: float
update_time: 1/30 update_time: 1/30
width1: '1' width1: '2'
width10: '1' width10: '1'
width2: '1' width2: '1'
width3: '1' width3: '1'
@ -493,15 +418,15 @@ blocks:
width8: '1' width8: '1'
width9: '1' width9: '1'
ylabel: Magnitude ylabel: Magnitude
ymax: 10e-6 ymax: 1e-3
ymin: '0' ymin: -1e-3
yunit: '""' yunit: '""'
states: states:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
bus_structure: null bus_structure: null
coordinate: [672, 424.0] coordinate: [1248, 536.0]
rotation: 180 rotation: 0
state: enabled state: enabled
- name: qtgui_waterfall_sink_x_0 - name: qtgui_waterfall_sink_x_0
id: qtgui_waterfall_sink_x id: qtgui_waterfall_sink_x
@ -561,23 +486,74 @@ blocks:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
bus_structure: null bus_structure: null
coordinate: [1168, 184.0] coordinate: [856, 320.0]
rotation: 0
state: enabled
- name: root_raised_cosine_filter_0
id: root_raised_cosine_filter
parameters:
affinity: ''
alias: ''
alpha: 1e-3
comment: ''
decim: '1'
gain: '1'
interp: '1'
maxoutbuf: '0'
minoutbuf: '0'
ntaps: round(560e-6 * data_rate)
samp_rate: data_rate
sym_rate: 1 / 560e-6
type: fir_filter_ccf
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [856, 512.0]
rotation: 0
state: enabled
- name: virtual_sink_0
id: virtual_sink
parameters:
alias: ''
comment: ''
stream_id: base_band
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [1096, 216.0]
rotation: 0
state: enabled
- name: virtual_source_0
id: virtual_source
parameters:
alias: ''
comment: ''
stream_id: base_band
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [488, 432.0]
rotation: 0 rotation: 0
state: enabled state: enabled
connections: connections:
- [analog_sig_source_x_0, '0', blocks_multiply_xx_0, '1']
- [blocks_char_to_float_0, '0', blocks_float_to_complex_0, '0'] - [blocks_char_to_float_0, '0', blocks_float_to_complex_0, '0']
- [blocks_char_to_float_0, '0', blocks_float_to_complex_0, '1'] - [blocks_char_to_float_0, '0', blocks_float_to_complex_0, '1']
- [blocks_char_to_float_0, '0', blocks_probe_rate_0, '0']
- [blocks_complex_to_mag_squared_0, '0', qtgui_time_sink_x_0_0, '0'] - [blocks_complex_to_mag_squared_0, '0', qtgui_time_sink_x_0_0, '0']
- [blocks_file_source_0, '0', blocks_char_to_float_0, '0'] - [blocks_file_source_0, '0', blocks_char_to_float_0, '0']
- [blocks_float_to_complex_0, '0', blocks_freqshift_cc_0, '0'] - [blocks_float_to_complex_0, '0', blocks_multiply_xx_0, '0']
- [blocks_float_to_complex_0, '0', blocks_probe_rate_0, '0'] - [blocks_multiply_xx_0, '0', fir_filter_xxx_0, '0']
- [blocks_freqshift_cc_0, '0', fir_filter_xxx_0, '0']
- [blocks_probe_rate_0, rate, blocks_message_debug_0, print] - [blocks_probe_rate_0, rate, blocks_message_debug_0, print]
- [fir_filter_xxx_0, '0', blocks_complex_to_mag_squared_0, '0'] - [fir_filter_xxx_0, '0', virtual_sink_0, '0']
- [fir_filter_xxx_0, '0', qtgui_freq_sink_x_0, '0'] - [root_raised_cosine_filter_0, '0', blocks_complex_to_mag_squared_0, '0']
- [fir_filter_xxx_0, '0', qtgui_time_sink_x_0, '0'] - [virtual_source_0, '0', qtgui_freq_sink_x_0, '0']
- [fir_filter_xxx_0, '0', qtgui_waterfall_sink_x_0, '0'] - [virtual_source_0, '0', qtgui_waterfall_sink_x_0, '0']
- [virtual_source_0, '0', root_raised_cosine_filter_0, '0']
metadata: metadata:
file_format: 1 file_format: 1

View file

@ -141,6 +141,7 @@ int main()
channel_config_set_ring(&dma_conf, true, NUM_SAMPLES_BITS); channel_config_set_ring(&dma_conf, true, NUM_SAMPLES_BITS);
channel_config_set_dreq(&dma_conf, pio_get_dreq(IR_PIO, IRP_SM, false)); channel_config_set_dreq(&dma_conf, pio_get_dreq(IR_PIO, IRP_SM, false));
channel_config_set_chain_to(&dma_conf, dma_ch_irn_rx); channel_config_set_chain_to(&dma_conf, dma_ch_irn_rx);
channel_config_set_bswap(&dma_conf, true);
dma_channel_configure(dma_ch_irp_rx, &dma_conf, irp_buffer, &IR_PIO->rxf[IRP_SM], 1, false); dma_channel_configure(dma_ch_irp_rx, &dma_conf, irp_buffer, &IR_PIO->rxf[IRP_SM], 1, false);
dma_conf = dma_channel_get_default_config(dma_ch_irn_rx); dma_conf = dma_channel_get_default_config(dma_ch_irn_rx);
@ -150,6 +151,7 @@ int main()
channel_config_set_ring(&dma_conf, true, NUM_SAMPLES_BITS); channel_config_set_ring(&dma_conf, true, NUM_SAMPLES_BITS);
channel_config_set_dreq(&dma_conf, pio_get_dreq(IR_PIO, IRN_SM, false)); channel_config_set_dreq(&dma_conf, pio_get_dreq(IR_PIO, IRN_SM, false));
channel_config_set_chain_to(&dma_conf, dma_ch_irp_rx); channel_config_set_chain_to(&dma_conf, dma_ch_irp_rx);
channel_config_set_bswap(&dma_conf, true);
dma_channel_configure(dma_ch_irn_rx, &dma_conf, irn_buffer, &IR_PIO->rxf[IRN_SM], 1, false); dma_channel_configure(dma_ch_irn_rx, &dma_conf, irn_buffer, &IR_PIO->rxf[IRN_SM], 1, false);
dma_channel_start(dma_ch_irp_rx); dma_channel_start(dma_ch_irp_rx);