From 546fd6b8ba18f457832e8c10af083cdb1d9e7d5c Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 30 Oct 2015 08:04:55 +0100 Subject: Add skeleton --- CMakeLists.txt | 86 ++ README.md | 2 + cmake/Modules/Version.cmake | 115 ++ dual_tone.grc | 2469 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 2672 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 README.md create mode 100644 cmake/Modules/Version.cmake create mode 100644 dual_tone.grc diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..190837c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,86 @@ +######################################################################## +# Project setup +######################################################################## + +cmake_minimum_required(VERSION 2.8) +project(odrdpd C CXX) + +# Select the release build type by default to get optimization flags +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Debug") + message(STATUS "Build type not specified: defaulting to debug.") +endif(NOT CMAKE_BUILD_TYPE) +set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) + + +######################################################################## +# Version information +######################################################################## + +set(VERSION_INFO_MAJOR 0) +set(VERSION_INFO_MINOR 1) +set(VERSION_INFO_PATCH 0) + +if(NOT DEFINED VERSION_INFO_EXTRA) + set(VERSION_INFO_EXTRA "git") +endif() +include(Version) + +if(NOT DEFINED VERSION) + #set(VERSION "\"${VERSION_INFO_MAJOR}.${VERSION_INFO_MINOR}.${VERSION_INFO_PATCH}\"") + set(VERSION "\"${VERSION_INFO}\"") +endif() + + +######################################################################## +# Compiler specific setup +######################################################################## + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +add_definitions(-std=gnu++11) +add_definitions(-Wall) + + +######################################################################## +# Find build dependencies +######################################################################## + +find_package(PkgConfig) +# Threads +find_package(Threads REQUIRED) + + +######################################################################## +# Setup apps +######################################################################## + +list(APPEND odrdpd_sources + main.cpp + ) + +#list(APPEND common_link_list stuff to link against) + +set_source_files_properties( + ${odrdpd_sources} + PROPERTIES LANGUAGE "CXX" + ) + +# odrdpd +add_executable(odrdpd ${odrdpd_sources}) +target_link_libraries(odrdpd ${common_link_list}) +install(TARGETS odrdpd DESTINATION bin) + + +######################################################################## +# Print Summary +######################################################################## +message(STATUS "") +message(STATUS "##########################################################") +message(STATUS "## Building version: ${VERSION}") +message(STATUS "## Using install prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "##########################################################") +message(STATUS "") + diff --git a/README.md b/README.md new file mode 100644 index 0000000..c153e72 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +Experiments in digital pre-distortion +===================================== diff --git a/cmake/Modules/Version.cmake b/cmake/Modules/Version.cmake new file mode 100644 index 0000000..554efab --- /dev/null +++ b/cmake/Modules/Version.cmake @@ -0,0 +1,115 @@ +# Portions of this file have been borrowed from and/or inspired by +# the Version.cmake from the rtl-sdr project. +# http://sdr.osmocom.org/trac/wiki/rtl-sdr +# +# Provides: +# ${VERSION_INFO_BASE} - Major.Minor.Patch +# ${VERSION_INFO} - Major.minor.Patch[-git_info] +# +# Requires values for: +# ${VERSION_INFO_MAJOR} - Increment on API compatibility changes. +# ${VERSION_INFO_MINOR} - Increment when adding features. +# ${VERSION_INFO_PATCH} - Increment for bug and documentation changes. +# +# Optional: +# ${VERSION_INFO_EXTRA} - Set to "git" to append git info. This is +# intended only for non-versioned development +# builds +# ${VERSION_INFO_OVERRIDE} - Set to a non-null value to override the +# VERSION_INFO_EXTRA logic. This is intended +# for automated snapshot builds from exported +# trees, to pass in the git revision info. +# +if(DEFINED __INCLUDED_VERSION_CMAKE) + return() +endif() +set(__INCLUDED_VERSION_CMAKE TRUE) + +################################################################################ +# Gather up variables provided by parent script +################################################################################ + +if(NOT DEFINED VERSION_INFO_MAJOR) + message(FATAL_ERROR "VERSION_INFO_MAJOR is not defined") +else() + set(VER_MAJ ${VERSION_INFO_MAJOR}) +endif() + +if(NOT DEFINED VERSION_INFO_MINOR) + message(FATAL_ERROR "VERSION_INFO_MINOR is not defined") +else() + set(VER_MIN ${VERSION_INFO_MINOR}) +endif() + +if(NOT DEFINED VERSION_INFO_PATCH) + message(FATAL_ERROR "VERSION_INFO_PATCH is not defined") +else() + set(VER_PAT ${VERSION_INFO_PATCH}) +endif() + + +################################################################################ +# Craft version number, using git, if needed +################################################################################ +find_package(Git QUIET) + +if(GIT_FOUND) + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse -- + ERROR_QUIET + RESULT_VARIABLE NOT_GIT_REPOSITORY + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) + + if(NOT_GIT_REPOSITORY) + set(GIT_INFO "-unknown") + else() + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD -- + OUTPUT_VARIABLE GIT_REV OUTPUT_STRIP_TRAILING_WHITESPACE + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) + + execute_process( + COMMAND ${GIT_EXECUTABLE} diff-index --quiet HEAD -- + RESULT_VARIABLE GIT_DIRTY + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) + + if(GIT_DIRTY) + set(GIT_INFO "-${GIT_REV}-dirty") + else() + set(GIT_INFO "-${GIT_REV}") + endif() + endif() + +else() + message(WARNING "git missing -- unable to check version.") + unset(NOT_GIT_REPOSITORY) + unset(GIT_REV) + unset(GIT_DIRTY) +endif() + + +################################################################################ +# Provide +################################################################################ +set(VERSION_INFO_BASE "${VER_MAJ}.${VER_MIN}.${VER_PAT}") + +# Force the version suffix. Used for automated export builds. +if(VERSION_INFO_OVERRIDE) + set(VERSION_INFO "${VERSION_INFO_BASE}-${VERSION_INFO_OVERRIDE}") + +# Intra-release builds +elseif("${VERSION_INFO_EXTRA}" STREQUAL "git") + set(VERSION_INFO "${VERSION_INFO_BASE}-git${GIT_INFO}") + +# Versioned releases +elseif("${VERSION_INFO_EXTRA}" STREQUAL "") + set(VERSION_INFO "${VERSION_INFO_BASE}") + +# Invalid +else() + message(FATAL_ERROR + "Unexpected definition of VERSION_INFO_EXTRA: ${VERSION_INFO_EXTRA}") +endif() diff --git a/dual_tone.grc b/dual_tone.grc new file mode 100644 index 0000000..8f3bad6 --- /dev/null +++ b/dual_tone.grc @@ -0,0 +1,2469 @@ + + + + Wed Oct 28 18:49:28 2015 + + options + + author + + + + alias + + + + window_size + + + + category + Custom + + + comment + + + + description + + + + _enabled + True + + + _coordinate + (8, 8) + + + _rotation + 0 + + + generate_options + qt_gui + + + id + dual_tone + + + max_nouts + 0 + + + realtime_scheduling + + + + run_options + prompt + + + run + True + + + thread_safe_setters + + + + title + + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (112, 77) + + + _rotation + 0 + + + id + decim + + + value + 100 + + + + variable_qtgui_entry + + comment + + + + value + 222e6 + + + _enabled + True + + + _coordinate + (8, 229) + + + gui_hint + + + + _rotation + 0 + + + id + freq + + + label + + + + type + real + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (8, 424) + + + gui_hint + + + + _rotation + 0 + + + id + rxgain + + + label + + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 50 + + + rangeType + float + + + widget + counter_slider + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (8, 77) + + + _rotation + 0 + + + id + samp_rate + + + value + 4e6 + + + + variable_qtgui_entry + + comment + + + + value + 0.4 + + + _enabled + True + + + _coordinate + (8, 165) + + + gui_hint + + + + _rotation + 0 + + + id + source_ampl + + + label + + + + type + real + + + + variable_qtgui_range + + comment + + + + value + 0 + + + _enabled + True + + + _coordinate + (8, 320) + + + gui_hint + + + + _rotation + 0 + + + id + txgain + + + label + + + + min_len + 200 + + + orient + Qt.Horizontal + + + start + 0 + + + step + 1 + + + stop + 90 + + + rangeType + float + + + widget + counter_slider + + + + analog_sig_source_x + + amp + source_ampl + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + freq + 1991 + + + _coordinate + (296, 224) + + + _rotation + 0 + + + id + analog_sig_source_x_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + offset + 0 + + + type + complex + + + samp_rate + samp_rate + + + waveform + analog.GR_COS_WAVE + + + + analog_sig_source_x + + amp + source_ampl + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + freq + 1000 + + + _coordinate + (296, 120) + + + _rotation + 0 + + + id + analog_sig_source_x_0_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + offset + 0 + + + type + complex + + + samp_rate + samp_rate + + + waveform + analog.GR_COS_WAVE + + + + blocks_add_xx + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (520, 185) + + + _rotation + 0 + + + id + blocks_add_xx_0 + + + type + complex + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + num_inputs + 2 + + + vlen + 1 + + + + low_pass_filter + + beta + 6.76 + + + alias + + + + comment + + + + affinity + + + + cutoff_freq + 20e3 + + + decim + decim + + + _enabled + 1 + + + type + fir_filter_ccf + + + _coordinate + (544, 394) + + + _rotation + 0 + + + gain + 1 + + + id + low_pass_filter_0 + + + interp + 1 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samp_rate + samp_rate + + + width + 1e3 + + + win + firdes.WIN_HAMMING + + + + qtgui_waterfall_sink_x + + bw + samp_rate/decim + + + alias + + + + fc + 0 + + + comment + + + + affinity + + + + _enabled + 1 + + + fftsize + 4096 + + + _coordinate + (768, 422) + + + gui_hint + + + + _rotation + 0 + + + grid + False + + + id + qtgui_waterfall_sink_x_0 + + + int_max + 10 + + + int_min + -140 + + + legend + True + + + alpha1 + 1.0 + + + color1 + 0 + + + label1 + + + + alpha10 + 1.0 + + + color10 + 0 + + + label10 + + + + alpha2 + 1.0 + + + color2 + 0 + + + label2 + + + + alpha3 + 1.0 + + + color3 + 0 + + + label3 + + + + alpha4 + 1.0 + + + color4 + 0 + + + label4 + + + + alpha5 + 1.0 + + + color5 + 0 + + + label5 + + + + alpha6 + 1.0 + + + color6 + 0 + + + label6 + + + + alpha7 + 1.0 + + + color7 + 0 + + + label7 + + + + alpha8 + 1.0 + + + color8 + 0 + + + label8 + + + + alpha9 + 1.0 + + + color9 + 0 + + + label9 + + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + name + "" + + + nconnections + 1 + + + showports + True + + + freqhalf + True + + + type + complex + + + update_time + 0.10 + + + wintype + firdes.WIN_BLACKMAN_hARRIS + + + + uhd_usrp_sink + + alias + + + + ant0 + + + + bw0 + 0 + + + center_freq0 + freq + + + norm_gain0 + False + + + gain0 + txgain + + + ant10 + + + + bw10 + 0 + + + center_freq10 + 0 + + + norm_gain10 + False + + + gain10 + 0 + + + ant11 + + + + bw11 + 0 + + + center_freq11 + 0 + + + norm_gain11 + False + + + gain11 + 0 + + + ant12 + + + + bw12 + 0 + + + center_freq12 + 0 + + + norm_gain12 + False + + + gain12 + 0 + + + ant13 + + + + bw13 + 0 + + + center_freq13 + 0 + + + norm_gain13 + False + + + gain13 + 0 + + + ant14 + + + + bw14 + 0 + + + center_freq14 + 0 + + + norm_gain14 + False + + + gain14 + 0 + + + ant15 + + + + bw15 + 0 + + + center_freq15 + 0 + + + norm_gain15 + False + + + gain15 + 0 + + + ant16 + + + + bw16 + 0 + + + center_freq16 + 0 + + + norm_gain16 + False + + + gain16 + 0 + + + ant17 + + + + bw17 + 0 + + + center_freq17 + 0 + + + norm_gain17 + False + + + gain17 + 0 + + + ant18 + + + + bw18 + 0 + + + center_freq18 + 0 + + + norm_gain18 + False + + + gain18 + 0 + + + ant19 + + + + bw19 + 0 + + + center_freq19 + 0 + + + norm_gain19 + False + + + gain19 + 0 + + + ant1 + + + + bw1 + 0 + + + center_freq1 + 0 + + + norm_gain1 + False + + + gain1 + 0 + + + ant20 + + + + bw20 + 0 + + + center_freq20 + 0 + + + norm_gain20 + False + + + gain20 + 0 + + + ant21 + + + + bw21 + 0 + + + center_freq21 + 0 + + + norm_gain21 + False + + + gain21 + 0 + + + ant22 + + + + bw22 + 0 + + + center_freq22 + 0 + + + norm_gain22 + False + + + gain22 + 0 + + + ant23 + + + + bw23 + 0 + + + center_freq23 + 0 + + + norm_gain23 + False + + + gain23 + 0 + + + ant24 + + + + bw24 + 0 + + + center_freq24 + 0 + + + norm_gain24 + False + + + gain24 + 0 + + + ant25 + + + + bw25 + 0 + + + center_freq25 + 0 + + + norm_gain25 + False + + + gain25 + 0 + + + ant26 + + + + bw26 + 0 + + + center_freq26 + 0 + + + norm_gain26 + False + + + gain26 + 0 + + + ant27 + + + + bw27 + 0 + + + center_freq27 + 0 + + + norm_gain27 + False + + + gain27 + 0 + + + ant28 + + + + bw28 + 0 + + + center_freq28 + 0 + + + norm_gain28 + False + + + gain28 + 0 + + + ant29 + + + + bw29 + 0 + + + center_freq29 + 0 + + + norm_gain29 + False + + + gain29 + 0 + + + ant2 + + + + bw2 + 0 + + + center_freq2 + 0 + + + norm_gain2 + False + + + gain2 + 0 + + + ant30 + + + + bw30 + 0 + + + center_freq30 + 0 + + + norm_gain30 + False + + + gain30 + 0 + + + ant31 + + + + bw31 + 0 + + + center_freq31 + 0 + + + norm_gain31 + False + + + gain31 + 0 + + + ant3 + + + + bw3 + 0 + + + center_freq3 + 0 + + + norm_gain3 + False + + + gain3 + 0 + + + ant4 + + + + bw4 + 0 + + + center_freq4 + 0 + + + norm_gain4 + False + + + gain4 + 0 + + + ant5 + + + + bw5 + 0 + + + center_freq5 + 0 + + + norm_gain5 + False + + + gain5 + 0 + + + ant6 + + + + bw6 + 0 + + + center_freq6 + 0 + + + norm_gain6 + False + + + gain6 + 0 + + + ant7 + + + + bw7 + 0 + + + center_freq7 + 0 + + + norm_gain7 + False + + + gain7 + 0 + + + ant8 + + + + bw8 + 0 + + + center_freq8 + 0 + + + norm_gain8 + False + + + gain8 + 0 + + + ant9 + + + + bw9 + 0 + + + center_freq9 + 0 + + + norm_gain9 + False + + + gain9 + 0 + + + clock_rate + 0.0 + + + comment + + + + affinity + + + + dev_addr + "" + + + dev_args + "" + + + _enabled + True + + + _coordinate + (752, 159) + + + _rotation + 0 + + + id + uhd_usrp_sink_0 + + + type + fc32 + + + len_tag_name + + + + clock_source0 + + + + sd_spec0 + + + + time_source0 + + + + clock_source1 + + + + sd_spec1 + + + + time_source1 + + + + clock_source2 + + + + sd_spec2 + + + + time_source2 + + + + clock_source3 + + + + sd_spec3 + + + + time_source3 + + + + clock_source4 + + + + sd_spec4 + + + + time_source4 + + + + clock_source5 + + + + sd_spec5 + + + + time_source5 + + + + clock_source6 + + + + sd_spec6 + + + + time_source6 + + + + clock_source7 + + + + sd_spec7 + + + + time_source7 + + + + nchan + 1 + + + num_mboards + 1 + + + samp_rate + samp_rate + + + stream_args + + + + stream_chans + [] + + + sync + + + + otw + + + + + uhd_usrp_source + + alias + + + + ant0 + + + + bw0 + 0 + + + center_freq0 + freq + + + norm_gain0 + False + + + gain0 + rxgain + + + ant10 + + + + bw10 + 0 + + + center_freq10 + 0 + + + norm_gain10 + False + + + gain10 + 0 + + + ant11 + + + + bw11 + 0 + + + center_freq11 + 0 + + + norm_gain11 + False + + + gain11 + 0 + + + ant12 + + + + bw12 + 0 + + + center_freq12 + 0 + + + norm_gain12 + False + + + gain12 + 0 + + + ant13 + + + + bw13 + 0 + + + center_freq13 + 0 + + + norm_gain13 + False + + + gain13 + 0 + + + ant14 + + + + bw14 + 0 + + + center_freq14 + 0 + + + norm_gain14 + False + + + gain14 + 0 + + + ant15 + + + + bw15 + 0 + + + center_freq15 + 0 + + + norm_gain15 + False + + + gain15 + 0 + + + ant16 + + + + bw16 + 0 + + + center_freq16 + 0 + + + norm_gain16 + False + + + gain16 + 0 + + + ant17 + + + + bw17 + 0 + + + center_freq17 + 0 + + + norm_gain17 + False + + + gain17 + 0 + + + ant18 + + + + bw18 + 0 + + + center_freq18 + 0 + + + norm_gain18 + False + + + gain18 + 0 + + + ant19 + + + + bw19 + 0 + + + center_freq19 + 0 + + + norm_gain19 + False + + + gain19 + 0 + + + ant1 + + + + bw1 + 0 + + + center_freq1 + 0 + + + norm_gain1 + False + + + gain1 + 0 + + + ant20 + + + + bw20 + 0 + + + center_freq20 + 0 + + + norm_gain20 + False + + + gain20 + 0 + + + ant21 + + + + bw21 + 0 + + + center_freq21 + 0 + + + norm_gain21 + False + + + gain21 + 0 + + + ant22 + + + + bw22 + 0 + + + center_freq22 + 0 + + + norm_gain22 + False + + + gain22 + 0 + + + ant23 + + + + bw23 + 0 + + + center_freq23 + 0 + + + norm_gain23 + False + + + gain23 + 0 + + + ant24 + + + + bw24 + 0 + + + center_freq24 + 0 + + + norm_gain24 + False + + + gain24 + 0 + + + ant25 + + + + bw25 + 0 + + + center_freq25 + 0 + + + norm_gain25 + False + + + gain25 + 0 + + + ant26 + + + + bw26 + 0 + + + center_freq26 + 0 + + + norm_gain26 + False + + + gain26 + 0 + + + ant27 + + + + bw27 + 0 + + + center_freq27 + 0 + + + norm_gain27 + False + + + gain27 + 0 + + + ant28 + + + + bw28 + 0 + + + center_freq28 + 0 + + + norm_gain28 + False + + + gain28 + 0 + + + ant29 + + + + bw29 + 0 + + + center_freq29 + 0 + + + norm_gain29 + False + + + gain29 + 0 + + + ant2 + + + + bw2 + 0 + + + center_freq2 + 0 + + + norm_gain2 + False + + + gain2 + 0 + + + ant30 + + + + bw30 + 0 + + + center_freq30 + 0 + + + norm_gain30 + False + + + gain30 + 0 + + + ant31 + + + + bw31 + 0 + + + center_freq31 + 0 + + + norm_gain31 + False + + + gain31 + 0 + + + ant3 + + + + bw3 + 0 + + + center_freq3 + 0 + + + norm_gain3 + False + + + gain3 + 0 + + + ant4 + + + + bw4 + 0 + + + center_freq4 + 0 + + + norm_gain4 + False + + + gain4 + 0 + + + ant5 + + + + bw5 + 0 + + + center_freq5 + 0 + + + norm_gain5 + False + + + gain5 + 0 + + + ant6 + + + + bw6 + 0 + + + center_freq6 + 0 + + + norm_gain6 + False + + + gain6 + 0 + + + ant7 + + + + bw7 + 0 + + + center_freq7 + 0 + + + norm_gain7 + False + + + gain7 + 0 + + + ant8 + + + + bw8 + 0 + + + center_freq8 + 0 + + + norm_gain8 + False + + + gain8 + 0 + + + ant9 + + + + bw9 + 0 + + + center_freq9 + 0 + + + norm_gain9 + False + + + gain9 + 0 + + + clock_rate + 0.0 + + + comment + + + + affinity + + + + dev_addr + "" + + + dev_args + "" + + + _enabled + True + + + _coordinate + (272, 422) + + + _rotation + 0 + + + id + uhd_usrp_source_0 + + + maxoutbuf + 0 + + + clock_source0 + + + + sd_spec0 + + + + time_source0 + + + + clock_source1 + + + + sd_spec1 + + + + time_source1 + + + + clock_source2 + + + + sd_spec2 + + + + time_source2 + + + + clock_source3 + + + + sd_spec3 + + + + time_source3 + + + + clock_source4 + + + + sd_spec4 + + + + time_source4 + + + + clock_source5 + + + + sd_spec5 + + + + time_source5 + + + + clock_source6 + + + + sd_spec6 + + + + time_source6 + + + + clock_source7 + + + + sd_spec7 + + + + time_source7 + + + + minoutbuf + 0 + + + nchan + 1 + + + num_mboards + 1 + + + type + fc32 + + + samp_rate + samp_rate + + + stream_args + + + + stream_chans + [] + + + sync + + + + otw + + + + + analog_sig_source_x_0 + blocks_add_xx_0 + 0 + 1 + + + analog_sig_source_x_0_0 + blocks_add_xx_0 + 0 + 0 + + + blocks_add_xx_0 + uhd_usrp_sink_0 + 0 + 0 + + + low_pass_filter_0 + qtgui_waterfall_sink_x_0 + 0 + 0 + + + uhd_usrp_source_0 + low_pass_filter_0 + 0 + 0 + + -- cgit v1.2.3