1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-10-31 15:07:12 -04:00

M17 code reorganization

This commit is contained in:
f4exb 2022-07-20 05:47:48 +02:00
parent e39277269c
commit ac2a45ce88
47 changed files with 82 additions and 82 deletions

View File

@ -549,10 +549,7 @@ add_subdirectory(qrtplib)
add_subdirectory(swagger)
add_subdirectory(devices)
add_subdirectory(sdrbench)
if (LINUX)
add_subdirectory(modems)
endif()
add_subdirectory(modemm17)
if (BUILD_GUI)
add_subdirectory(sdrgui)

View File

@ -139,16 +139,16 @@
# define SDRBENCH_API
#endif
/* the 'M17_API' controls the import/export of 'm17' symbols
/* the 'MODEMM17_API' controls the import/export of 'modemm17' symbols
*/
#if !defined(sdrangel_STATIC)
# ifdef m17_EXPORTS
# define M17_API __SDR_EXPORT
# ifdef modemm17_EXPORTS
# define MODEMM17_API __SDR_EXPORT
# else
# define M17_API __SDR_IMPORT
# define MODEMM17_API __SDR_IMPORT
# endif
#else
# define M17_API
# define MODEMM17_API
#endif
#endif /* __SDRANGEL_EXPORT_H */

56
modemm17/CMakeLists.txt Normal file
View File

@ -0,0 +1,56 @@
project(modemm17)
set(modemm17_SOURCES
Correlator.cpp
FreqDevEstimator.cpp
Golay24.cpp
M17Demodulator.cpp
M17Modulator.cpp
)
set(modemm17_HEADERS
ax25_frame.h
CarrierDetect.h
ClockRecovery.h
Convolution.h
Correlator.h
CRC16.h
DataCarrierDetect.h
DeviationError.h
Filter.h
FirFilter.h
FreqDevEstimator.h
FrequencyError.h
Fsk4Demod.h
Golay24.h
IirFilter.h
LinkSetupFrame.h
M17Demodulator.h
M17FrameDecoder.h
M17Framer.h
M17Modulator.h
M17Randomizer.h
M17Synchronizer.h
PhaseEstimator.h
PolynomialInterleaver.h
queue.h
SlidingDFT.h
SymbolEvm.h
Trellis.h
Util.h
Viterbi.h
)
include_directories(
${CMAKE_SOURCE_DIR}/exports
)
add_library(modemm17 SHARED
${modemm17_SOURCES}
)
target_link_libraries(modemm17
Qt5::Core
)
install(TARGETS modemm17 DESTINATION ${INSTALL_LIB_DIR})

View File

