Update to GR 3.9.0. WIP with plenty of untested code.
This commit is contained in:
+15
-8
@@ -22,22 +22,29 @@
|
||||
########################################################################
|
||||
include(GrPlatform) #define LIB_SUFFIX
|
||||
|
||||
add_library(air_modes SHARED
|
||||
set(air_modes_sources
|
||||
preamble_impl.cc
|
||||
slicer_impl.cc
|
||||
modes_crc.cc
|
||||
)
|
||||
target_link_libraries(air_modes gnuradio::gnuradio-runtime)
|
||||
target_include_directories(air_modes
|
||||
|
||||
set(air_modes_sources "${air_modes_sources}" PARENT_SCOPE)
|
||||
|
||||
add_library(gnuradio-air_modes SHARED
|
||||
${air_modes_sources}
|
||||
)
|
||||
target_link_libraries(gnuradio-air_modes gnuradio::gnuradio-runtime)
|
||||
target_include_directories(gnuradio-air_modes
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
||||
PUBLIC $<INSTALL_INTERFACE:include>
|
||||
)
|
||||
set_target_properties(air_modes PROPERTIES DEFINE_SYMBOL "AIR_MODES_EXPORTS")
|
||||
set_target_properties(air_modes PROPERTIES SOVERSION "${VERSION_MAJOR}")
|
||||
set_target_properties(air_modes PROPERTIES VERSION "${VERSION_MAJOR}.${VERSION_MINOR}")
|
||||
|
||||
set_target_properties(gnuradio-air_modes PROPERTIES DEFINE_SYMBOL "AIR_MODES_EXPORTS")
|
||||
set_target_properties(gnuradio-air_modes PROPERTIES SOVERSION "${VERSION_MAJOR}")
|
||||
set_target_properties(gnuradio-air_modes PROPERTIES VERSION "${VERSION_MAJOR}.${VERSION_MINOR}")
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(air_modes PROPERTIES
|
||||
set_target_properties(gnuradio-air_modes PROPERTIES
|
||||
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
|
||||
)
|
||||
endif(APPLE)
|
||||
@@ -46,7 +53,7 @@ endif(APPLE)
|
||||
# Install built library files
|
||||
########################################################################
|
||||
include(GrMiscUtils)
|
||||
GR_LIBRARY_FOO(air_modes)
|
||||
GR_LIBRARY_FOO(gnuradio-air_modes)
|
||||
|
||||
########################################################################
|
||||
# Print summary
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <gr_air_modes/types.h>
|
||||
#include <gr_air_modes/modes_crc.h>
|
||||
#include <air_modes/types.h>
|
||||
#include <air_modes/modes_crc.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
+15
-10
@@ -33,15 +33,19 @@
|
||||
#include <gnuradio/tags.h>
|
||||
|
||||
namespace gr {
|
||||
namespace air_modes {
|
||||
|
||||
air_modes::preamble::sptr air_modes::preamble::make(float channel_rate, float threshold_db) {
|
||||
return gnuradio::get_initial_sptr(new air_modes::preamble_impl(channel_rate, threshold_db));
|
||||
using input_type = float;
|
||||
using output_type = float;
|
||||
|
||||
preamble::sptr preamble::make(float channel_rate, float threshold_db) {
|
||||
return gnuradio::make_block_sptr<preamble_impl>(channel_rate, threshold_db);
|
||||
}
|
||||
|
||||
air_modes::preamble_impl::preamble_impl(float channel_rate, float threshold_db) :
|
||||
gr::block ("preamble",
|
||||
gr::io_signature::make2 (2, 2, sizeof(float), sizeof(float)), //stream 0 is received data, stream 1 is moving average for reference
|
||||
gr::io_signature::make (1, 1, sizeof(float))) //the output soft symbols
|
||||
preamble_impl::preamble_impl(float channel_rate, float threshold_db)
|
||||
: gr::block ("preamble",
|
||||
gr::io_signature::make(2, 2, sizeof(input_type)),
|
||||
gr::io_signature::make(1, 1, sizeof(output_type)))
|
||||
{
|
||||
d_chip_rate = 2000000; //2Mchips per second
|
||||
set_rate(channel_rate);
|
||||
@@ -62,16 +66,16 @@ void air_modes::preamble_impl::set_rate(float channel_rate) {
|
||||
set_history(d_samples_per_symbol);
|
||||
}
|
||||
|
||||
void air_modes::preamble_impl::set_threshold(float threshold_db) {
|
||||
void preamble_impl::set_threshold(float threshold_db) {
|
||||
d_threshold_db = threshold_db;
|
||||
d_threshold = powf(10., threshold_db/20.); //the level that the sample must be above the moving average in order to qualify as a pulse
|
||||
}
|
||||
|
||||
float air_modes::preamble_impl::get_threshold(void) {
|
||||
float preamble_impl::get_threshold(void) {
|
||||
return d_threshold_db;
|
||||
}
|
||||
|
||||
float air_modes::preamble_impl::get_rate(void) {
|
||||
float preamble_impl::get_rate(void) {
|
||||
return d_sample_rate;
|
||||
}
|
||||
|
||||
@@ -136,7 +140,7 @@ static pmt::pmt_t tag_to_timestamp(gr::tag_t tstamp, uint64_t abs_sample_cnt, in
|
||||
return tstime;
|
||||
}
|
||||
|
||||
int air_modes::preamble_impl::general_work(int noutput_items,
|
||||
int preamble_impl::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
@@ -245,4 +249,5 @@ int air_modes::preamble_impl::general_work(int noutput_items,
|
||||
return 0;
|
||||
}
|
||||
|
||||
} //namespace air_modes
|
||||
} //namespace gr
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
#define _AIR_MODES_PREAMBLE_IMPL_H_
|
||||
|
||||
#include <gnuradio/block.h>
|
||||
#include <gr_air_modes/api.h>
|
||||
#include <gr_air_modes/preamble.h>
|
||||
#include <air_modes/api.h>
|
||||
#include <air_modes/preamble.h>
|
||||
|
||||
namespace gr {
|
||||
namespace air_modes {
|
||||
|
||||
+12
-10
@@ -28,10 +28,10 @@
|
||||
#include <ciso646>
|
||||
#include "slicer_impl.h"
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <gr_air_modes/types.h>
|
||||
#include <air_modes/types.h>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <gr_air_modes/modes_crc.h>
|
||||
#include <air_modes/modes_crc.h>
|
||||
#include <iostream>
|
||||
#include <gnuradio/tags.h>
|
||||
|
||||
@@ -42,15 +42,16 @@ extern "C"
|
||||
}
|
||||
|
||||
namespace gr {
|
||||
namespace air_modes {
|
||||
|
||||
air_modes::slicer::sptr air_modes::slicer::make(gr::msg_queue::sptr queue) {
|
||||
return gnuradio::get_initial_sptr(new air_modes::slicer_impl(queue));
|
||||
slicer::sptr slicer::make(gr::msg_queue::sptr queue) {
|
||||
return gnuradio::make_block_sptr<slicer_impl>(queue);
|
||||
}
|
||||
|
||||
air_modes::slicer_impl::slicer_impl(gr::msg_queue::sptr queue) :
|
||||
slicer_impl::slicer_impl(gr::msg_queue::sptr queue) :
|
||||
gr::sync_block ("slicer",
|
||||
gr::io_signature::make (1, 1, sizeof(float)),
|
||||
gr::io_signature::make (0, 0, 0) )
|
||||
gr::io_signature::make(1, 1, sizeof(float)),
|
||||
gr::io_signature::make(0, 0, 0))
|
||||
{
|
||||
//initialize private data here
|
||||
d_chip_rate = 2000000; //2Mchips per second
|
||||
@@ -99,9 +100,9 @@ static slice_result_t llslicer(const float bit0, const float bit1, const float r
|
||||
return result;
|
||||
}
|
||||
|
||||
int air_modes::slicer_impl::work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
int slicer_impl::work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
{
|
||||
const float *in = (const float *) input_items[0];
|
||||
int size = noutput_items - d_check_width; //since it's a sync block, i assume that it runs with ninput_items = noutput_items
|
||||
@@ -197,4 +198,5 @@ int air_modes::slicer_impl::work(int noutput_items,
|
||||
return size;
|
||||
}
|
||||
|
||||
} //namespace air_modes
|
||||
} //namespace gr
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@
|
||||
|
||||
#include <gnuradio/sync_block.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <gr_air_modes/api.h>
|
||||
#include <gr_air_modes/slicer.h>
|
||||
#include <air_modes/api.h>
|
||||
#include <air_modes/slicer.h>
|
||||
|
||||
namespace gr {
|
||||
namespace air_modes {
|
||||
|
||||
Reference in New Issue
Block a user