Compare commits
3 commits
1c3ec5cb49
...
57e36203aa
Author | SHA1 | Date | |
---|---|---|---|
57e36203aa | |||
2fc01539f0 | |||
8a9a927c8b |
|
@ -205,7 +205,7 @@ blocks:
|
|||
ant8: ''
|
||||
ant9: ''
|
||||
args: '"rtl_tcp"'
|
||||
bb_gain0: '20'
|
||||
bb_gain0: '0'
|
||||
bb_gain1: '20'
|
||||
bb_gain10: '20'
|
||||
bb_gain11: '20'
|
||||
|
@ -374,7 +374,7 @@ blocks:
|
|||
freq7: 100e6
|
||||
freq8: 100e6
|
||||
freq9: 100e6
|
||||
gain0: '10'
|
||||
gain0: '0'
|
||||
gain1: '10'
|
||||
gain10: '10'
|
||||
gain11: '10'
|
||||
|
@ -438,7 +438,7 @@ blocks:
|
|||
gain_mode7: 'False'
|
||||
gain_mode8: 'False'
|
||||
gain_mode9: 'False'
|
||||
if_gain0: '20'
|
||||
if_gain0: '0'
|
||||
if_gain1: '20'
|
||||
if_gain10: '20'
|
||||
if_gain11: '20'
|
||||
|
|
112
grc/PicoSDR.grc
112
grc/PicoSDR.grc
|
@ -45,11 +45,23 @@ blocks:
|
|||
coordinate: [168, 8.0]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
- name: samp_rate
|
||||
- name: decimation
|
||||
id: variable
|
||||
parameters:
|
||||
comment: ''
|
||||
value: '50_000'
|
||||
value: '4'
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [352, 8.0]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
- name: rf_rate
|
||||
id: variable
|
||||
parameters:
|
||||
comment: ''
|
||||
value: '200_000'
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
|
@ -57,6 +69,38 @@ blocks:
|
|||
coordinate: [264, 8.0]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
- name: samp_rate
|
||||
id: variable
|
||||
parameters:
|
||||
comment: ''
|
||||
value: rf_rate // decimation
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [456, 8.0]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
- name: analog_agc_xx_0
|
||||
id: analog_agc_xx
|
||||
parameters:
|
||||
affinity: ''
|
||||
alias: ''
|
||||
comment: ''
|
||||
gain: '1.0'
|
||||
max_gain: '65536'
|
||||
maxoutbuf: '0'
|
||||
minoutbuf: '0'
|
||||
rate: 1e-4
|
||||
reference: '0.7'
|
||||
type: complex
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [360, 312.0]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
- name: analog_quadrature_demod_cf_0
|
||||
id: analog_quadrature_demod_cf
|
||||
parameters:
|
||||
|
@ -70,7 +114,7 @@ blocks:
|
|||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [640, 536.0]
|
||||
coordinate: [768, 616.0]
|
||||
rotation: 0
|
||||
state: true
|
||||
- name: blocks_message_debug_0
|
||||
|
@ -85,7 +129,7 @@ blocks:
|
|||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [928, 32.0]
|
||||
coordinate: [1056, 112.0]
|
||||
rotation: 0
|
||||
state: true
|
||||
- name: blocks_probe_rate_0
|
||||
|
@ -105,7 +149,7 @@ blocks:
|
|||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [640, 40.0]
|
||||
coordinate: [768, 120.0]
|
||||
rotation: 0
|
||||
state: true
|
||||
- name: digital_costas_loop_cc_0
|
||||
|
@ -123,9 +167,33 @@ blocks:
|
|||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [640, 344.0]
|
||||
coordinate: [768, 424.0]
|
||||
rotation: 0
|
||||
state: true
|
||||
- name: low_pass_filter_0
|
||||
id: low_pass_filter
|
||||
parameters:
|
||||
affinity: ''
|
||||
alias: ''
|
||||
beta: '6.76'
|
||||
comment: ''
|
||||
cutoff_freq: samp_rate / 8
|
||||
decim: decimation
|
||||
gain: '1'
|
||||
interp: '1'
|
||||
maxoutbuf: '0'
|
||||
minoutbuf: '0'
|
||||
samp_rate: rf_rate
|
||||
type: fir_filter_ccf
|
||||
width: samp_rate / 8
|
||||
win: window.WIN_HAMMING
|
||||
states:
|
||||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [520, 284.0]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
- name: osmosdr_source_0
|
||||
id: osmosdr_source
|
||||
parameters:
|
||||
|
@ -164,7 +232,7 @@ blocks:
|
|||
ant8: ''
|
||||
ant9: ''
|
||||
args: '"rtl_tcp"'
|
||||
bb_gain0: '20'
|
||||
bb_gain0: '0'
|
||||
bb_gain1: '20'
|
||||
bb_gain10: '20'
|
||||
bb_gain11: '20'
|
||||
|
@ -333,7 +401,7 @@ blocks:
|
|||
freq7: 100e6
|
||||
freq8: 100e6
|
||||
freq9: 100e6
|
||||
gain0: '10'
|
||||
gain0: '0'
|
||||
gain1: '10'
|
||||
gain10: '10'
|
||||
gain11: '10'
|
||||
|
@ -397,7 +465,7 @@ blocks:
|
|||
gain_mode7: 'False'
|
||||
gain_mode8: 'False'
|
||||
gain_mode9: 'False'
|
||||
if_gain0: '20'
|
||||
if_gain0: '0'
|
||||
if_gain1: '20'
|
||||
if_gain10: '20'
|
||||
if_gain11: '20'
|
||||
|
@ -465,7 +533,7 @@ blocks:
|
|||
minoutbuf: '0'
|
||||
nchan: '1'
|
||||
num_mboards: '1'
|
||||
sample_rate: samp_rate
|
||||
sample_rate: rf_rate
|
||||
sync: sync
|
||||
time_source0: ''
|
||||
time_source1: ''
|
||||
|
@ -480,7 +548,7 @@ blocks:
|
|||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [152, 164.0]
|
||||
coordinate: [104, 244.0]
|
||||
rotation: 0
|
||||
state: enabled
|
||||
- name: qtgui_const_sink_x_0
|
||||
|
@ -572,7 +640,7 @@ blocks:
|
|||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [928, 328.0]
|
||||
coordinate: [1056, 408.0]
|
||||
rotation: 0
|
||||
state: true
|
||||
- name: qtgui_time_sink_x_0
|
||||
|
@ -669,7 +737,7 @@ blocks:
|
|||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [640, 232.0]
|
||||
coordinate: [768, 312.0]
|
||||
rotation: 0
|
||||
state: true
|
||||
- name: qtgui_time_sink_x_0_0
|
||||
|
@ -766,7 +834,7 @@ blocks:
|
|||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [928, 512.0]
|
||||
coordinate: [1056, 592.0]
|
||||
rotation: 0
|
||||
state: true
|
||||
- name: qtgui_time_sink_x_0_1
|
||||
|
@ -863,7 +931,7 @@ blocks:
|
|||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [928, 400.0]
|
||||
coordinate: [1056, 480.0]
|
||||
rotation: 0
|
||||
state: true
|
||||
- name: qtgui_waterfall_sink_x_0_0
|
||||
|
@ -924,20 +992,22 @@ blocks:
|
|||
bus_sink: false
|
||||
bus_source: false
|
||||
bus_structure: null
|
||||
coordinate: [640, 128.0]
|
||||
coordinate: [768, 208.0]
|
||||
rotation: 0
|
||||
state: true
|
||||
|
||||
connections:
|
||||
- [analog_agc_xx_0, '0', low_pass_filter_0, '0']
|
||||
- [analog_quadrature_demod_cf_0, '0', qtgui_time_sink_x_0_0, '0']
|
||||
- [blocks_probe_rate_0, rate, blocks_message_debug_0, print]
|
||||
- [digital_costas_loop_cc_0, '0', qtgui_const_sink_x_0, '0']
|
||||
- [digital_costas_loop_cc_0, '0', qtgui_time_sink_x_0_1, '0']
|
||||
- [osmosdr_source_0, '0', analog_quadrature_demod_cf_0, '0']
|
||||
- [osmosdr_source_0, '0', blocks_probe_rate_0, '0']
|
||||
- [osmosdr_source_0, '0', digital_costas_loop_cc_0, '0']
|
||||
- [osmosdr_source_0, '0', qtgui_time_sink_x_0, '0']
|
||||
- [osmosdr_source_0, '0', qtgui_waterfall_sink_x_0_0, '0']
|
||||
- [low_pass_filter_0, '0', analog_quadrature_demod_cf_0, '0']
|
||||
- [low_pass_filter_0, '0', blocks_probe_rate_0, '0']
|
||||
- [low_pass_filter_0, '0', digital_costas_loop_cc_0, '0']
|
||||
- [low_pass_filter_0, '0', qtgui_time_sink_x_0, '0']
|
||||
- [low_pass_filter_0, '0', qtgui_waterfall_sink_x_0_0, '0']
|
||||
- [osmosdr_source_0, '0', analog_agc_xx_0, '0']
|
||||
|
||||
metadata:
|
||||
file_format: 1
|
||||
|
|
16
src/main.c
16
src/main.c
|
@ -251,12 +251,11 @@ static void lo_generate(uint32_t *buf, double freq, uint32_t phase)
|
|||
{
|
||||
freq_step = STEP_BASE * freq;
|
||||
|
||||
unsigned down = 4 + __builtin_clz(freq_step);
|
||||
unsigned down = 2 + __builtin_clz(freq_step);
|
||||
|
||||
for (size_t i = 0; i < LO_WORDS; i++) {
|
||||
uint32_t bits = 0;
|
||||
int shift = (rnd_next() >> down) - (rnd_next() >> down) + (rnd_next() >> down) -
|
||||
(rnd_next() >> down);
|
||||
int shift = (rnd_next() >> down) - (rnd_next() >> down);
|
||||
|
||||
for (int j = 0; j < 32; j++) {
|
||||
bits |= (phase + shift) >> 31;
|
||||
|
@ -272,13 +271,12 @@ static void lo_tweak(uint32_t *buf, uint32_t phase)
|
|||
{
|
||||
static size_t i = 0;
|
||||
uint32_t bits = 0;
|
||||
unsigned down = 4 + __builtin_clz(freq_step);
|
||||
unsigned down = 2 + __builtin_clz(freq_step);
|
||||
|
||||
phase += freq_step * i * 32;
|
||||
|
||||
for (int j = 0; j < 32; j++) {
|
||||
int shift = (rnd_next() >> down) - (rnd_next() >> down) + (rnd_next() >> down) -
|
||||
(rnd_next() >> down);
|
||||
int shift = (rnd_next() >> down) - (rnd_next() >> down);
|
||||
bits |= (phase + shift) >> 31;
|
||||
bits <<= 1;
|
||||
phase += freq_step;
|
||||
|
@ -602,8 +600,10 @@ static void rf_rx(void)
|
|||
iq_queue_pos = (iq_queue_pos + 1) & (IQ_QUEUE_LEN - 1);
|
||||
}
|
||||
|
||||
lo_tweak(lo_cos, COS_PHASE);
|
||||
lo_tweak(lo_sin, SIN_PHASE);
|
||||
for (int i = 0; i < 8; i++) {
|
||||
lo_tweak(lo_cos, COS_PHASE);
|
||||
lo_tweak(lo_sin, SIN_PHASE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue