first stab at converting front end to use integrate & dump instead of cheesy "bit_energy" thing
This commit is contained in:
parent
46573db399
commit
f86635430e
@ -67,8 +67,8 @@ static bool pmtcompare(pmt::pmt_t x, pmt::pmt_t y)
|
||||
t_y = pmt::pmt_to_uint64(pmt::pmt_tuple_ref(y, 0));
|
||||
return t_x < t_y;
|
||||
}
|
||||
|
||||
static double pmt_to_timestamp(pmt::pmt_t tstamp, sample_cnt, secs_per_sample) {
|
||||
/*
|
||||
static double pmt_to_timestamp(pmt::pmt_t tstamp, uint64_t sample_cnt, double secs_per_sample) {
|
||||
double frac;
|
||||
uint64_t secs, sample, sample_age;
|
||||
|
||||
@ -81,7 +81,7 @@ static double pmt_to_timestamp(pmt::pmt_t tstamp, sample_cnt, secs_per_sample) {
|
||||
sample_age = (sample_cnt + i) - sample;
|
||||
return sample_age * secs_per_sample + frac + secs;
|
||||
}
|
||||
|
||||
*/
|
||||
int air_modes_slicer::work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
@ -176,7 +176,7 @@ int air_modes_slicer::work(int noutput_items,
|
||||
|
||||
/******************** BEGIN TIMESTAMP BS ******************/
|
||||
rx_packet.timestamp = 0;
|
||||
|
||||
/*
|
||||
uint64_t abs_sample_cnt = nitems_read(0);
|
||||
std::vector<pmt::pmt_t> tags;
|
||||
uint64_t timestamp_secs, timestamp_sample, timestamp_delta;
|
||||
@ -191,6 +191,7 @@ int air_modes_slicer::work(int noutput_items,
|
||||
if(d_timestamp) {
|
||||
rx_packet.timestamp = pmt_to_timestamp(d_timestamp, abs_sample_cnt + i, d_secs_per_sample);
|
||||
}
|
||||
*/
|
||||
/******************* END TIMESTAMP BS *********************/
|
||||
|
||||
//increment for the next round
|
||||
|
@ -40,7 +40,8 @@ int early_late(const float *data, int samples_per_chip) {
|
||||
|
||||
//return total bit energy of a chip centered at the current point (we bias right for even samples per chip)
|
||||
float bit_energy(const float *data, int samples_per_chip) {
|
||||
float energy = 0;
|
||||
return *data;
|
||||
/* float energy = 0;
|
||||
if(samples_per_chip <= 2) {
|
||||
energy = data[0];
|
||||
} else {
|
||||
@ -49,4 +50,5 @@ float bit_energy(const float *data, int samples_per_chip) {
|
||||
}
|
||||
}
|
||||
return energy;
|
||||
*/
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ from modes_sql import modes_output_sql
|
||||
from modes_sbs1 import modes_output_sbs1
|
||||
from modes_kml import modes_kml
|
||||
import gnuradio.gr.gr_threading as _threading
|
||||
import numpy
|
||||
|
||||
class top_block_runner(_threading.Thread):
|
||||
def __init__(self, tb):
|
||||
@ -87,13 +88,20 @@ class adsb_rx_block (gr.top_block):
|
||||
pass_all = 1
|
||||
|
||||
self.demod = gr.complex_to_mag()
|
||||
self.avg = gr.moving_average_ff(100, 1.0/100, 400);
|
||||
self.avg = gr.moving_average_ff(100, 1.0/100, 400)
|
||||
|
||||
#the DBSRX especially tends to be spur-prone; the LPF keeps out the
|
||||
#spur multiple that shows up at 2MHz
|
||||
# self.filtcoeffs = gr.firdes.low_pass(1, rate, 1.8e6, 200e3)
|
||||
# self.filter = gr.fir_filter_fff(1, self.filtcoeffs)
|
||||
|
||||
#this is an integrate-and-dump filter to act as a matched filter
|
||||
self.filtcoeffs = list(numpy.ones(int(rate/2e6)))
|
||||
#i think downstream blocks can therefore process at 2Msps -- try this
|
||||
#self.filter = gr.fir_filter_fff(int(rate/2e6), self.filtcoeffs)
|
||||
self.filter = gr.fir_filter_fff(1, self.filtcoeffs)
|
||||
|
||||
#rate = 2e6
|
||||
self.preamble = air.modes_preamble(rate, options.threshold)
|
||||
self.framer = air.modes_framer(rate)
|
||||
self.slicer = air.modes_slicer(rate, queue)
|
||||
|
Loading…
Reference in New Issue
Block a user