@ -18,7 +18,7 @@
namespace modemm17 {
struct M17_API Correlator
struct MODEMM17_API Correlator
{
static constexpr size_t SYMBOLS = 8;
static constexpr size_t SAMPLES_PER_SYMBOL = 10;

View File

@ -26,7 +26,7 @@ namespace modemm17 {
* Estimates are expected to be updated at each sync word. But they can
* be updated more frequently, such as during the preamble.
*/
class M17_API FreqDevEstimator
class MODEMM17_API FreqDevEstimator
{
using sample_filter_t = BaseIirFilter<3>;

View File

@ -81,7 +81,7 @@ constexpr array<T, N> sort(array<T, N> array)
} // Golay24_detail
struct M17_API Golay24
struct MODEMM17_API Golay24
{
#pragma pack(push, 1)
struct SyndromeMapEntry

View File

@ -22,7 +22,7 @@
namespace modemm17 {
struct M17_API M17Demodulator
struct MODEMM17_API M17Demodulator
{
static const uint16_t SAMPLE_RATE = 48000;
static const uint16_t SYMBOL_RATE = 4800;

View File

@ -14,7 +14,7 @@
namespace modemm17
{
inline constexpr std::array<int8_t, 61> make_p1() {
inline std::array<int8_t, 61> make_p1() {
std::array<int8_t, 61> result{};
for (size_t i = 0, j = 2; i != 61; ++i) {
if (i == j) {
@ -107,7 +107,7 @@ struct CostTable
using cost_table_t = std::array<std::array<uint8_t, InputValues>, K>;
template <typename Trellis_>
static constexpr cost_table_t makeCostTable(const Trellis_& trellis)
static constexpr cost_table_t makeCostTable()
{
cost_table_t result;
for (size_t i = 0; i != K; ++i)

View File

@ -146,7 +146,10 @@ auto llr(float sample)
template <size_t M, typename T, size_t N, typename U, size_t IN>
auto depunctured(std::array<T, N> puncture_matrix, std::array<U, IN> in)
{
static_assert(M % N == 0);
if (M % N != 0) {
return;
}
std::array<U, M> result;
size_t index = 0;
size_t pindex = 0;

View File

@ -1,56 +0,0 @@
project(modems)
set(modems_SOURCES
m17/Correlator.cpp
m17/FreqDevEstimator.cpp
m17/Golay24.cpp
m17/M17Demodulator.cpp
m17/M17Modulator.cpp
)
set(modems_HEADERS
m17/ax25_frame.h
m17/CarrierDetect.h
m17/ClockRecovery.h
m17/Convolution.h
m17/Correlator.h
m17/CRC16.h
m17/DataCarrierDetect.h
m17/DeviationError.h
m17/Filter.h
m17/FirFilter.h
m17/FreqDevEstimator.h
m17/FrequencyError.h
m17/Fsk4Demod.h
m17/Golay24.h
m17/IirFilter.h
m17/LinkSetupFrame.h
m17/M17Demodulator.h
m17/M17FrameDecoder.h
m17/M17Framer.h
m17/M17Modulator.h
m17/M17Randomizer.h
m17/M17Synchronizer.h
m17/PhaseEstimator.h
m17/PolynomialInterleaver.h
m17/queue.h
m17/SlidingDFT.h
m17/SymbolEvm.h
m17/Trellis.h
m17/Util.h
m17/Viterbi.h
)
include_directories(
${CMAKE_SOURCE_DIR}/exports
)
add_library(modems SHARED
${modems_SOURCES}
)
target_link_libraries(modems
Qt5::Core
)
install(TARGETS modems DESTINATION ${INSTALL_LIB_DIR})

View File

@ -97,7 +97,7 @@ if (ENABLE_CHANNELRX_DEMODFREEDV AND CODEC2_FOUND)
add_subdirectory(demodfreedv)
endif()
if (LINUX AND ENABLE_CHANNELRX_DEMODM17 AND CODEC2_FOUND)
if (ENABLE_CHANNELRX_DEMODM17 AND CODEC2_FOUND)
add_subdirectory(demodm17)
endif()

View File

@ -27,7 +27,7 @@ set(m17_HEADERS
include_directories(
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CODEC2_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/modems
${CMAKE_SOURCE_DIR}/modemm17
)
if(NOT SERVER_MODE)
@ -69,7 +69,7 @@ target_link_libraries(${TARGET_NAME}
${TARGET_LIB_GUI}
swagger
${CODEC2_LIBRARIES}
modems
modemm17
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -25,7 +25,7 @@
#include "audio/audiofifo.h"
#include "util/ax25.h"
#include "m17/ax25_frame.h"
#include "ax25_frame.h"
#include "m17demod.h"
#include "m17demodprocessor.h"

View File

@ -21,7 +21,7 @@
#include <QObject>
#include "audio/audiocompressor.h"
#include "m17/M17Demodulator.h"
#include "M17Demodulator.h"
#include "m17demodfilters.h"
class AudioFifo;

View File

@ -63,6 +63,6 @@ if (ENABLE_CHANNELTX_MODFREEDV AND CODEC2_FOUND)
add_subdirectory(modfreedv)
endif()
if (LINUX AND ENABLE_CHANNELTX_MODM17 AND CODEC2_FOUND)
if (ENABLE_CHANNELTX_MODM17 AND CODEC2_FOUND)
add_subdirectory(modm17)
endif()

View File

@ -29,7 +29,7 @@ set(modm17_HEADERS
include_directories(
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CODEC2_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/modems
${CMAKE_SOURCE_DIR}/modemm17
)
if(NOT SERVER_MODE)
@ -69,7 +69,7 @@ target_link_libraries(${TARGET_NAME}
${TARGET_LIB_GUI}
swagger
${CODEC2_LIBRARIES}
modems
modemm17
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -17,7 +17,7 @@
#include <codec2/codec2.h>
#include "m17/M17Modulator.h"
#include "M17Modulator.h"
#include "maincore.h"
#include "m17modax25.h"

View File

@ -21,7 +21,7 @@
#include <QObject>
#include <QByteArray>
#include "m17/M17Modulator.h"
#include "M17Modulator.h"
#include "dsp/dsptypes.h"
#include "util/message.h"
#include "util/messagequeue.h"