├── .clang-format ├── .dockerignore ├── .git-blame-ignore-revs ├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ └── main.yml ├── .gitignore ├── CHANGELOG.md ├── CMakeLists.txt ├── Dockerfile ├── LICENSE ├── README.md ├── clean.sh ├── cmake.h.in ├── cmake └── Modules │ ├── CMakeParseArgumentsCopy.cmake │ ├── FindGRPC.cmake │ ├── FindGnuradioOsmosdr.cmake │ ├── FindGnuradioUHD.cmake │ ├── FindLibHackRF.cmake │ ├── FindLibMiriSDR.cmake │ ├── FindLibRTLSDR.cmake │ ├── FindLibUHD.cmake │ ├── FindLibbladeRF.cmake │ └── FindProtobuf.cmake ├── docs ├── CONFIGURE.md ├── DEBUG.md ├── FAQ.md ├── Install │ ├── INSTALL-DOCKER.md │ ├── INSTALL-LINUX.md │ ├── INSTALL-MAC.md │ ├── INSTALL-PI.md │ └── _category_.json ├── OpenMHz.md ├── Playback.md ├── Plugins.md ├── SQUELCH.md ├── SigMF.MD ├── intro.md ├── media │ ├── add_system.png │ ├── config_system.png │ ├── create_group.png │ ├── discord.jpg │ ├── gqrx-file.png │ ├── gqrx.png │ ├── import_talkgroup.png │ ├── openmhz.png │ ├── register.png │ ├── screenshot.jpg │ ├── system_info.png │ ├── trunk-recorder-docs.png │ ├── trunk-recorder-header.png │ └── user_info.png └── notes │ ├── CALL-HANDLING.md │ ├── PLUGIN-SYSTEM.md │ ├── STATES.md │ └── STATUS-JSON.md ├── examples ├── SETUP_SERVICE.md ├── auto-restart-wmata.sh ├── auto-restart.sh ├── channel.csv ├── config-analog-conv.json ├── config-dmr.json ├── config-frs-single.json ├── config-frs.json ├── config-iq-file.json ├── config-multi-system.json ├── config-p25-hackrf.json ├── config-p25-rtl.json ├── config-p25-uhd.json ├── config-smartnet-hackrf.json ├── config-smartnet-rtl.json ├── decodechart.php ├── encode-upload.sh.sample ├── talkgroups.csv ├── trunk-recorder.service ├── upload_gcs.sh └── wmata.csv ├── git.cc.in ├── git.h ├── git_watcher.cmake ├── install.sh ├── lib ├── csv-parser │ └── csv.hpp ├── gr-latency-manager │ ├── include │ │ ├── CMakeLists.txt │ │ ├── api.h │ │ ├── latency_manager.h │ │ └── tag_to_msg.h │ └── lib │ │ ├── CMakeLists.txt │ │ ├── latency_manager_impl.cc │ │ ├── latency_manager_impl.h │ │ ├── tag_to_msg_impl.cc │ │ └── tag_to_msg_impl.h ├── gr-latency │ ├── latency_probe.cc │ ├── latency_probe.h │ ├── latency_tagger.cc │ └── latency_tagger.h ├── json.hpp ├── lfsr │ ├── Eigen │ │ ├── CMakeLists.txt │ │ ├── Cholesky │ │ ├── CholmodSupport │ │ ├── Core │ │ ├── Dense │ │ ├── Eigen │ │ ├── Eigenvalues │ │ ├── Geometry │ │ ├── Householder │ │ ├── IterativeLinearSolvers │ │ ├── Jacobi │ │ ├── KLUSupport │ │ ├── LU │ │ ├── MetisSupport │ │ ├── OrderingMethods │ │ ├── PaStiXSupport │ │ ├── PardisoSupport │ │ ├── QR │ │ ├── QtAlignedMalloc │ │ ├── SPQRSupport │ │ ├── SVD │ │ ├── Sparse │ │ ├── SparseCholesky │ │ ├── SparseCore │ │ ├── SparseLU │ │ ├── SparseQR │ │ ├── StdDeque │ │ ├── StdList │ │ ├── StdVector │ │ ├── SuperLUSupport │ │ ├── UmfPackSupport │ │ └── src │ │ │ ├── Cholesky │ │ │ ├── LDLT.h │ │ │ ├── LLT.h │ │ │ └── LLT_LAPACKE.h │ │ │ ├── CholmodSupport │ │ │ └── CholmodSupport.h │ │ │ ├── Core │ │ │ ├── ArithmeticSequence.h │ │ │ ├── Array.h │ │ │ ├── ArrayBase.h │ │ │ ├── ArrayWrapper.h │ │ │ ├── Assign.h │ │ │ ├── AssignEvaluator.h │ │ │ ├── Assign_MKL.h │ │ │ ├── BandMatrix.h │ │ │ ├── Block.h │ │ │ ├── BooleanRedux.h │ │ │ ├── CommaInitializer.h │ │ │ ├── ConditionEstimator.h │ │ │ ├── CoreEvaluators.h │ │ │ ├── CoreIterators.h │ │ │ ├── CwiseBinaryOp.h │ │ │ ├── CwiseNullaryOp.h │ │ │ ├── CwiseTernaryOp.h │ │ │ ├── CwiseUnaryOp.h │ │ │ ├── CwiseUnaryView.h │ │ │ ├── DenseBase.h │ │ │ ├── DenseCoeffsBase.h │ │ │ ├── DenseStorage.h │ │ │ ├── Diagonal.h │ │ │ ├── DiagonalMatrix.h │ │ │ ├── DiagonalProduct.h │ │ │ ├── Dot.h │ │ │ ├── EigenBase.h │ │ │ ├── ForceAlignedAccess.h │ │ │ ├── Fuzzy.h │ │ │ ├── GeneralProduct.h │ │ │ ├── GenericPacketMath.h │ │ │ ├── GlobalFunctions.h │ │ │ ├── IO.h │ │ │ ├── IndexedView.h │ │ │ ├── Inverse.h │ │ │ ├── Map.h │ │ │ ├── MapBase.h │ │ │ ├── MathFunctions.h │ │ │ ├── MathFunctionsImpl.h │ │ │ ├── Matrix.h │ │ │ ├── MatrixBase.h │ │ │ ├── NestByValue.h │ │ │ ├── NoAlias.h │ │ │ ├── NumTraits.h │ │ │ ├── PartialReduxEvaluator.h │ │ │ ├── PermutationMatrix.h │ │ │ ├── PlainObjectBase.h │ │ │ ├── Product.h │ │ │ ├── ProductEvaluators.h │ │ │ ├── Random.h │ │ │ ├── Redux.h │ │ │ ├── Ref.h │ │ │ ├── Replicate.h │ │ │ ├── Reshaped.h │ │ │ ├── ReturnByValue.h │ │ │ ├── Reverse.h │ │ │ ├── Select.h │ │ │ ├── SelfAdjointView.h │ │ │ ├── SelfCwiseBinaryOp.h │ │ │ ├── Solve.h │ │ │ ├── SolveTriangular.h │ │ │ ├── SolverBase.h │ │ │ ├── StableNorm.h │ │ │ ├── StlIterators.h │ │ │ ├── Stride.h │ │ │ ├── Swap.h │ │ │ ├── Transpose.h │ │ │ ├── Transpositions.h │ │ │ ├── TriangularMatrix.h │ │ │ ├── VectorBlock.h │ │ │ ├── VectorwiseOp.h │ │ │ ├── Visitor.h │ │ │ ├── arch │ │ │ │ ├── AVX │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── AVX512 │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── AltiVec │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── MatrixProduct.h │ │ │ │ │ ├── MatrixProductCommon.h │ │ │ │ │ ├── MatrixProductMMA.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── CUDA │ │ │ │ │ └── Complex.h │ │ │ │ ├── Default │ │ │ │ │ ├── BFloat16.h │ │ │ │ │ ├── ConjHelper.h │ │ │ │ │ ├── GenericPacketMathFunctions.h │ │ │ │ │ ├── GenericPacketMathFunctionsFwd.h │ │ │ │ │ ├── Half.h │ │ │ │ │ ├── Settings.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── GPU │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── HIP │ │ │ │ │ └── hcc │ │ │ │ │ │ └── math_constants.h │ │ │ │ ├── MSA │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── NEON │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SSE │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SVE │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SYCL │ │ │ │ │ ├── InteropHeaders.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ ├── SyclMemoryModel.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ └── ZVector │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ ├── functors │ │ │ │ ├── AssignmentFunctors.h │ │ │ │ ├── BinaryFunctors.h │ │ │ │ ├── NullaryFunctors.h │ │ │ │ ├── StlFunctors.h │ │ │ │ ├── TernaryFunctors.h │ │ │ │ └── UnaryFunctors.h │ │ │ ├── products │ │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ │ ├── GeneralMatrixMatrix.h │ │ │ │ ├── GeneralMatrixMatrixTriangular.h │ │ │ │ ├── GeneralMatrixMatrixTriangular_BLAS.h │ │ │ │ ├── GeneralMatrixMatrix_BLAS.h │ │ │ │ ├── GeneralMatrixVector.h │ │ │ │ ├── GeneralMatrixVector_BLAS.h │ │ │ │ ├── Parallelizer.h │ │ │ │ ├── SelfadjointMatrixMatrix.h │ │ │ │ ├── SelfadjointMatrixMatrix_BLAS.h │ │ │ │ ├── SelfadjointMatrixVector.h │ │ │ │ ├── SelfadjointMatrixVector_BLAS.h │ │ │ │ ├── SelfadjointProduct.h │ │ │ │ ├── SelfadjointRank2Update.h │ │ │ │ ├── TriangularMatrixMatrix.h │ │ │ │ ├── TriangularMatrixMatrix_BLAS.h │ │ │ │ ├── TriangularMatrixVector.h │ │ │ │ ├── TriangularMatrixVector_BLAS.h │ │ │ │ ├── TriangularSolverMatrix.h │ │ │ │ ├── TriangularSolverMatrix_BLAS.h │ │ │ │ └── TriangularSolverVector.h │ │ │ └── util │ │ │ │ ├── BlasUtil.h │ │ │ │ ├── ConfigureVectorization.h │ │ │ │ ├── Constants.h │ │ │ │ ├── DisableStupidWarnings.h │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ ├── IndexedViewHelper.h │ │ │ │ ├── IntegralConstant.h │ │ │ │ ├── MKL_support.h │ │ │ │ ├── Macros.h │ │ │ │ ├── Memory.h │ │ │ │ ├── Meta.h │ │ │ │ ├── NonMPL2.h │ │ │ │ ├── ReenableStupidWarnings.h │ │ │ │ ├── ReshapedHelper.h │ │ │ │ ├── StaticAssert.h │ │ │ │ ├── SymbolicIndex.h │ │ │ │ └── XprHelper.h │ │ │ ├── Eigenvalues │ │ │ ├── ComplexEigenSolver.h │ │ │ ├── ComplexSchur.h │ │ │ ├── ComplexSchur_LAPACKE.h │ │ │ ├── EigenSolver.h │ │ │ ├── GeneralizedEigenSolver.h │ │ │ ├── GeneralizedSelfAdjointEigenSolver.h │ │ │ ├── HessenbergDecomposition.h │ │ │ ├── MatrixBaseEigenvalues.h │ │ │ ├── RealQZ.h │ │ │ ├── RealSchur.h │ │ │ ├── RealSchur_LAPACKE.h │ │ │ ├── SelfAdjointEigenSolver.h │ │ │ ├── SelfAdjointEigenSolver_LAPACKE.h │ │ │ └── Tridiagonalization.h │ │ │ ├── Geometry │ │ │ ├── AlignedBox.h │ │ │ ├── AngleAxis.h │ │ │ ├── EulerAngles.h │ │ │ ├── Homogeneous.h │ │ │ ├── Hyperplane.h │ │ │ ├── OrthoMethods.h │ │ │ ├── ParametrizedLine.h │ │ │ ├── Quaternion.h │ │ │ ├── Rotation2D.h │ │ │ ├── RotationBase.h │ │ │ ├── Scaling.h │ │ │ ├── Transform.h │ │ │ ├── Translation.h │ │ │ ├── Umeyama.h │ │ │ └── arch │ │ │ │ └── Geometry_SIMD.h │ │ │ ├── Householder │ │ │ ├── BlockHouseholder.h │ │ │ ├── Householder.h │ │ │ └── HouseholderSequence.h │ │ │ ├── IterativeLinearSolvers │ │ │ ├── BasicPreconditioners.h │ │ │ ├── BiCGSTAB.h │ │ │ ├── ConjugateGradient.h │ │ │ ├── IncompleteCholesky.h │ │ │ ├── IncompleteLUT.h │ │ │ ├── IterativeSolverBase.h │ │ │ ├── LeastSquareConjugateGradient.h │ │ │ └── SolveWithGuess.h │ │ │ ├── Jacobi │ │ │ └── Jacobi.h │ │ │ ├── KLUSupport │ │ │ └── KLUSupport.h │ │ │ ├── LU │ │ │ ├── Determinant.h │ │ │ ├── FullPivLU.h │ │ │ ├── InverseImpl.h │ │ │ ├── PartialPivLU.h │ │ │ ├── PartialPivLU_LAPACKE.h │ │ │ └── arch │ │ │ │ └── InverseSize4.h │ │ │ ├── MetisSupport │ │ │ └── MetisSupport.h │ │ │ ├── OrderingMethods │ │ │ ├── Amd.h │ │ │ ├── Eigen_Colamd.h │ │ │ └── Ordering.h │ │ │ ├── PaStiXSupport │ │ │ └── PaStiXSupport.h │ │ │ ├── PardisoSupport │ │ │ └── PardisoSupport.h │ │ │ ├── QR │ │ │ ├── ColPivHouseholderQR.h │ │ │ ├── ColPivHouseholderQR_LAPACKE.h │ │ │ ├── CompleteOrthogonalDecomposition.h │ │ │ ├── FullPivHouseholderQR.h │ │ │ ├── HouseholderQR.h │ │ │ └── HouseholderQR_LAPACKE.h │ │ │ ├── SPQRSupport │ │ │ └── SuiteSparseQRSupport.h │ │ │ ├── SVD │ │ │ ├── BDCSVD.h │ │ │ ├── JacobiSVD.h │ │ │ ├── JacobiSVD_LAPACKE.h │ │ │ ├── SVDBase.h │ │ │ └── UpperBidiagonalization.h │ │ │ ├── SparseCholesky │ │ │ ├── SimplicialCholesky.h │ │ │ └── SimplicialCholesky_impl.h │ │ │ ├── SparseCore │ │ │ ├── AmbiVector.h │ │ │ ├── CompressedStorage.h │ │ │ ├── ConservativeSparseSparseProduct.h │ │ │ ├── MappedSparseMatrix.h │ │ │ ├── SparseAssign.h │ │ │ ├── SparseBlock.h │ │ │ ├── SparseColEtree.h │ │ │ ├── SparseCompressedBase.h │ │ │ ├── SparseCwiseBinaryOp.h │ │ │ ├── SparseCwiseUnaryOp.h │ │ │ ├── SparseDenseProduct.h │ │ │ ├── SparseDiagonalProduct.h │ │ │ ├── SparseDot.h │ │ │ ├── SparseFuzzy.h │ │ │ ├── SparseMap.h │ │ │ ├── SparseMatrix.h │ │ │ ├── SparseMatrixBase.h │ │ │ ├── SparsePermutation.h │ │ │ ├── SparseProduct.h │ │ │ ├── SparseRedux.h │ │ │ ├── SparseRef.h │ │ │ ├── SparseSelfAdjointView.h │ │ │ ├── SparseSolverBase.h │ │ │ ├── SparseSparseProductWithPruning.h │ │ │ ├── SparseTranspose.h │ │ │ ├── SparseTriangularView.h │ │ │ ├── SparseUtil.h │ │ │ ├── SparseVector.h │ │ │ ├── SparseView.h │ │ │ └── TriangularSolver.h │ │ │ ├── SparseLU │ │ │ ├── SparseLU.h │ │ │ ├── SparseLUImpl.h │ │ │ ├── SparseLU_Memory.h │ │ │ ├── SparseLU_Structs.h │ │ │ ├── SparseLU_SupernodalMatrix.h │ │ │ ├── SparseLU_Utils.h │ │ │ ├── SparseLU_column_bmod.h │ │ │ ├── SparseLU_column_dfs.h │ │ │ ├── SparseLU_copy_to_ucol.h │ │ │ ├── SparseLU_gemm_kernel.h │ │ │ ├── SparseLU_heap_relax_snode.h │ │ │ ├── SparseLU_kernel_bmod.h │ │ │ ├── SparseLU_panel_bmod.h │ │ │ ├── SparseLU_panel_dfs.h │ │ │ ├── SparseLU_pivotL.h │ │ │ ├── SparseLU_pruneL.h │ │ │ └── SparseLU_relax_snode.h │ │ │ ├── SparseQR │ │ │ └── SparseQR.h │ │ │ ├── StlSupport │ │ │ ├── StdDeque.h │ │ │ ├── StdList.h │ │ │ ├── StdVector.h │ │ │ └── details.h │ │ │ ├── SuperLUSupport │ │ │ └── SuperLUSupport.h │ │ │ ├── UmfPackSupport │ │ │ └── UmfPackSupport.h │ │ │ ├── misc │ │ │ ├── Image.h │ │ │ ├── Kernel.h │ │ │ ├── RealSvd2x2.h │ │ │ ├── blas.h │ │ │ ├── lapack.h │ │ │ ├── lapacke.h │ │ │ └── lapacke_mangling.h │ │ │ └── plugins │ │ │ ├── ArrayCwiseBinaryOps.h │ │ │ ├── ArrayCwiseUnaryOps.h │ │ │ ├── BlockMethods.h │ │ │ ├── CommonCwiseBinaryOps.h │ │ │ ├── CommonCwiseUnaryOps.h │ │ │ ├── IndexedViewMethods.h │ │ │ ├── MatrixCwiseBinaryOps.h │ │ │ ├── MatrixCwiseUnaryOps.h │ │ │ └── ReshapedMethods.h │ ├── bit_utils.h │ ├── lfsr.cxx │ └── lfsr.h └── op25_repeater │ ├── CMakeLists.txt │ ├── CTestTestfile.cmake │ ├── include │ └── op25_repeater │ │ ├── CMakeLists.txt │ │ ├── CTestTestfile.cmake │ │ ├── ambe_encoder_sb.h │ │ ├── analog_udp.h │ │ ├── api.h │ │ ├── costas_loop_cc.h │ │ ├── dmr_bs_tx_bb.h │ │ ├── dstar_tx_sb.h │ │ ├── frame_assembler.h │ │ ├── fsk4_demod_ff.h │ │ ├── fsk4_slicer_fb.h │ │ ├── gardner_cc.h │ │ ├── iqfile_source.h │ │ ├── p25_frame_assembler.h │ │ ├── p25_frame_audio.h │ │ ├── rmsagc_ff.h │ │ ├── rx_status.h │ │ ├── vocoder.h │ │ └── ysf_tx_sb.h │ └── lib │ ├── BER.cc │ ├── CCITTChecksumReverse.cpp │ ├── CCITTChecksumReverse.h │ ├── CMakeLists.txt │ ├── CTestTestfile.cmake │ ├── ambe.c │ ├── ambe.h │ ├── ambe3600x2250_const.h │ ├── ambe3600x2400_const.h │ ├── ambe_encoder.cc │ ├── ambe_encoder.h │ ├── ambe_encoder_sb_impl.cc │ ├── ambe_encoder_sb_impl.h │ ├── analog_udp_impl.cc │ ├── analog_udp_impl.h │ ├── bch.cc │ ├── bch.h │ ├── ber1011.cc │ ├── bit_utils.h │ ├── bptc19696.cc │ ├── bptc19696.h │ ├── check_frame_sync.h │ ├── costas_loop_cc_impl.cc │ ├── costas_loop_cc_impl.h │ ├── crc16.h │ ├── d2460.cc │ ├── dmr_bs_tx_bb_impl.cc │ ├── dmr_bs_tx_bb_impl.h │ ├── dmr_cai.cc │ ├── dmr_cai.h │ ├── dmr_const.h │ ├── dmr_slot.cc │ ├── dmr_slot.h │ ├── dstar_header.h │ ├── dstar_tx_sb_impl.cc │ ├── dstar_tx_sb_impl.h │ ├── ezpwd │ ├── asserter │ ├── bch │ ├── bch_base │ ├── corrector │ ├── definitions │ ├── ezcod │ ├── output │ ├── rs │ ├── rs_base │ ├── serialize │ ├── serialize_definitions │ └── timeofday │ ├── frame_assembler_impl.cc │ ├── frame_assembler_impl.h │ ├── frame_sync_magics.h │ ├── fsk4_demod_ff_impl.cc │ ├── fsk4_demod_ff_impl.h │ ├── fsk4_slicer_fb_impl.cc │ ├── fsk4_slicer_fb_impl.h │ ├── gardner_cc_impl.cc │ ├── gardner_cc_impl.h │ ├── golay2087.cc │ ├── golay2087.h │ ├── hamming.cc │ ├── hamming.h │ ├── imbe_decoder.cc │ ├── imbe_decoder.h │ ├── imbe_vocoder │ ├── CMakeLists.txt │ ├── CTestTestfile.cmake │ ├── aux_sub.cc │ ├── aux_sub.h │ ├── basic_op.h │ ├── basicop2.cc │ ├── ch_decode.cc │ ├── ch_decode.h │ ├── ch_encode.cc │ ├── ch_encode.h │ ├── dc_rmv.cc │ ├── dc_rmv.h │ ├── decode.cc │ ├── decode.h │ ├── dsp_sub.cc │ ├── dsp_sub.h │ ├── encode.cc │ ├── encode.h │ ├── globals.h │ ├── imbe.h │ ├── imbe_vocoder.cc │ ├── imbe_vocoder.h │ ├── math_sub.cc │ ├── math_sub.h │ ├── pe_lpf.cc │ ├── pe_lpf.h │ ├── pitch_est.cc │ ├── pitch_est.h │ ├── pitch_ref.cc │ ├── pitch_ref.h │ ├── qnt_sub.cc │ ├── qnt_sub.h │ ├── rand_gen.cc │ ├── rand_gen.h │ ├── sa_decode.cc │ ├── sa_decode.h │ ├── sa_encode.cc │ ├── sa_encode.h │ ├── sa_enh.cc │ ├── sa_enh.h │ ├── tbls.cc │ ├── tbls.h │ ├── typedef.h │ ├── typedefs.h │ ├── uv_synt.cc │ ├── uv_synt.h │ ├── v_synt.cc │ ├── v_synt.h │ ├── v_uv_det.cc │ └── v_uv_det.h │ ├── iqfile_source_impl.cc │ ├── iqfile_source_impl.h │ ├── log_ts.h │ ├── mbelib.c │ ├── mbelib.h │ ├── mbelib_const.h │ ├── op25_audio.cc │ ├── op25_audio.h │ ├── op25_golay.h │ ├── op25_hamming.h │ ├── op25_imbe_frame.h │ ├── op25_msg_types.h │ ├── op25_p25_frame.h │ ├── op25_timer.cc │ ├── op25_timer.h │ ├── op25_yank.h │ ├── p25_crypt_algs.cc │ ├── p25_crypt_algs.h │ ├── p25_dibit.h │ ├── p25_frame.h │ ├── p25_frame_assembler_impl.cc │ ├── p25_frame_assembler_impl.h │ ├── p25_framer.cc │ ├── p25_framer.h │ ├── p25p1_fdma.cc │ ├── p25p1_fdma.h │ ├── p25p1_voice_decode.cc │ ├── p25p1_voice_decode.h │ ├── p25p1_voice_encode.cc │ ├── p25p1_voice_encode.h │ ├── p25p2_duid.cc │ ├── p25p2_duid.h │ ├── p25p2_framer.cc │ ├── p25p2_framer.h │ ├── p25p2_isch.cc │ ├── p25p2_isch.h │ ├── p25p2_sync.cc │ ├── p25p2_sync.h │ ├── p25p2_tdma.cc │ ├── p25p2_tdma.h │ ├── p25p2_vf.cc │ ├── p25p2_vf.h │ ├── qa_op25_repeater.cc │ ├── qa_op25_repeater.h │ ├── rmsagc_ff_impl.cc │ ├── rmsagc_ff_impl.h │ ├── rs.cc │ ├── rs.h │ ├── rx_base.h │ ├── rx_smartnet.cc │ ├── rx_smartnet.h │ ├── rx_subchannel.cc │ ├── rx_subchannel.h │ ├── rx_sync.cc │ ├── rx_sync.h │ ├── scan4sync.cc │ ├── software_imbe_decoder.cc │ ├── software_imbe_decoder.h │ ├── test_op25_repeater.cc │ ├── test_op25_repeater_test.sh │ ├── trellis.cc │ ├── trellis.h │ ├── vocoder_impl.cc │ ├── vocoder_impl.h │ ├── ysf_const.h │ ├── ysf_tx_sb_impl.cc │ └── ysf_tx_sb_impl.h ├── plugins ├── broadcastify_uploader │ ├── CMakeLists.txt │ └── broadcastify_uploader.cc ├── openmhz_uploader │ ├── CMakeLists.txt │ └── openmhz_uploader.cc ├── rdioscanner_uploader │ ├── CMakeLists.txt │ └── rdioscanner_uploader.cc ├── simplestream │ ├── CMakeLists.txt │ ├── example_audio_player.py │ └── simplestream.cc ├── stat_socket │ ├── CMakeLists.txt │ └── stat_socket.cc ├── streamer │ ├── StreamerClient.cc │ ├── StreamerClient.h │ ├── generate_protos.sh │ ├── streamer.grpc.pb.cc │ ├── streamer.grpc.pb.h │ ├── streamer.pb.cc │ ├── streamer.pb.h │ ├── streamer.proto │ ├── streamer_client_impl.cc │ ├── streamer_client_impl.h │ ├── streamer_proto_helper.cc │ └── streamer_proto_helper.h └── unit_script │ ├── CMakeLists.txt │ ├── example-unit-script.sh │ ├── unit-script.md │ └── unit_script.cc ├── tests └── mqtt │ ├── README.md │ └── config.json ├── trunk-recorder ├── call.h ├── call_concluder │ ├── call_concluder.cc │ └── call_concluder.h ├── call_conventional.cc ├── call_conventional.h ├── call_impl.cc ├── call_impl.h ├── config.cc ├── config.h ├── csv_helper.cc ├── csv_helper.h ├── formatter.cc ├── formatter.h ├── git.h ├── global_structs.h ├── gr_blocks │ ├── channelizer.cc │ ├── channelizer.h │ ├── decoder_wrapper.h │ ├── decoder_wrapper_impl.cc │ ├── decoder_wrapper_impl.h │ ├── decoders │ │ ├── fsync_decode.cc │ │ ├── fsync_decode.h │ │ ├── fsync_types.h │ │ ├── mdc_decode.cc │ │ ├── mdc_decode.h │ │ ├── mdc_types.h │ │ ├── signal_decoder_sink.h │ │ ├── signal_decoder_sink_impl.cc │ │ ├── signal_decoder_sink_impl.h │ │ ├── star_common.h │ │ ├── star_decode.cc │ │ ├── star_decode.h │ │ ├── star_types.h │ │ ├── tps_decoder_sink.h │ │ ├── tps_decoder_sink_impl.cc │ │ └── tps_decoder_sink_impl.h │ ├── freq_xlating_fft_filter.cc │ ├── freq_xlating_fft_filter.h │ ├── plugin_wrapper.h │ ├── plugin_wrapper_impl.cc │ ├── plugin_wrapper_impl.h │ ├── pwr_squelch_cc.h │ ├── pwr_squelch_cc_impl.cc │ ├── pwr_squelch_cc_impl.h │ ├── rms_agc.cc │ ├── rms_agc.h │ ├── selector.h │ ├── selector_impl.cc │ ├── selector_impl.h │ ├── signal_detector_cvf.h │ ├── signal_detector_cvf_impl.cc │ ├── signal_detector_cvf_impl.h │ ├── squelch_base_cc.h │ ├── squelch_base_cc_impl.cc │ ├── squelch_base_cc_impl.h │ ├── transmission_sink.cc │ ├── transmission_sink.h │ ├── wavfile.cc │ ├── wavfile_gr3.8.cc │ ├── wavfile_gr3.8.h │ ├── xlat_channelizer.cc │ └── xlat_channelizer.h ├── main.cc ├── monitor_systems.cc ├── monitor_systems.h ├── plugin_manager │ ├── plugin_api.h │ ├── plugin_manager.cc │ └── plugin_manager.h ├── recorder_globals.h ├── recorders │ ├── analog_recorder.cc │ ├── analog_recorder.h │ ├── debug_recorder.h │ ├── debug_recorder_impl.cc │ ├── debug_recorder_impl.h │ ├── dmr_recorder.h │ ├── dmr_recorder_impl.cc │ ├── dmr_recorder_impl.h │ ├── p25_recorder.h │ ├── p25_recorder_decode.cc │ ├── p25_recorder_decode.h │ ├── p25_recorder_fsk4_demod.cc │ ├── p25_recorder_fsk4_demod.h │ ├── p25_recorder_impl.cc │ ├── p25_recorder_impl.h │ ├── p25_recorder_qpsk_demod.cc │ ├── p25_recorder_qpsk_demod.h │ ├── recorder.cc │ ├── recorder.h │ ├── sigmf_recorder.h │ ├── sigmf_recorder_impl.cc │ └── sigmf_recorder_impl.h ├── setup_systems.cc ├── setup_systems.h ├── source.cc ├── source.h ├── sources │ ├── iq_file_source.cc │ └── iq_file_source.h ├── state.h ├── systems │ ├── p25_parser.cc │ ├── p25_parser.h │ ├── p25_trunking.cc │ ├── p25_trunking.h │ ├── parser.h │ ├── smartnet_crc.cc │ ├── smartnet_crc.h │ ├── smartnet_decode.cc │ ├── smartnet_decode.h │ ├── smartnet_parser.cc │ ├── smartnet_parser.h │ ├── smartnet_trunking.cc │ ├── smartnet_trunking.h │ ├── smartnet_types.h │ ├── system.h │ ├── system_impl.cc │ └── system_impl.h ├── talkgroup.cc ├── talkgroup.h ├── talkgroups.cc ├── talkgroups.h ├── unit_tag.cc ├── unit_tag.h ├── unit_tags.cc └── unit_tags.h ├── user_plugins └── README.txt └── utils ├── Dockerfile.arch-latest-aur.dev ├── Dockerfile.arch-latest.dev ├── Dockerfile.debian-buster-10.dev ├── Dockerfile.fedora-35.dev ├── Dockerfile.ubuntu-20.04.dev ├── Dockerfile.ubuntu-21.04.dev ├── Dockerfile.ubuntu-22.04.dev ├── Dockerfile.ubuntu-23.04.dev ├── README.md ├── audioplayer.php ├── debug.grc ├── rtlsdr-to-iq.c └── udp-debug.grc /.clang-format: -------------------------------------------------------------------------------- 1 | ColumnLimit: 0 2 | BreakStringLiterals: false -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | /*.json 2 | /*.csv 3 | sys_*/ 4 | audio/ 5 | junk/ 6 | tester/ 7 | fake/ 8 | 2015/ 9 | 2016/ 10 | wmata/ 11 | CMakeFiles/ 12 | build/ 13 | debug/ 14 | CMakeCache.txt 15 | Makefile 16 | cmake_install.cmake 17 | install_manifest.txt 18 | recorder 19 | config.json 20 | ChanList.csv 21 | *.so 22 | *.a 23 | *.log 24 | *.dylib 25 | .DS_Store 26 | .idea/ 27 | cmake-build-debug/ 28 | *.code-workspace 29 | /.vscode/ 30 | /.vs/ 31 | /out/ 32 | top_block.py 33 | debug_recorder.py 34 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Update Eigen to version 3.4 2 | 68291f6f901eef5cbfa21bc2a57483044123de43 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Makes sure all C & C++ files are classified as such. 2 | lib/op25_repeater/lib/*.h linguist-language=C++ 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [robotastic] 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /*.json 2 | /*.csv 3 | sys_*/ 4 | audio/ 5 | junk/ 6 | tester/ 7 | fake/ 8 | 2[0-9][0-9][0-9]/ 9 | wmata/ 10 | CMakeFiles/ 11 | build/ 12 | debug/ 13 | CMakeCache.txt 14 | Makefile 15 | cmake_install.cmake 16 | install_manifest.txt 17 | recorder 18 | ChanList.csv 19 | *.so 20 | *.a 21 | *.log 22 | *.dylib 23 | .DS_Store 24 | .idea/ 25 | cmake-build-debug/ 26 | *.code-workspace 27 | /.vscode/ 28 | /.vs/ 29 | /out/ 30 | top_block.py 31 | debug_recorder.py 32 | /cmake_build/ 33 | /.cache/ 34 | .gitmodules 35 | user_plugins/*/ 36 | -------------------------------------------------------------------------------- /clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -R ./CMakeFiles 3 | rm ./cmake_install.cmake 4 | rm ./CMakeCache.txt 5 | if [ "$1" == "cleanlib" ]; then 6 | rm -R ./lib/op25_repeater/CMakeFiles 7 | rm ./lib/op25_repeater/cmake_install.cmake 8 | rm -R ./lib/op25_repeater/include/op25_repeater/CMakeFiles 9 | rm ./lib/op25_repeater/include/op25_repeater/cmake_install.cmake 10 | rm -R ./lib/op25_repeater/lib/CMakeFiles 11 | rm ./lib/op25_repeater/lib/cmake_install.cmake 12 | rm -R ./lib/op25_repeater/lib/imbe_vocoder/CMakeFiles 13 | rm ./lib/op25_repeater/lib/imbe_vocoder/cmake_install.cmake 14 | fi -------------------------------------------------------------------------------- /cmake.h.in: -------------------------------------------------------------------------------- 1 | // 2 | // DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED!!!! 3 | // edit cmake.h.in instead 4 | // 5 | 6 | #ifndef INCLUDE_GUARD 7 | #define INCLUDE_GUARD 8 | 9 | #define PROJECT_NAME "@PROJECT_NAME@" 10 | #define PROJECT_VER "@PROJECT_VERSION@" 11 | #define PROJECT_VER_MAJOR "@PROJECT_VERSION_MAJOR@" 12 | #define PROJECT_VER_MINOR "@PROJECT_VERSION_MINOR@" 13 | #define PTOJECT_VER_PATCH "@PROJECT_VERSION_PATCH@" 14 | 15 | #endif // INCLUDE_GUARD 16 | -------------------------------------------------------------------------------- /cmake/Modules/FindGnuradioOsmosdr.cmake: -------------------------------------------------------------------------------- 1 | PKG_CHECK_MODULES(PC_GNURADIO_OSMOSDR gnuradio-osmosdr) 2 | 3 | FIND_PATH( 4 | GNURADIO_OSMOSDR_INCLUDE_DIRS 5 | NAMES osmosdr/source.h 6 | HINTS $ENV{GNURADIO_OSMOSDR_DIR}/include 7 | ${GNURADIO_OSMOSDR_INCLUDEDIR} 8 | ${GNURADIO_OSMOSDR_INCLUDE_DIRS} 9 | ${CMAKE_INSTALL_PREFIX}/include 10 | PATHS /usr/local/include 11 | /usr/include 12 | /opt/local/include 13 | ) 14 | 15 | FIND_LIBRARY( 16 | GNURADIO_OSMOSDR_LIBRARIES 17 | NAMES gnuradio-osmosdr 18 | HINTS $ENV{GNURADIO_OSMOSDR_DIR}/lib 19 | ${GNURADIO_OSMOSDR_LIBRARY_DIRS} 20 | ${GNURADIO_OSMOSDR_LIBDIR} 21 | ${CMAKE_INSTALL_PREFIX}/lib 22 | ${CMAKE_INSTALL_PREFIX}/lib64 23 | PATHS /usr/local/lib 24 | /usr/local/lib64 25 | /usr/lib 26 | /usr/lib64 27 | /opt/local/lib 28 | ) 29 | 30 | 31 | if(GNURADIO_OSMOSDR_INCLUDE_DIRS AND GNURADIO_OSMOSDR_LIBRARIES) 32 | set(GNURADIO_OSMOSDR_FOUND TRUE CACHE INTERNAL "gnuradio-osmosdr found") 33 | message(STATUS "Found gnuradio-osmosdr: ${GNURADIO_OSMOSDR_INCLUDE_DIRS}, ${GNURADIO_OSMOSDR_LIBRARIES}") 34 | else(GNURADIO_OSMOSDR_INCLUDE_DIRS AND GNURADIO_OSMOSDR_LIBRARIES) 35 | set(GNURADIO_OSMOSDR_FOUND FALSE CACHE INTERNAL "gnuradio-osmosdr found") 36 | message(STATUS "gnuradio-osmosdr not found.") 37 | message(STATUS "Found gnuradio-osmosdr: ${GNURADIO_OSMOSDR_INCLUDE_DIRS}, ${GNURADIO_OSMOSDR_LIBRARIES}") 38 | endif(GNURADIO_OSMOSDR_INCLUDE_DIRS AND GNURADIO_OSMOSDR_LIBRARIES) 39 | 40 | 41 | INCLUDE(FindPackageHandleStandardArgs) 42 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuradioOsmosdr DEFAULT_MSG GNURADIO_OSMOSDR_LIBRARIES GNURADIO_OSMOSDR_INCLUDE_DIRS) 43 | MARK_AS_ADVANCED(GNURADIO_OSMOSDR_LIBRARIES GNURADIO_OSMOSDR_INCLUDE_DIRS) -------------------------------------------------------------------------------- /cmake/Modules/FindGnuradioUHD.cmake: -------------------------------------------------------------------------------- 1 | PKG_CHECK_MODULES(PC_GNURADIO_UHD gnuradio-uhd) 2 | 3 | FIND_PATH( 4 | GNURADIO_UHD_INCLUDE_DIRS 5 | NAMES gnuradio/uhd/api.h 6 | HINTS $ENV{GNURADIO_UHD_DIR}/include 7 | ${PC_GNURADIO_UHD_INCLUDEDIR} 8 | PATHS /usr/local/include 9 | /usr/include 10 | ) 11 | 12 | FIND_LIBRARY( 13 | GNURADIO_UHD_LIBRARIES 14 | NAMES gnuradio-uhd 15 | HINTS $ENV{GNURADIO_UHD_DIR}/lib 16 | ${PC_GNURADIO_UHD_LIBDIR} 17 | PATHS /usr/local/lib 18 | /usr/local/lib64 19 | /usr/lib 20 | /usr/lib64 21 | ) 22 | 23 | if(GNURADIO_UHD_INCLUDE_DIRS AND GNURADIO_UHD_LIBRARIES) 24 | set(GNURADIO_UHD_FOUND TRUE CACHE INTERNAL "gnuradio-uhd found") 25 | message(STATUS "Found gnuradio-uhd: ${GNURADIO_UHD_INCLUDE_DIRS}, ${GNURADIO_UHD_LIBRARIES}") 26 | else(GNURADIO_UHD_INCLUDE_DIRS AND GNURADIO_UHD_LIBRARIES) 27 | set(GNURADIO_UHD_FOUND FALSE CACHE INTERNAL "gnuradio-uhd found") 28 | message(STATUS "gnuradio-uhd not found.") 29 | endif(GNURADIO_UHD_INCLUDE_DIRS AND GNURADIO_UHD_LIBRARIES) 30 | 31 | INCLUDE(FindPackageHandleStandardArgs) 32 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuradioUHD DEFAULT_MSG GNURADIO_UHD_LIBRARIES GNURADIO_UHD_INCLUDE_DIRS) 33 | MARK_AS_ADVANCED(GNURADIO_UHD_LIBRARIES GNURADIO_UHD_INCLUDE_DIRS) 34 | -------------------------------------------------------------------------------- /cmake/Modules/FindLibHackRF.cmake: -------------------------------------------------------------------------------- 1 | PKG_CHECK_MODULES(PC_LIBHACKRF libhackrf) 2 | 3 | FIND_PATH( 4 | LIBHACKRF_INCLUDE_DIRS 5 | NAMES libhackrf/hackrf.h 6 | HINTS $ENV{LIBHACKRF_DIR}/include 7 | ${PC_LIBHACKRF_INCLUDEDIR} 8 | PATHS /usr/local/include 9 | /usr/include 10 | ) 11 | 12 | FIND_LIBRARY( 13 | LIBHACKRF_LIBRARIES 14 | NAMES hackrf 15 | HINTS $ENV{LIBHACKRF_DIR}/lib 16 | ${PC_LIBHACKRF_LIBDIR} 17 | PATHS /usr/local/lib 18 | /usr/lib 19 | ) 20 | 21 | 22 | INCLUDE(FindPackageHandleStandardArgs) 23 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibHackRF DEFAULT_MSG LIBHACKRF_LIBRARIES LIBHACKRF_INCLUDE_DIRS) 24 | MARK_AS_ADVANCED(LIBHACKRF_LIBRARIES LIBHACKRF_INCLUDE_DIRS) 25 | -------------------------------------------------------------------------------- /cmake/Modules/FindLibMiriSDR.cmake: -------------------------------------------------------------------------------- 1 | if(NOT LIBMIRISDR_FOUND) 2 | pkg_check_modules (LIBMIRISDR_PKG libmirisdr) 3 | find_path(LIBMIRISDR_INCLUDE_DIR NAMES mirisdr.h 4 | PATHS 5 | ${LIBMIRISDR_PKG_INCLUDE_DIRS} 6 | /usr/include 7 | /usr/local/include 8 | ) 9 | 10 | find_library(LIBMIRISDR_LIBRARIES NAMES mirisdr 11 | PATHS 12 | ${LIBMIRISDR_PKG_LIBRARY_DIRS} 13 | /usr/lib 14 | /usr/local/lib 15 | ) 16 | 17 | if(LIBMIRISDR_INCLUDE_DIR AND LIBMIRISDR_LIBRARIES) 18 | set(LIBMIRISDR_FOUND TRUE CACHE INTERNAL "libmirisdr found") 19 | message(STATUS "Found libmirisdr: ${LIBMIRISDR_INCLUDE_DIR}, ${LIBMIRISDR_LIBRARIES}") 20 | else(LIBMIRISDR_INCLUDE_DIR AND LIBMIRISDR_LIBRARIES) 21 | set(LIBMIRISDR_FOUND FALSE CACHE INTERNAL "libmirisdr found") 22 | message(STATUS "libmirisdr not found.") 23 | endif(LIBMIRISDR_INCLUDE_DIR AND LIBMIRISDR_LIBRARIES) 24 | 25 | mark_as_advanced(LIBMIRISDR_INCLUDE_DIR LIBMIRISDR_LIBRARIES) 26 | 27 | endif(NOT LIBMIRISDR_FOUND) 28 | -------------------------------------------------------------------------------- /cmake/Modules/FindLibRTLSDR.cmake: -------------------------------------------------------------------------------- 1 | if(NOT LIBRTLSDR_FOUND) 2 | pkg_check_modules (LIBRTLSDR_PKG librtlsdr) 3 | find_path(LIBRTLSDR_INCLUDE_DIR NAMES rtl-sdr.h 4 | PATHS 5 | ${LIBRTLSDR_PKG_INCLUDE_DIRS} 6 | /usr/include 7 | /usr/local/include 8 | ) 9 | 10 | find_library(LIBRTLSDR_LIBRARIES NAMES rtlsdr 11 | PATHS 12 | ${LIBRTLSDR_PKG_LIBRARY_DIRS} 13 | /usr/lib 14 | /usr/local/lib 15 | ) 16 | 17 | if(LIBRTLSDR_INCLUDE_DIR AND LIBRTLSDR_LIBRARIES) 18 | set(LIBRTLSDR_FOUND TRUE CACHE INTERNAL "librtlsdr found") 19 | message(STATUS "Found librtlsdr: ${LIBRTLSDR_INCLUDE_DIR}, ${LIBRTLSDR_LIBRARIES}") 20 | else(LIBRTLSDR_INCLUDE_DIR AND LIBRTLSDR_LIBRARIES) 21 | set(LIBRTLSDR_FOUND FALSE CACHE INTERNAL "librtlsdr found") 22 | message(STATUS "librtlsdr not found.") 23 | endif(LIBRTLSDR_INCLUDE_DIR AND LIBRTLSDR_LIBRARIES) 24 | 25 | mark_as_advanced(LIBRTLSDR_INCLUDE_DIR LIBRTLSDR_LIBRARIES) 26 | 27 | endif(NOT LIBRTLSDR_FOUND) 28 | -------------------------------------------------------------------------------- /cmake/Modules/FindLibUHD.cmake: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # Find the library for the USRP Hardware Driver 3 | ######################################################################## 4 | PKG_CHECK_MODULES(PC_UHD uhd) 5 | 6 | FIND_PATH( 7 | UHD_INCLUDE_DIRS 8 | NAMES uhd/config.hpp 9 | HINTS $ENV{UHD_DIR}/include 10 | ${PC_UHD_INCLUDEDIR} 11 | PATHS /usr/local/include 12 | /usr/include 13 | ) 14 | 15 | FIND_LIBRARY( 16 | UHD_LIBRARIES 17 | NAMES uhd 18 | HINTS $ENV{UHD_DIR}/lib 19 | ${PC_UHD_LIBDIR} 20 | PATHS /usr/local/lib 21 | /usr/lib 22 | ) 23 | 24 | INCLUDE(FindPackageHandleStandardArgs) 25 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibUHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) 26 | MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS) 27 | -------------------------------------------------------------------------------- /cmake/Modules/FindLibbladeRF.cmake: -------------------------------------------------------------------------------- 1 | if(NOT LIBBLADERF_FOUND) 2 | pkg_check_modules (LIBBLADERF_PKG libbladeRF) 3 | find_path(LIBBLADERF_INCLUDE_DIR NAMES libbladeRF.h 4 | PATHS 5 | ${LIBBLADERF_PKG_INCLUDE_DIRS} 6 | /usr/include 7 | /usr/local/include 8 | ) 9 | 10 | find_library(LIBBLADERF_LIBRARIES NAMES bladeRF 11 | PATHS 12 | ${LIBBLADERF_PKG_LIBRARY_DIRS} 13 | /usr/lib 14 | /usr/local/lib 15 | ) 16 | 17 | if(LIBBLADERF_INCLUDE_DIR AND LIBBLADERF_LIBRARIES) 18 | set(LIBBLADERF_FOUND TRUE CACHE INTERNAL "libbladeRF found") 19 | message(STATUS "Found libbladeRF: ${LIBBLADERF_INCLUDE_DIR}, ${LIBBLADERF_LIBRARIES}") 20 | else(LIBBLADERF_INCLUDE_DIR AND LIBBLADERF_LIBRARIES) 21 | set(LIBBLADERF_FOUND FALSE CACHE INTERNAL "libbladeRF found") 22 | message(STATUS "libbladeRF not found.") 23 | endif(LIBBLADERF_INCLUDE_DIR AND LIBBLADERF_LIBRARIES) 24 | 25 | mark_as_advanced(LIBBLADERF_INCLUDE_DIR LIBBLADERF_LIBRARIES) 26 | 27 | endif(NOT LIBBLADERF_FOUND) 28 | -------------------------------------------------------------------------------- /docs/Install/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 2, 3 | "label": "Install", 4 | "collapsible": true, 5 | "collapsed": true 6 | } -------------------------------------------------------------------------------- /docs/Playback.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_label: 'Playback' 3 | sidebar_position: 5 4 | --- 5 | 6 | # Playback & Sharing 7 | By default, Trunk Recorder just dumps a lot of recorded files into a directory. Here are a couple of options to make it easier to browse through recordings and share them on the Internet. 8 | * [OpenMHz](https://github.com/robotastic/trunk-recorder/wiki/Uploading-to-OpenMHz): This is my free hosted platform for sharing recordings 9 | * [Trunk Player](https://github.com/ScanOC/trunk-player): A great Python based server, if you want to you want to run your own 10 | * [Rdio Scanner](https://github.com/chuot/rdio-scanner): Provide a good looking, scanner style interface for listening to Trunk Recorder 11 | * Broadcastify Calls (API): see Radio Reference [forum thread](https://forums.radioreference.com/threads/405236/) and [wiki page](https://wiki.radioreference.com/index.php/Broadcastify-Calls-Trunk-Recorder) 12 | * [Broadcastify via Liquidsoap](https://github.com/robotastic/trunk-recorder/wiki/Streaming-online-to-Broadcastify-with-Liquid-Soap) 13 | * [audioplayer.php](https://github.com/robotastic/trunk-recorder/wiki/Using-audioplayer.php) 14 | * [rosecitytransit's Live Web page](https://github.com/rosecitytransit/trunk-recorder-daily-log) -------------------------------------------------------------------------------- /docs/SigMF.MD: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_label: 'SigMF' 3 | sidebar_position: 8 4 | --- 5 | 6 | # SigMF Source & Recorder 7 | 8 | -------------------------------------------------------------------------------- /docs/media/add_system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/add_system.png -------------------------------------------------------------------------------- /docs/media/config_system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/config_system.png -------------------------------------------------------------------------------- /docs/media/create_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/create_group.png -------------------------------------------------------------------------------- /docs/media/discord.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/discord.jpg -------------------------------------------------------------------------------- /docs/media/gqrx-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/gqrx-file.png -------------------------------------------------------------------------------- /docs/media/gqrx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/gqrx.png -------------------------------------------------------------------------------- /docs/media/import_talkgroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/import_talkgroup.png -------------------------------------------------------------------------------- /docs/media/openmhz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/openmhz.png -------------------------------------------------------------------------------- /docs/media/register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/register.png -------------------------------------------------------------------------------- /docs/media/screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/screenshot.jpg -------------------------------------------------------------------------------- /docs/media/system_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/system_info.png -------------------------------------------------------------------------------- /docs/media/trunk-recorder-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/trunk-recorder-docs.png -------------------------------------------------------------------------------- /docs/media/trunk-recorder-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/trunk-recorder-header.png -------------------------------------------------------------------------------- /docs/media/user_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrunkRecorder/trunk-recorder/bbb012bce4c365b879f7b15fe0fc68d62581a0e1/docs/media/user_info.png -------------------------------------------------------------------------------- /docs/notes/CALL-HANDLING.md: -------------------------------------------------------------------------------- 1 | Use [Mermaid Live](https://mermaid.live/) to edit the charts. 2 | 3 | ```mermaid 4 | flowchart TD 5 | A[Control Channel] -->|GRANT or UPDATE| B["handle_call_grant()"] 6 | B --> C{Existing Call on Freq?} 7 | C -.->|Yes| D{Same Talkgroup?} 8 | C -.->|No| G["new Call()"] 9 | D -.->|Yes| E["call->update()"] 10 | D -.->|No| F[Do nothing.\n The Recorder will notice the \ndifferent Talkgroup and stop] 11 | G -.-> H["start_recording()"] 12 | ``` 13 | 14 | ```mermaid 15 | flowchart TD 16 | A1[Voice Channel] --> B1[Transmission Sink] 17 | B1 -.->|Samples| C1{State} 18 | B1 -.->|GROUP ID| V1{GROUP ID \n==\nCALL TG} 19 | V1 -.->|Mismatch|Q1{Sample\nCount} 20 | Q1 -.->|0| R1[state = IGNORE] 21 | Q1 -.->|>0| S1[End Transmission] 22 | S1 --> T1[state = STOPPED] 23 | C1 -.->|STOPPED| D1[Drop Samples] 24 | C1 -.->|IGNORE| D1 25 | C1 -.->|IDLE| F1["Setup files\nstate = RECORDING"] 26 | C1 -.->|RECORDING| G1[Write Samples] 27 | G1 --> U1[Update d_last_write_time] 28 | F1 -.-> G1 29 | B1 -.->|TERMINATOR| H1["End Transmission"] 30 | H1 -.-> K1["state = IDLE"] 31 | ``` 32 | 33 | 34 | 35 | 36 | ```mermaid 37 | flowchart TD 38 | A[For Each Call] -->|Call| B{state} 39 | 40 | B -.->|RECORDING| C{call->last_update > 3.0 &&\nrecroder->d_last_write_time > 3.0} 41 | C -.->|True| H["Conclude Call"] 42 | C -.->|False| D[Next] 43 | B -.->|MONITORING| F{"last_update > 3.0"} 44 | F -.->|True| G["Delete Call"] 45 | G -.-> D 46 | F -.->|False| D 47 | H -.-> Z["Delete Call"] 48 | Z -.-> D 49 | ``` 50 | -------------------------------------------------------------------------------- /examples/SETUP_SERVICE.md: -------------------------------------------------------------------------------- 1 | # Automatically Starting Using a Service 2 | 3 | ## Install 4 | 5 | Modify the example serivce: [trunk-recorder.service](trunk-recorder.service) 6 | 7 | Install it by copying it to the **/etc/systemd/system** folder: 8 | 9 | ```bash 10 | sudo cp trunk-recorder.service /etc/systemd/system 11 | ``` 12 | 13 | And now start it up! 14 | 15 | ```bash 16 | sudo systemctl start trunk-recorder 17 | ``` 18 | 19 | ## Autostarting 20 | 21 | If you want to have the Service start automatically each time the system boots, you need to enable it: 22 | 23 | ```bash 24 | sudo systemctl enable trunk-recorder.service 25 | ``` 26 | 27 | 28 | ## Status 29 | 30 | You can check the most recent output from the service: 31 | 32 | ```bash 33 | sudo service trunk-recorder status 34 | ``` 35 | 36 | And you can follow the output if you want too: 37 | 38 | ```bash 39 | journalctl -u trunk-recorder.service -f 40 | ``` 41 | 42 | ## More info 43 | 44 | Here is a [good article](https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units) on using Services with Systemd. 45 | -------------------------------------------------------------------------------- /examples/auto-restart-wmata.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RECORDER490="./trunk-recorder --config=config-wmata-490.json" 4 | RECORDER496="./trunk-recorder --config=config-wmata-496.json" 5 | 6 | COUNTER=0 7 | until 1; do 8 | echo "Starting at 490MHz" 9 | $RECORDER490 10 | echo "Server $RECORDER crashed with exit code $?. Try $COUNTER. Respawning.." >&2 11 | sleep 5 12 | echo "Starting at 490MHz" 13 | $RECORDER496 14 | echo "Server $RECORDER crashed with exit code $?. Try $COUNTER. Respawning.." >&2 15 | sleep 5 16 | 17 | let COUNTER+=1 18 | done -------------------------------------------------------------------------------- /examples/channel.csv: -------------------------------------------------------------------------------- 1 | TG Number, Frequency, Tone, Alpha Tag, Description, Tag, Category, Enable 2 | 1,462562500,0,FRS 01,Channel 1,FMN,Other 3 | 2,462587500,0,FRS 02,Channel 2,FMN,Other 4 | 3,462612500,0,FRS 03,Channel 3,FMN,Other 5 | 4,462637500,0,FRS 04,Channel 4,FMN,Other 6 | 5,462662500,0,FRS 05,Channel 5,FMN,Other 7 | 6,462687500,0,FRS 06,Channel 6,FMN,Other 8 | 7,462712500,0,FRS 07,Channel 7,FMN,Other, False 9 | 8,467562500,0,FRS 08,Channel 8,FMN,Other 10 | 9,467587500,0,FRS 09,Channel 9,FMN,Other 11 | 10,467612500,0,FRS 10,Channel 10,FMN,Other 12 | 11,467637500,0,FRS 11,Channel 11,FMN,Other 13 | 12,467662500,0,FRS 12,Channel 12,FMN,Other 14 | 13,467687500,0,FRS 13,Channel 13,FMN,Other 15 | 14,467712500,0,FRS 14,Channel 14,FMN,Other 16 | 15,462550000,0,FRS 15,Channel 15,FMN,Other 17 | 16,462575000,0,FRS 16,Channel 16,FMN,Other 18 | 17,462600000,0,FRS 17,Channel 17,FMN,Other 19 | 18,462625000,0,FRS 18,Channel 18,FMN,Other 20 | 19,462650000,0,FRS 19,Channel 19,FMN,Other 21 | 20,462675000,0,FRS 20,Channel 20,FMN,Other 22 | 21,462700000,0,FRS 21,Channel 21,FMN,Other 23 | 22,462725000,0,FRS 22,Channel 22,FMN,Other -------------------------------------------------------------------------------- /examples/config-analog-conv.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | "sources": [{ 4 | "center": 167000000, 5 | "rate": 2048000, 6 | "error": 0, 7 | "gain": 28, 8 | "debugRecorders": 0, 9 | "digitalRecorders": 0, 10 | "driver": "osmosdr" 11 | }], 12 | "systems": [ 13 | { 14 | "type": "conventional", 15 | "channels": [166725000, 166925000, 167075000, 166850000], 16 | "shortName": "park", 17 | "talkgroupsFile": "park-conv.csv", 18 | "callLog": true, 19 | "audioArchive": true, 20 | "squelch": -50 21 | } 22 | ], 23 | "uploadServer": "https://api.openmhz.com" 24 | 25 | } 26 | -------------------------------------------------------------------------------- /examples/config-dmr.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver":2, 3 | "sources":[ 4 | { 5 | "center":464337000.0, 6 | "rate":1300000, 7 | "gain":36, 8 | "digitalRecorders":1, 9 | "driver":"osmosdr" 10 | } 11 | ], 12 | "systems":[ 13 | { 14 | "channels":[464775000], 15 | "type":"conventionalDMR", 16 | "squelch": -60, 17 | "shortName":"trbo" 18 | } 19 | ], 20 | "frequencyFormat":"mhz", 21 | "logLevel":"info", 22 | "logFile":true 23 | } 24 | -------------------------------------------------------------------------------- /examples/config-frs-single.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | "sources": [ 4 | { 5 | "center": 462500000, 6 | "rate": 2048000, 7 | "error": 0, 8 | "gain": 36, 9 | "debugRecorders": 0, 10 | "digitalRecoders": 0, 11 | "driver": "osmosdr" 12 | } 13 | ], 14 | "systems": [ 15 | { 16 | "type": "conventional", 17 | "channels": [ 18 | 462562500 19 | ], 20 | "callLog": true, 21 | "squelch": -20 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /examples/config-frs.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | "sources": [ 4 | { 5 | "center": 462500000, 6 | "rate": 2048000, 7 | "error": 0, 8 | "gain": 36, 9 | "debugRecorders": 0, 10 | "digitalRecoders": 0, 11 | "driver": "osmosdr" 12 | } 13 | ], 14 | "systems": [ 15 | { 16 | "type": "conventional", 17 | "channelFile": "channel.csv", 18 | "callLog": true, 19 | "squelch": -20 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /examples/config-iq-file.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | 4 | "sources": [{ 5 | "center": 855700000, 6 | "rate": 2048000, 7 | "digitalRecorders": 1, 8 | "driver": "osmosdr", 9 | "device": "file=debug-out.iq,freq=855700000,rate=2048000,repeat=true,throttle=true" 10 | } 11 | ], 12 | "systems": [{ 13 | "control_channels": [855462500], 14 | "type": "p25", 15 | "shortName": "dcfems", 16 | "modulation": "qpsk" 17 | }] 18 | } 19 | -------------------------------------------------------------------------------- /examples/config-multi-system.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | "sources": [{ 4 | "center": 857800000, 5 | "rate": 2048000, 6 | "error": 1000, 7 | "gain": 39, 8 | "debugRecorders": 0, 9 | "digitalRecorders": 4, 10 | "driver": "osmosdr", 11 | "device": "rtl=40" 12 | }, { 13 | "center": 855700000, 14 | "rate": 2048000, 15 | "error": 0, 16 | "gain": 39, 17 | "digitalRecorders": 4, 18 | "driver": "osmosdr", 19 | "device": "rtl=41" 20 | }, { 21 | "center": 860000000, 22 | "rate": 2048000, 23 | "error": 0, 24 | "gain": 39, 25 | "digitalRecorders": 4, 26 | "driver": "osmosdr", 27 | "device": "rtl=42" 28 | }, { 29 | "center": 496500000.0, 30 | "rate": 2048000.0, 31 | "error": 1100, 32 | "gain": 24, 33 | "digitalRecorders": 4, 34 | "driver": "osmosdr", 35 | "device": "rtl=31" 36 | }, { 37 | "center": 490250000.0, 38 | "rate": 2048000.0, 39 | "error": 1400, 40 | "gain": 24, 41 | "digitalRecorders": 4, 42 | "analogRecorders": 2, 43 | "driver": "osmosdr", 44 | "device": "rtl=32" 45 | }], 46 | "systems": [{ 47 | "control_channels": [855462500], 48 | "type": "p25", 49 | "shortName": "dcfems", 50 | "talkgroupsFile": "ChanList.csv", 51 | "modulation": "qpsk" 52 | }, { 53 | "control_channels": [496537500, 496437500], 54 | "type": "smartnet", 55 | "shortName": "wmata", 56 | "talkgroupsFile": "wmata.csv", 57 | "modulation": "fsk4", 58 | "analogLevels": 32 59 | }] 60 | } 61 | -------------------------------------------------------------------------------- /examples/config-p25-hackrf.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | "sources": [{ 4 | "center": 857000000.0, 5 | "rate": 8000000.0, 6 | "error": 1400, 7 | "gain": 14, 8 | "ifGain": 24, 9 | "bbGain": 42, 10 | "digitalRecorders": 2, 11 | "driver": "osmosdr" 12 | }], 13 | "systems": [{ 14 | "control_channels": [855462500], 15 | "type": "p25", 16 | "talkgroupsFile": "ChanList.csv", 17 | "modulation": "qpsk" 18 | }] 19 | } 20 | -------------------------------------------------------------------------------- /examples/config-p25-rtl.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | "sources": [{ 4 | "center": 857800000, 5 | "rate": 2048000, 6 | "error": 1000, 7 | "gain": 39, 8 | "debugRecorders": 0, 9 | "digitalRecorders": 4, 10 | "driver": "osmosdr", 11 | "device": "rtl=40" 12 | }, { 13 | "center": 855700000, 14 | "rate": 2048000, 15 | "error": 0, 16 | "gain": 39, 17 | "digitalRecorders": 4, 18 | "driver": "osmosdr", 19 | "device": "rtl=41" 20 | }, { 21 | "center": 860000000, 22 | "rate": 2048000, 23 | "error": 0, 24 | "gain": 39, 25 | "digitalRecorders": 4, 26 | "driver": "osmosdr", 27 | "device": "rtl=42" 28 | }], 29 | "systems": [{ 30 | "control_channels": [855462500], 31 | "type": "p25", 32 | "talkgroupsFile": "ChanList.csv", 33 | "shortName": "dcfems", 34 | "modulation": "qpsk" 35 | }], 36 | "captureDir": "/home/luke/gnuradio/trunk-recorder/" 37 | } 38 | -------------------------------------------------------------------------------- /examples/config-p25-uhd.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | "sources": [{ 4 | "center": 857000000.0, 5 | "rate": 8000000.0, 6 | "error": 1400, 7 | "gain": 16, 8 | "antenna": "TX/RX", 9 | "digitalRecorders": 4, 10 | "driver": "usrp" 11 | }], 12 | "systems": [{ 13 | "control_channels": [855462500], 14 | "type": "p25", 15 | "talkgroupsFile": "ChanList.csv", 16 | "modulation": "qpsk" 17 | }] 18 | } 19 | -------------------------------------------------------------------------------- /examples/config-smartnet-hackrf.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | "sources": [ 4 | { 5 | "center": 493500000.0, 6 | "rate": 8000000.0, 7 | "error": -8000, 8 | "gain": 14, 9 | "ifGain": 40, 10 | "bbGain": 40, 11 | "digitalRecorders": 4, 12 | "debugRecorders": 0, 13 | "driver": "osmosdr" 14 | } 15 | ], 16 | "systems": [{ 17 | "control_channels": [496537500, 496437500], 18 | "type": "smartnet", 19 | "talkgroupsFile": "wmata.csv", 20 | "shortName": "wmata", 21 | "modulation": "fsk4" 22 | }] 23 | } 24 | -------------------------------------------------------------------------------- /examples/config-smartnet-rtl.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | "sources": [ 4 | 5 | { 6 | "center": 496500000.0, 7 | "rate": 2048000.0, 8 | "error": 1100, 9 | "gain": 24, 10 | "digitalRecorders": 4, 11 | "analogRecorders": 2, 12 | "driver": "osmosdr", 13 | "device": "rtl=31" 14 | }, { 15 | "center": 490250000.0, 16 | "rate": 2048000.0, 17 | "error": 1400, 18 | "gain": 24, 19 | "digitalRecorders": 4, 20 | "analogRecorders": 2, 21 | "driver": "osmosdr", 22 | "device": "rtl=32" 23 | } 24 | ], 25 | "systems": [{ 26 | "control_channels": [496537500], 27 | "type": "smartnet", 28 | "talkgroupsFile": "wmata.csv", 29 | "shortName": "wmata", 30 | "modulation": "fsk4", 31 | "analogLevels": 32 32 | }] 33 | } 34 | -------------------------------------------------------------------------------- /examples/encode-upload.sh.sample: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | echo "Encoding: $1" 3 | filename="$1" 4 | basename="${filename%.*}" 5 | #mp3encoded="$basename.mp3" 6 | mp4encoded="$basename.m4a" 7 | json="$basename.json" 8 | #eval "lame --preset voice" ${filename} 9 | eval "nice -n 19 /home/luke/bin/ffmpeg -i $filename -c:a libfdk_aac -b:a 32k -cutoff 18000 $mp4encoded > /dev/null 2>&1" 10 | 11 | echo "Upload: $encoded" 12 | eval "scp $json $mp4encoded username@server.com:~/smartnet-upload " 13 | 14 | -------------------------------------------------------------------------------- /examples/trunk-recorder.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Trunk Recorder Script 3 | 4 | [Service] 5 | User=luke 6 | Group=luke 7 | Environment="PATH=/home/luke/bin/:/usr/local/bin:/usr/bin" 8 | WorkingDirectory=/home/luke/trunk-build 9 | ExecStart=/home/luke/trunk-build/auto-restart.sh 10 | Restart=always 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | 15 | # Make sure the Path in the Environment line points to your FFMPEG bin 16 | # copy to /etc/systemd/system 17 | # systemctl daemon-reload 18 | # systemctl enable trunk-recorder.service 19 | # systemctl start trunk-recorder.service 20 | -------------------------------------------------------------------------------- /examples/upload_gcs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Uploads trunk-recorder files to Google cloud storage bucket 4 | # 5 | # Assumes you have already installed and configured gsutil 6 | # See 7 | # 8 | # Must have execute permission ('chmod +x unload_gcs.sh') and 9 | # be located in the same directory as the trunk-recorder 10 | # executable. 11 | # 12 | # Configure GSUTIL and BUCKET to your environment 13 | # 14 | GSUTIL="/usr/bin/gsutil" 15 | BUCKET="p25-player-audio" # add path to BUCKET as needed (e.g. "bucket-name/subdir/") 16 | # 17 | DELAY="2s" 18 | TIMEFORMAT="+%F %T.%6N" 19 | FILENAME="$1" 20 | # echo "Uploading: ${FILENAME}" 21 | BASENAME="${FILENAME%.*}" 22 | JSON="${BASENAME}.json" 23 | sleep ${DELAY} 24 | ${GSUTIL} -q cp ${FILENAME} ${JSON} gs://${BUCKET} 25 | if [ $? -eq 0 ] 26 | then 27 | echo "[$(date "${TIMEFORMAT}")] Uploaded: ${BASENAME} Bucket: ${BUCKET}" 28 | else 29 | echo "[$(date "${TIMEFORMAT}")] Upload failed: ${BASENAME} Bucket: ${BUCKET}" 30 | exit 1 31 | fi 32 | -------------------------------------------------------------------------------- /git.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class GitMetadata { 5 | public: 6 | // Is the metadata populated? We may not have metadata if 7 | // there wasn't a .git directory (e.g. downloaded source 8 | // code without revision history). 9 | static bool Populated(); 10 | 11 | // Were there any uncommitted changes that won't be reflected 12 | // in the CommitID? 13 | static bool AnyUncommittedChanges(); 14 | 15 | // The commit author's name. 16 | static std::string AuthorName(); 17 | // The commit author's email. 18 | static std::string AuthorEmail(); 19 | // The commit SHA1. 20 | static std::string CommitSHA1(); 21 | // The ISO8601 commit date. 22 | static std::string CommitDate(); 23 | // The commit subject. 24 | static std::string CommitSubject(); 25 | // The commit body. 26 | static std::string CommitBody(); 27 | // The commit describe. 28 | static std::string Describe(); 29 | // The symbolic reference tied to HEAD. 30 | static std::string Branch(); 31 | // dump 32 | static void VersionInfo(); 33 | }; 34 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | 5 | # trunk-recorder install script for debian based systems 6 | # including ubuntu 18.04/20.04 and raspbian 7 | 8 | if [ ! -d trunk-recorder/recorders ]; then 9 | echo ====== ERROR: trunk-recorder top level directories not found. 10 | echo ====== You must change to the trunk-recorder top level directory 11 | echo ====== before running this script. 12 | exit 13 | fi 14 | 15 | pre_reqs() { 16 | PKG_LIST="gnuradio gnuradio-dev gr-osmosdr libhackrf-dev libuhd-dev libgmp-dev" 17 | PKG_LIST="$PKG_LIST fdkaac sox" 18 | PKG_LIST="$PKG_LIST git cmake build-essential libboost-all-dev libusb-1.0-0.dev libssl-dev libcurl4-openssl-dev liborc-0.4-dev" 19 | 20 | ISSUE=$(cat /etc/issue) 21 | case "$ISSUE" in 22 | "") echo "Well that's weird. You don't have an /etc/issue" ;; 23 | "Ubuntu 20.04*") PKG_LIST="$PKG_LIST pkg-config libpthread-stubs0-dev" ;; 24 | esac 25 | 26 | sudo apt-get update 27 | sudo apt-get install $PKG_LIST 28 | } 29 | 30 | freshen_repo() { 31 | git pull 32 | if [ -d build ]; then 33 | rm -rf build 34 | fi 35 | } 36 | 37 | do_build() { 38 | mkdir build 39 | cd build 40 | cmake ../ 41 | make 42 | cd .. 43 | } 44 | 45 | do_install() { 46 | cd build 47 | sudo make install 48 | cd .. 49 | } 50 | 51 | blacklist() { 52 | if [ ! -f /etc/modprobe.d/blacklist-rtl.conf ]; then 53 | echo ====== Installing blacklist-rtl.conf for selecting the correct RTL-SDR drivers 54 | echo ====== Please reboot before running trunk-recorder. 55 | sudo install -m 0644 ./blacklist-rtl.conf /etc/modprobe.d/ 56 | fi 57 | } 58 | 59 | rebuild_steps() { 60 | freshen_repo 61 | do_build 62 | do_install 63 | } 64 | 65 | install_steps() { 66 | pre_reqs 67 | rebuild_steps 68 | blacklist 69 | } 70 | 71 | case "$0" in 72 | *rebuild*) rebuild_steps ;; 73 | *) install_steps ;; 74 | esac 75 | -------------------------------------------------------------------------------- /lib/gr-latency-manager/include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011,2012 Free Software Foundation, Inc. 2 | # 3 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 4 | # This file is a part of gr-latency_manager 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | ######################################################################## 10 | # Install public header files 11 | ######################################################################## 12 | install(FILES 13 | api.h 14 | DESTINATION include/gnuradio/latency_manager 15 | ) 16 | -------------------------------------------------------------------------------- /lib/gr-latency-manager/include/api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Free Software Foundation, Inc. 3 | * 4 | * This file was generated by gr_modtool, a tool from the GNU Radio framework 5 | * This file is a part of gr-latency_manager 6 | * 7 | * SPDX-License-Identifier: GPL-3.0-or-later 8 | * 9 | */ 10 | 11 | #ifndef INCLUDED_LATENCY_MANAGER_API_H 12 | #define INCLUDED_LATENCY_MANAGER_API_H 13 | 14 | #include 15 | 16 | #ifdef gnuradio_latency_manager_EXPORTS 17 | #define LATENCY_MANAGER_API __GR_ATTR_EXPORT 18 | #else 19 | #define LATENCY_MANAGER_API __GR_ATTR_IMPORT 20 | #endif 21 | 22 | #endif /* INCLUDED_LATENCY_MANAGER_API_H */ 23 | -------------------------------------------------------------------------------- /lib/gr-latency-manager/include/latency_manager.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2019 Derek Kozel. 4 | * 5 | * This is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3, or (at your option) 8 | * any later version. 9 | * 10 | * This software is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this software; see the file COPYING. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_H 22 | #define INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_H 23 | 24 | #include "./api.h" 25 | #include 26 | 27 | namespace gr { 28 | namespace latency_manager { 29 | 30 | /*! 31 | * \brief <+description of block+> 32 | * \ingroup latency_manager 33 | * 34 | */ 35 | class LATENCY_MANAGER_API latency_manager : virtual public gr::sync_block 36 | { 37 | public: 38 | typedef std::shared_ptr sptr; 39 | 40 | static sptr make(int max_tags_in_flight, int tag_interval, int itemsize); 41 | }; 42 | 43 | } // namespace latency_manager 44 | } // namespace gr 45 | 46 | #endif /* INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_H */ 47 | 48 | -------------------------------------------------------------------------------- /lib/gr-latency-manager/lib/latency_manager_impl.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2019 Derek Kozel. 4 | * 5 | * This is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3, or (at your option) 8 | * any later version. 9 | * 10 | * This software is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this software; see the file COPYING. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_IMPL_H 22 | #define INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_IMPL_H 23 | 24 | #include "../include/latency_manager.h" 25 | 26 | namespace gr { 27 | namespace latency_manager { 28 | 29 | class latency_manager_impl : public latency_manager 30 | { 31 | private: 32 | int d_tokens; 33 | void add_token(pmt::pmt_t tag); 34 | int d_itemsize; 35 | int d_tag_interval; 36 | int d_tag_phase; 37 | tag_t d_tag; 38 | 39 | public: 40 | latency_manager_impl(int max_tags_in_flight, int tag_interval, int itemsize); 41 | ~latency_manager_impl(); 42 | 43 | // Where all the action really happens 44 | int work( 45 | int noutput_items, 46 | gr_vector_const_void_star &input_items, 47 | gr_vector_void_star &output_items 48 | ); 49 | }; 50 | 51 | } // namespace latency_manager 52 | } // namespace gr 53 | 54 | #endif /* INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_IMPL_H */ 55 | 56 | -------------------------------------------------------------------------------- /lib/gr-latency/latency_tagger.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2012 <+YOU OR YOUR COMPANY+>. 4 | * 5 | * This is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3, or (at your option) 8 | * any later version. 9 | * 10 | * This software is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this software; see the file COPYING. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef INCLUDED_LATENCY_TAGGER_H 22 | #define INCLUDED_LATENCY_TAGGER_H 23 | 24 | 25 | #include 26 | 27 | #include 28 | 29 | #ifdef gnuradio_latency_tagger_EXPORTS 30 | #define LATENCY_TAGGER_API __GR_ATTR_EXPORT 31 | #else 32 | #define LATENCY_TAGGER_API __GR_ATTR_IMPORT 33 | #endif 34 | 35 | 36 | /*! 37 | * \brief <+description+> 38 | * 39 | */ 40 | 41 | namespace gr { 42 | namespace gr_latency { 43 | class LATENCY_TAGGER_API latency_tagger : public gr::sync_block 44 | { 45 | 46 | 47 | latency_tagger (int item_size, int tag_frequency, std::string tag); 48 | int d_tag_frequency; 49 | int d_itemsize; 50 | pmt::pmt_t d_key; 51 | pmt::pmt_t d_src; 52 | 53 | public: 54 | typedef std::shared_ptr sptr; 55 | static sptr make(int item_size, int tag_frequency, std::string tag); 56 | ~latency_tagger (); 57 | 58 | int work (int noutput_items, 59 | gr_vector_const_void_star &input_items, 60 | gr_vector_void_star &output_items); 61 | }; 62 | } 63 | } 64 | #endif /* INCLUDED_LATENCY_TAGGER_H */ 65 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(RegexUtils) 2 | test_escape_string_as_regex() 3 | 4 | file(GLOB Eigen_directory_files "*") 5 | 6 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 7 | 8 | foreach(f ${Eigen_directory_files}) 9 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src") 10 | list(APPEND Eigen_directory_files_to_install ${f}) 11 | endif() 12 | endforeach(f ${Eigen_directory_files}) 13 | 14 | install(FILES 15 | ${Eigen_directory_files_to_install} 16 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel 17 | ) 18 | 19 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h") 20 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLESKY_MODULE_H 9 | #define EIGEN_CHOLESKY_MODULE_H 10 | 11 | #include "Core" 12 | #include "Jacobi" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** \defgroup Cholesky_Module Cholesky module 17 | * 18 | * 19 | * 20 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 21 | * Those decompositions are also accessible via the following methods: 22 | * - MatrixBase::llt() 23 | * - MatrixBase::ldlt() 24 | * - SelfAdjointView::llt() 25 | * - SelfAdjointView::ldlt() 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | */ 31 | 32 | #include "src/Cholesky/LLT.h" 33 | #include "src/Cholesky/LDLT.h" 34 | #ifdef EIGEN_USE_LAPACKE 35 | #ifdef EIGEN_USE_MKL 36 | #include "mkl_lapacke.h" 37 | #else 38 | #include "src/misc/lapacke.h" 39 | #endif 40 | #include "src/Cholesky/LLT_LAPACKE.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_CHOLESKY_MODULE_H 46 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/Householder: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 9 | #define EIGEN_HOUSEHOLDER_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Householder_Module Householder module 16 | * This module provides Householder transformations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/Householder/Householder.h" 24 | #include "src/Householder/HouseholderSequence.h" 25 | #include "src/Householder/BlockHouseholder.h" 26 | 27 | #include "src/Core/util/ReenableStupidWarnings.h" 28 | 29 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 30 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_JACOBI_MODULE_H 9 | #define EIGEN_JACOBI_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Jacobi_Module Jacobi module 16 | * This module provides Jacobi and Givens rotations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | * 22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 23 | * - MatrixBase::applyOnTheLeft() 24 | * - MatrixBase::applyOnTheRight(). 25 | */ 26 | 27 | #include "src/Jacobi/Jacobi.h" 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_JACOBI_MODULE_H 32 | 33 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/KLUSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_KLUSUPPORT_MODULE_H 9 | #define EIGEN_KLUSUPPORT_MODULE_H 10 | 11 | #include 12 | 13 | #include 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup KLUSupport_Module KLUSupport module 22 | * 23 | * This module provides an interface to the KLU library which is part of the suitesparse package. 24 | * It provides the following factorization class: 25 | * - class KLU: a sparse LU factorization, well-suited for circuit simulation. 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | * 31 | * In order to use this module, the klu and btf headers must be accessible from the include paths, and your binary must be linked to the klu library and its dependencies. 32 | * The dependencies depend on how umfpack has been compiled. 33 | * For a cmake based project, you can use our FindKLU.cmake module to help you in this task. 34 | * 35 | */ 36 | 37 | #include "src/KLUSupport/KLUSupport.h" 38 | 39 | #include 40 | 41 | #endif // EIGEN_KLUSUPPORT_MODULE_H 42 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/LU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_LU_MODULE_H 9 | #define EIGEN_LU_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup LU_Module LU module 16 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 17 | * This module defines the following MatrixBase methods: 18 | * - MatrixBase::inverse() 19 | * - MatrixBase::determinant() 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/misc/Kernel.h" 27 | #include "src/misc/Image.h" 28 | #include "src/LU/FullPivLU.h" 29 | #include "src/LU/PartialPivLU.h" 30 | #ifdef EIGEN_USE_LAPACKE 31 | #ifdef EIGEN_USE_MKL 32 | #include "mkl_lapacke.h" 33 | #else 34 | #include "src/misc/lapacke.h" 35 | #endif 36 | #include "src/LU/PartialPivLU_LAPACKE.h" 37 | #endif 38 | #include "src/LU/Determinant.h" 39 | #include "src/LU/InverseImpl.h" 40 | 41 | #if defined EIGEN_VECTORIZE_SSE || defined EIGEN_VECTORIZE_NEON 42 | #include "src/LU/arch/InverseSize4.h" 43 | #endif 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_LU_MODULE_H 48 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_METISSUPPORT_MODULE_H 9 | #define EIGEN_METISSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup MetisSupport_Module MetisSupport module 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 28 | */ 29 | 30 | 31 | #include "src/MetisSupport/MetisSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_METISSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/PaStiXSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 9 | #define EIGEN_PASTIXSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | #ifdef complex 21 | #undef complex 22 | #endif 23 | 24 | /** \ingroup Support_modules 25 | * \defgroup PaStiXSupport_Module PaStiXSupport module 26 | * 27 | * This module provides an interface to the PaSTiX library. 28 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. 29 | * It provides the two following main factorization classes: 30 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. 31 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. 32 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | * 38 | * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies. 39 | * This wrapper resuires PaStiX version 5.x compiled without MPI support. 40 | * The dependencies depend on how PaSTiX has been compiled. 41 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 42 | * 43 | */ 44 | 45 | #include "src/PaStiXSupport/PaStiXSupport.h" 46 | 47 | #include "src/Core/util/ReenableStupidWarnings.h" 48 | 49 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 50 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 9 | #define EIGEN_PARDISOSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup PardisoSupport_Module PardisoSupport module 19 | * 20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. 27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 28 | * 29 | */ 30 | 31 | #include "src/PardisoSupport/PardisoSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/QR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QR_MODULE_H 9 | #define EIGEN_QR_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 18 | 19 | /** \defgroup QR_Module QR module 20 | * 21 | * 22 | * 23 | * This module provides various QR decompositions 24 | * This module also provides some MatrixBase methods, including: 25 | * - MatrixBase::householderQr() 26 | * - MatrixBase::colPivHouseholderQr() 27 | * - MatrixBase::fullPivHouseholderQr() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/QR/HouseholderQR.h" 35 | #include "src/QR/FullPivHouseholderQR.h" 36 | #include "src/QR/ColPivHouseholderQR.h" 37 | #include "src/QR/CompleteOrthogonalDecomposition.h" 38 | #ifdef EIGEN_USE_LAPACKE 39 | #ifdef EIGEN_USE_MKL 40 | #include "mkl_lapacke.h" 41 | #else 42 | #include "src/misc/lapacke.h" 43 | #endif 44 | #include "src/QR/HouseholderQR_LAPACKE.h" 45 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_QR_MODULE_H 51 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QTMALLOC_MODULE_H 9 | #define EIGEN_QTMALLOC_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | void *qMalloc(std::size_t size) 18 | { 19 | return Eigen::internal::aligned_malloc(size); 20 | } 21 | 22 | void qFree(void *ptr) 23 | { 24 | Eigen::internal::aligned_free(ptr); 25 | } 26 | 27 | void *qRealloc(void *ptr, std::size_t size) 28 | { 29 | void* newPtr = Eigen::internal::aligned_malloc(size); 30 | std::memcpy(newPtr, ptr, size); 31 | Eigen::internal::aligned_free(ptr); 32 | return newPtr; 33 | } 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | 39 | #endif // EIGEN_QTMALLOC_MODULE_H 40 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 9 | #define EIGEN_SPQRSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "SuiteSparseQR.hpp" 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup SPQRSupport_Module SuiteSparseQR module 19 | * 20 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). 27 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 28 | * 29 | */ 30 | 31 | #include "src/CholmodSupport/CholmodSupport.h" 32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/SVD: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SVD_MODULE_H 9 | #define EIGEN_SVD_MODULE_H 10 | 11 | #include "QR" 12 | #include "Householder" 13 | #include "Jacobi" 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | /** \defgroup SVD_Module SVD module 18 | * 19 | * 20 | * 21 | * This module provides SVD decomposition for matrices (both real and complex). 22 | * Two decomposition algorithms are provided: 23 | * - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones. 24 | * - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems. 25 | * These decompositions are accessible via the respective classes and following MatrixBase methods: 26 | * - MatrixBase::jacobiSvd() 27 | * - MatrixBase::bdcSvd() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/misc/RealSvd2x2.h" 35 | #include "src/SVD/UpperBidiagonalization.h" 36 | #include "src/SVD/SVDBase.h" 37 | #include "src/SVD/JacobiSVD.h" 38 | #include "src/SVD/BDCSVD.h" 39 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 40 | #ifdef EIGEN_USE_MKL 41 | #include "mkl_lapacke.h" 42 | #else 43 | #include "src/misc/lapacke.h" 44 | #endif 45 | #include "src/SVD/JacobiSVD_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_SVD_MODULE_H 51 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSE_MODULE_H 9 | #define EIGEN_SPARSE_MODULE_H 10 | 11 | /** \defgroup Sparse_Module Sparse meta-module 12 | * 13 | * Meta-module including all related modules: 14 | * - \ref SparseCore_Module 15 | * - \ref OrderingMethods_Module 16 | * - \ref SparseCholesky_Module 17 | * - \ref SparseLU_Module 18 | * - \ref SparseQR_Module 19 | * - \ref IterativeLinearSolvers_Module 20 | * 21 | \code 22 | #include 23 | \endcode 24 | */ 25 | 26 | #include "SparseCore" 27 | #include "OrderingMethods" 28 | #include "SparseCholesky" 29 | #include "SparseLU" 30 | #include "SparseQR" 31 | #include "IterativeLinearSolvers" 32 | 33 | #endif // EIGEN_SPARSE_MODULE_H 34 | 35 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2013 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 11 | #define EIGEN_SPARSECHOLESKY_MODULE_H 12 | 13 | #include "SparseCore" 14 | #include "OrderingMethods" 15 | 16 | #include "src/Core/util/DisableStupidWarnings.h" 17 | 18 | /** 19 | * \defgroup SparseCholesky_Module SparseCholesky module 20 | * 21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. 22 | * Those decompositions are accessible via the following classes: 23 | * - SimplicialLLt, 24 | * - SimplicialLDLt 25 | * 26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #include "src/SparseCholesky/SimplicialCholesky.h" 34 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 38 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/SparseLU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // Copyright (C) 2012 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_SPARSELU_MODULE_H 12 | #define EIGEN_SPARSELU_MODULE_H 13 | 14 | #include "SparseCore" 15 | 16 | /** 17 | * \defgroup SparseLU_Module SparseLU module 18 | * This module defines a supernodal factorization of general sparse matrices. 19 | * The code is fully optimized for supernode-panel updates with specialized kernels. 20 | * Please, see the documentation of the SparseLU class for more details. 21 | */ 22 | 23 | // Ordering interface 24 | #include "OrderingMethods" 25 | 26 | #include "src/Core/util/DisableStupidWarnings.h" 27 | 28 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 29 | 30 | #include "src/SparseLU/SparseLU_Structs.h" 31 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 32 | #include "src/SparseLU/SparseLUImpl.h" 33 | #include "src/SparseCore/SparseColEtree.h" 34 | #include "src/SparseLU/SparseLU_Memory.h" 35 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 36 | #include "src/SparseLU/SparseLU_relax_snode.h" 37 | #include "src/SparseLU/SparseLU_pivotL.h" 38 | #include "src/SparseLU/SparseLU_panel_dfs.h" 39 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 40 | #include "src/SparseLU/SparseLU_panel_bmod.h" 41 | #include "src/SparseLU/SparseLU_column_dfs.h" 42 | #include "src/SparseLU/SparseLU_column_bmod.h" 43 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 44 | #include "src/SparseLU/SparseLU_pruneL.h" 45 | #include "src/SparseLU/SparseLU_Utils.h" 46 | #include "src/SparseLU/SparseLU.h" 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_SPARSELU_MODULE_H 51 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSEQR_MODULE_H 9 | #define EIGEN_SPARSEQR_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup SparseQR_Module SparseQR module 16 | * \brief Provides QR decomposition for sparse matrices 17 | * 18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 19 | * The columns of the input matrix should be reordered to limit the fill-in during the 20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 22 | * of built-in and external ordering methods. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | * 28 | * 29 | */ 30 | 31 | #include "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseQR/SparseQR.h" 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/StdDeque: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_MODULE_H 12 | #define EIGEN_STDDEQUE_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdDeque.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDDEQUE_MODULE_H 28 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 17 | 18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) 19 | 20 | #else 21 | 22 | #include "src/StlSupport/StdList.h" 23 | 24 | #endif 25 | 26 | #endif // EIGEN_STDLIST_MODULE_H 27 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/StdVector: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_MODULE_H 12 | #define EIGEN_STDVECTOR_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdVector.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDVECTOR_MODULE_H 28 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/UmfPackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 9 | #define EIGEN_UMFPACKSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup UmfPackSupport_Module UmfPackSupport module 21 | * 22 | * This module provides an interface to the UmfPack library which is part of the suitesparse package. 23 | * It provides the following factorization class: 24 | * - class UmfPackLU: a multifrontal sequential LU factorization. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | * 30 | * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. 31 | * The dependencies depend on how umfpack has been compiled. 32 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. 33 | * 34 | */ 35 | 36 | #include "src/UmfPackSupport/UmfPackSupport.h" 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H 41 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/Core/DiagonalProduct.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // Copyright (C) 2007-2009 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_DIAGONALPRODUCT_H 12 | #define EIGEN_DIAGONALPRODUCT_H 13 | 14 | namespace Eigen { 15 | 16 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. 17 | */ 18 | template 19 | template 20 | EIGEN_DEVICE_FUNC inline const Product 21 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const 22 | { 23 | return Product(derived(),a_diagonal.derived()); 24 | } 25 | 26 | } // end namespace Eigen 27 | 28 | #endif // EIGEN_DIAGONALPRODUCT_H 29 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/Core/SelfCwiseBinaryOp.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SELFCWISEBINARYOP_H 11 | #define EIGEN_SELFCWISEBINARYOP_H 12 | 13 | namespace Eigen { 14 | 15 | // TODO generalize the scalar type of 'other' 16 | 17 | template 18 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator*=(const Scalar& other) 19 | { 20 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op()); 21 | return derived(); 22 | } 23 | 24 | template 25 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator+=(const Scalar& other) 26 | { 27 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op()); 28 | return derived(); 29 | } 30 | 31 | template 32 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator-=(const Scalar& other) 33 | { 34 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op()); 35 | return derived(); 36 | } 37 | 38 | template 39 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator/=(const Scalar& other) 40 | { 41 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op()); 42 | return derived(); 43 | } 44 | 45 | } // end namespace Eigen 46 | 47 | #endif // EIGEN_SELFCWISEBINARYOP_H 48 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/Core/arch/Default/Settings.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | 12 | /* All the parameters defined in this file can be specialized in the 13 | * architecture specific files, and/or by the user. 14 | * More to come... */ 15 | 16 | #ifndef EIGEN_DEFAULT_SETTINGS_H 17 | #define EIGEN_DEFAULT_SETTINGS_H 18 | 19 | /** Defines the maximal loop size to enable meta unrolling of loops. 20 | * Note that the value here is expressed in Eigen's own notion of "number of FLOPS", 21 | * it does not correspond to the number of iterations or the number of instructions 22 | */ 23 | #ifndef EIGEN_UNROLLING_LIMIT 24 | #define EIGEN_UNROLLING_LIMIT 110 25 | #endif 26 | 27 | /** Defines the threshold between a "small" and a "large" matrix. 28 | * This threshold is mainly used to select the proper product implementation. 29 | */ 30 | #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 31 | #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8 32 | #endif 33 | 34 | /** Defines the maximal width of the blocks used in the triangular product and solver 35 | * for vectors (level 2 blas xTRMV and xTRSV). The default is 8. 36 | */ 37 | #ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 38 | #define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8 39 | #endif 40 | 41 | 42 | /** Defines the default number of registers available for that architecture. 43 | * Currently it must be 8 or 16. Other values will fail. 44 | */ 45 | #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 46 | #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8 47 | #endif 48 | 49 | #endif // EIGEN_DEFAULT_SETTINGS_H 50 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/Core/arch/HIP/hcc/math_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * math_constants.h - 3 | * HIP equivalent of the CUDA header of the same name 4 | */ 5 | 6 | #ifndef __MATH_CONSTANTS_H__ 7 | #define __MATH_CONSTANTS_H__ 8 | 9 | /* single precision constants */ 10 | 11 | #define HIPRT_INF_F __int_as_float(0x7f800000) 12 | #define HIPRT_NAN_F __int_as_float(0x7fffffff) 13 | #define HIPRT_MIN_DENORM_F __int_as_float(0x00000001) 14 | #define HIPRT_MAX_NORMAL_F __int_as_float(0x7f7fffff) 15 | #define HIPRT_NEG_ZERO_F __int_as_float(0x80000000) 16 | #define HIPRT_ZERO_F 0.0f 17 | #define HIPRT_ONE_F 1.0f 18 | 19 | /* double precision constants */ 20 | #define HIPRT_INF __hiloint2double(0x7ff00000, 0x00000000) 21 | #define HIPRT_NAN __hiloint2double(0xfff80000, 0x00000000) 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/Core/arch/SVE/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2020, Arm Limited and Contributors 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MATH_FUNCTIONS_SVE_H 11 | #define EIGEN_MATH_FUNCTIONS_SVE_H 12 | 13 | namespace Eigen { 14 | namespace internal { 15 | 16 | template <> 17 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf pexp(const PacketXf& x) { 18 | return pexp_float(x); 19 | } 20 | 21 | template <> 22 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf plog(const PacketXf& x) { 23 | return plog_float(x); 24 | } 25 | 26 | template <> 27 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf psin(const PacketXf& x) { 28 | return psin_float(x); 29 | } 30 | 31 | template <> 32 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf pcos(const PacketXf& x) { 33 | return pcos_float(x); 34 | } 35 | 36 | // Hyperbolic Tangent function. 37 | template <> 38 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf ptanh(const PacketXf& x) { 39 | return internal::generic_fast_tanh_float(x); 40 | } 41 | } // end namespace internal 42 | } // end namespace Eigen 43 | 44 | #endif // EIGEN_MATH_FUNCTIONS_SVE_H 45 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/Core/arch/SVE/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2020, Arm Limited and Contributors 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TYPE_CASTING_SVE_H 11 | #define EIGEN_TYPE_CASTING_SVE_H 12 | 13 | namespace Eigen { 14 | namespace internal { 15 | 16 | template <> 17 | struct type_casting_traits { 18 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 }; 19 | }; 20 | 21 | template <> 22 | struct type_casting_traits { 23 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 }; 24 | }; 25 | 26 | template <> 27 | EIGEN_STRONG_INLINE PacketXf pcast(const PacketXi& a) { 28 | return svcvt_f32_s32_z(svptrue_b32(), a); 29 | } 30 | 31 | template <> 32 | EIGEN_STRONG_INLINE PacketXi pcast(const PacketXf& a) { 33 | return svcvt_s32_f32_z(svptrue_b32(), a); 34 | } 35 | 36 | template <> 37 | EIGEN_STRONG_INLINE PacketXf preinterpret(const PacketXi& a) { 38 | return svreinterpret_f32_s32(a); 39 | } 40 | 41 | template <> 42 | EIGEN_STRONG_INLINE PacketXi preinterpret(const PacketXf& a) { 43 | return svreinterpret_s32_f32(a); 44 | } 45 | 46 | } // namespace internal 47 | } // namespace Eigen 48 | 49 | #endif // EIGEN_TYPE_CASTING_SVE_H 50 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/Core/functors/TernaryFunctors.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TERNARY_FUNCTORS_H 11 | #define EIGEN_TERNARY_FUNCTORS_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | //---------- associative ternary functors ---------- 18 | 19 | 20 | 21 | } // end namespace internal 22 | 23 | } // end namespace Eigen 24 | 25 | #endif // EIGEN_TERNARY_FUNCTORS_H 26 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED_2 2 | // "DisableStupidWarnings.h" was included twice recursively: Do not reenable warnings yet! 3 | # undef EIGEN_WARNINGS_DISABLED_2 4 | 5 | #elif defined(EIGEN_WARNINGS_DISABLED) 6 | #undef EIGEN_WARNINGS_DISABLED 7 | 8 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 9 | #ifdef _MSC_VER 10 | #pragma warning( pop ) 11 | #elif defined __INTEL_COMPILER 12 | #pragma warning pop 13 | #elif defined __clang__ 14 | #pragma clang diagnostic pop 15 | #elif defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) 16 | #pragma GCC diagnostic pop 17 | #endif 18 | 19 | #if defined __NVCC__ 20 | // Don't reenable the diagnostic messages, as it turns out these messages need 21 | // to be disabled at the point of the template instantiation (i.e the user code) 22 | // otherwise they'll be triggered by nvcc. 23 | // #pragma diag_default code_is_unreachable 24 | // #pragma diag_default initialization_not_reachable 25 | // #pragma diag_default 2651 26 | // #pragma diag_default 2653 27 | #endif 28 | 29 | #endif 30 | 31 | #endif // EIGEN_WARNINGS_DISABLED 32 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/Core/util/ReshapedHelper.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2017 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | 11 | #ifndef EIGEN_RESHAPED_HELPER_H 12 | #define EIGEN_RESHAPED_HELPER_H 13 | 14 | namespace Eigen { 15 | 16 | enum AutoSize_t { AutoSize }; 17 | const int AutoOrder = 2; 18 | 19 | namespace internal { 20 | 21 | template 22 | struct get_compiletime_reshape_size { 23 | enum { value = get_fixed_value::value }; 24 | }; 25 | 26 | template 27 | Index get_runtime_reshape_size(SizeType size, Index /*other*/, Index /*total*/) { 28 | return internal::get_runtime_value(size); 29 | } 30 | 31 | template 32 | struct get_compiletime_reshape_size { 33 | enum { 34 | other_size = get_fixed_value::value, 35 | value = (TotalSize==Dynamic || other_size==Dynamic) ? Dynamic : TotalSize / other_size }; 36 | }; 37 | 38 | inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) { 39 | return total/other; 40 | } 41 | 42 | template 43 | struct get_compiletime_reshape_order { 44 | enum { value = Order == AutoOrder ? Flags & RowMajorBit : Order }; 45 | }; 46 | 47 | } 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_RESHAPED_HELPER_H 52 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/SparseCore/SparseFuzzy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_FUZZY_H 11 | #define EIGEN_SPARSE_FUZZY_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | template 17 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const 18 | { 19 | const typename internal::nested_eval::type actualA(derived()); 20 | typename internal::conditional::type, 22 | const PlainObject>::type actualB(other.derived()); 23 | 24 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); 25 | } 26 | 27 | } // end namespace Eigen 28 | 29 | #endif // EIGEN_SPARSE_FUZZY_H 30 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/SparseCore/SparseRedux.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSEREDUX_H 11 | #define EIGEN_SPARSEREDUX_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | typename internal::traits::Scalar 17 | SparseMatrixBase::sum() const 18 | { 19 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 20 | Scalar res(0); 21 | internal::evaluator thisEval(derived()); 22 | for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter) 24 | res += iter.value(); 25 | return res; 26 | } 27 | 28 | template 29 | typename internal::traits >::Scalar 30 | SparseMatrix<_Scalar,_Options,_Index>::sum() const 31 | { 32 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 33 | if(this->isCompressed()) 34 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 35 | else 36 | return Base::sum(); 37 | } 38 | 39 | template 40 | typename internal::traits >::Scalar 41 | SparseVector<_Scalar,_Options,_Index>::sum() const 42 | { 43 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 44 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 45 | } 46 | 47 | } // end namespace Eigen 48 | 49 | #endif // EIGEN_SPARSEREDUX_H 50 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/misc/RealSvd2x2.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Benoit Jacob 5 | // Copyright (C) 2013-2016 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_REALSVD2X2_H 12 | #define EIGEN_REALSVD2X2_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | 18 | template 19 | void real_2x2_jacobi_svd(const MatrixType& matrix, Index p, Index q, 20 | JacobiRotation *j_left, 21 | JacobiRotation *j_right) 22 | { 23 | using std::sqrt; 24 | using std::abs; 25 | Matrix m; 26 | m << numext::real(matrix.coeff(p,p)), numext::real(matrix.coeff(p,q)), 27 | numext::real(matrix.coeff(q,p)), numext::real(matrix.coeff(q,q)); 28 | JacobiRotation rot1; 29 | RealScalar t = m.coeff(0,0) + m.coeff(1,1); 30 | RealScalar d = m.coeff(1,0) - m.coeff(0,1); 31 | 32 | if(abs(d) < (std::numeric_limits::min)()) 33 | { 34 | rot1.s() = RealScalar(0); 35 | rot1.c() = RealScalar(1); 36 | } 37 | else 38 | { 39 | // If d!=0, then t/d cannot overflow because the magnitude of the 40 | // entries forming d are not too small compared to the ones forming t. 41 | RealScalar u = t / d; 42 | RealScalar tmp = sqrt(RealScalar(1) + numext::abs2(u)); 43 | rot1.s() = RealScalar(1) / tmp; 44 | rot1.c() = u / tmp; 45 | } 46 | m.applyOnTheLeft(0,1,rot1); 47 | j_right->makeJacobi(m,0,1); 48 | *j_left = rot1 * j_right->transpose(); 49 | } 50 | 51 | } // end namespace internal 52 | 53 | } // end namespace Eigen 54 | 55 | #endif // EIGEN_REALSVD2X2_H 56 | -------------------------------------------------------------------------------- /lib/lfsr/Eigen/src/misc/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /lib/lfsr/lfsr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * lfsr.h 3 | * 4 | * Translation of lfsr.py to c++ - header file 5 | * 6 | * Created on: Feb 19, 2017 7 | * Author: S. Lukic 8 | */ 9 | 10 | #ifndef LFSR_H_ 11 | #define LFSR_H_ 12 | 13 | 14 | #include "Eigen/Dense" 15 | 16 | class p25p2_lfsr { 17 | public: 18 | p25p2_lfsr(unsigned nac, unsigned sysid, unsigned wacn); 19 | 20 | const Eigen::VectorXi * getXorsyms() const { return xorsyms; } 21 | const char * getXorChars(unsigned &len) const; 22 | 23 | private: 24 | 25 | Eigen::VectorXi * mk_xor_bits(unsigned long, unsigned long, unsigned long); 26 | 27 | static unsigned long long asm_reg(unsigned long long s[6] ); 28 | static unsigned long long * disasm_reg(unsigned long long r); 29 | static unsigned long long cyc_reg(unsigned long long reg); 30 | 31 | Eigen::VectorXi *xorsyms; 32 | std::string *xor_chars; 33 | 34 | static const int msize = 44; 35 | Eigen::Matrix M; 36 | 37 | }; 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | #endif /* LFSR_H_ */ 47 | -------------------------------------------------------------------------------- /lib/op25_repeater/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011,2012 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | 21 | # Set component parameters 22 | set(GR_OP25_REPEATER_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE) 23 | 24 | ######################################################################## 25 | # Add subdirectories 26 | ######################################################################## 27 | add_subdirectory(include/op25_repeater) 28 | add_subdirectory(lib) 29 | -------------------------------------------------------------------------------- /lib/op25_repeater/CTestTestfile.cmake: -------------------------------------------------------------------------------- 1 | # CMake generated Testfile for 2 | # Source directory: /Users/luke/Programming/trunk-recorder/op25_repeater 3 | # Build directory: /Users/luke/Programming/trunk-recorder/op25_repeater 4 | # 5 | # This file includes the relevant testing commands required for 6 | # testing this directory and lists subdirectories to be tested as well. 7 | subdirs(include/op25_repeater) 8 | subdirs(lib) 9 | -------------------------------------------------------------------------------- /lib/op25_repeater/include/op25_repeater/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011,2012 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Install public header files 22 | ######################################################################## 23 | #install(FILES 24 | # api.h 25 | # vocoder.h 26 | # gardner_costas_cc.h 27 | # p25_frame_assembler.h 28 | # fsk4_demod_ff.h 29 | # fsk4_slicer_fb.h DESTINATION include/op25_repeater 30 | #) 31 | -------------------------------------------------------------------------------- /lib/op25_repeater/include/op25_repeater/CTestTestfile.cmake: -------------------------------------------------------------------------------- 1 | # CMake generated Testfile for 2 | # Source directory: /Users/luke/Programming/trunk-recorder/op25_repeater/include/op25_repeater 3 | # Build directory: /Users/luke/Programming/trunk-recorder/op25_repeater/include/op25_repeater 4 | # 5 | # This file includes the relevant testing commands required for 6 | # testing this directory and lists subdirectories to be tested as well. 7 | -------------------------------------------------------------------------------- /lib/op25_repeater/include/op25_repeater/api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * GNU Radio is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Radio is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with GNU Radio; see the file COPYING. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef INCLUDED_OP25_REPEATER_API_H 23 | #define INCLUDED_OP25_REPEATER_API_H 24 | 25 | #include 26 | 27 | #ifdef gnuradio_op25_repeater_EXPORTS 28 | # define OP25_REPEATER_API __GR_ATTR_EXPORT 29 | #else 30 | # define OP25_REPEATER_API __GR_ATTR_IMPORT 31 | #endif 32 | 33 | #endif /* INCLUDED_OP25_REPEATER_API_H */ 34 | -------------------------------------------------------------------------------- /lib/op25_repeater/include/op25_repeater/rx_status.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef RXSTATUS_H 3 | #define RXSTATUS_H 4 | #include 5 | struct Rx_Status{ 6 | double total_len; 7 | long error_count; 8 | long spike_count; 9 | time_t last_update; 10 | }; 11 | #endif 12 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/CCITTChecksumReverse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009,2011,2014 by Jonathan Naylor, G4KLX 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; version 2 of the License. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | */ 13 | 14 | #ifndef CCITTChecksumReverse_H 15 | #define CCITTChecksumReverse_H 16 | 17 | #include 18 | 19 | class CCCITTChecksumReverse { 20 | public: 21 | CCCITTChecksumReverse(); 22 | ~CCCITTChecksumReverse(); 23 | 24 | void update(const unsigned char* data, unsigned int length); 25 | 26 | void result(unsigned char* data); 27 | 28 | bool check(const unsigned char* data); 29 | 30 | void reset(); 31 | 32 | private: 33 | union { 34 | uint16_t m_crc16; 35 | uint8_t m_crc8[2U]; 36 | }; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/CTestTestfile.cmake: -------------------------------------------------------------------------------- 1 | # CMake generated Testfile for 2 | # Source directory: /Users/luke/Programming/trunk-recorder/op25_repeater/lib 3 | # Build directory: /Users/luke/Programming/trunk-recorder/op25_repeater/lib 4 | # 5 | # This file includes the relevant testing commands required for 6 | # testing this directory and lists subdirectories to be tested as well. 7 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/ambe.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_AMBE_H 2 | #define INCLUDED_AMBE_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | int mbe_dequantizeAmbe2250Parms (mbe_parms* cur_mp, mbe_parms* prev_mp, mbe_errs* errs, const int *b); 7 | int mbe_dequantizeAmbe2400Parms (mbe_parms* cur_mp, mbe_parms* prev_mp, mbe_errs* errs, const int *b); 8 | int mbe_dequantizeAmbeTone(mbe_tone* tone, mbe_errs* errs, const int *u); 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | #endif /* INCLUDED_AMBE_H */ 13 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/ambe_encoder.h: -------------------------------------------------------------------------------- 1 | // P25 TDMA Decoder (C) Copyright 2013, 2014 Max H. Parke KA1RBI 2 | // 3 | // This file is part of OP25 4 | // 5 | // OP25 is free software; you can redistribute it and/or modify it 6 | // under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 3, or (at your option) 8 | // any later version. 9 | // 10 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 11 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 13 | // License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with OP25; see the file COPYING. If not, write to the Free 17 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 18 | // 02110-1301, USA. 19 | 20 | #ifndef INCLUDED_AMBE_ENCODER_H 21 | #define INCLUDED_AMBE_ENCODER_H 22 | 23 | #include 24 | 25 | class ambe_encoder { 26 | public: 27 | void encode(int16_t samples[], uint8_t codeword[]); 28 | ambe_encoder(void); 29 | void set_49bit_mode(void); 30 | void set_dstar_mode(void); 31 | void set_gain_adjust(const float gain_adjust) {d_gain_adjust = gain_adjust;} 32 | void set_alt_dstar_interleave(const bool v) { d_alt_dstar_interleave = v; } 33 | private: 34 | imbe_vocoder vocoder; 35 | p25p2_vf interleaver; 36 | mbe_parms cur_mp; 37 | mbe_parms prev_mp; 38 | mbe_errs errs_mp; 39 | bool d_49bit_mode; 40 | bool d_dstar_mode; 41 | float d_gain_adjust; 42 | bool d_alt_dstar_interleave; 43 | }; 44 | 45 | #endif /* INCLUDED_AMBE_ENCODER_H */ 46 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/bch.h: -------------------------------------------------------------------------------- 1 | #include 2 | typedef std::vector bit_vector; 3 | int bchDec(bit_vector& Codeword); 4 | 5 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/ber1011.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) 2019, Graham J Norbury 3 | * gnorbury@bondcar.com 4 | * 5 | * Stand-alone utility to calculate bit error rate of a binary dibit capture file 6 | * containing APCO 1011Hz test tone sequence. 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "frame_sync_magics.h" 15 | 16 | static const int SYNC_SIZE = 48; // 48 bits 17 | static const unsigned int SYNC_THRESHOLD = 4; // 4 bit errors in sync allowed 18 | 19 | bool test_sync(uint64_t cw, int &sync, int &errs) 20 | { 21 | int popcnt = 0; 22 | popcnt = __builtin_popcountll(cw ^ P25_FRAME_SYNC_MAGIC); 23 | if (popcnt <= SYNC_THRESHOLD) 24 | { 25 | errs = popcnt; 26 | return true; 27 | } 28 | 29 | return false; 30 | } 31 | 32 | int main (int argc, char* argv[]) 33 | { 34 | uint64_t cw = 0; 35 | int sync = 0; 36 | int s_errs = 0; 37 | 38 | if (argc < 2) 39 | { 40 | fprintf(stderr, "Usage: ber1011 \n"); 41 | return 1; 42 | } 43 | 44 | char dibit; 45 | size_t fpos = 0; 46 | std::fstream file(argv[1], std::ios::in | std::ios::binary); 47 | while (!file.eof()) 48 | { 49 | file.read((&dibit), 1); 50 | fpos++; 51 | 52 | cw = ((cw << 1) + ((dibit >>1) & 0x1)) & 0xffffffffffff; 53 | if (test_sync(cw, sync, s_errs)) 54 | printf("Matched sync with %d errs at %lu bit 1\n", s_errs, fpos); 55 | 56 | cw = ((cw << 1) + (dibit & 0x1)) & 0xffffffffffff; 57 | if (test_sync(cw, sync, s_errs)) 58 | printf("Matched sync with %d errs at %lu bit 0\n", s_errs, fpos); 59 | 60 | } 61 | 62 | return 0; 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/bit_utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of OP25 3 | // 4 | // OP25 is free software; you can redistribute it and/or modify it 5 | // under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 3, or (at your option) 7 | // any later version. 8 | // 9 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 10 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 12 | // License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with OP25; see the file COPYING. If not, write to the Free 16 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 17 | // 02110-1301, USA. 18 | 19 | #ifndef INCLUDED_OP25_REPEATER_BIT_UTILS_H 20 | #define INCLUDED_OP25_REPEATER_BIT_UTILS_H 21 | 22 | #include 23 | 24 | static inline void store_i(int reg, uint8_t val[], int len) { 25 | for (int i=0; i> (len-1-i)) & 1; 27 | } 28 | } 29 | 30 | static inline int load_i(const uint8_t val[], int len) { 31 | int acc = 0; 32 | for (int i=0; i> 1) & 1; 49 | bits[i*2+1] = dibits[i] & 1; 50 | } 51 | } 52 | 53 | static inline void bits_to_dibits(uint8_t* dest, const uint8_t* src, int n_dibits) { 54 | for (int i=0; i 6 | 7 | static inline bool check_frame_sync(uint64_t x, int err_threshold, int len) { 8 | int errs=0; 9 | const uint64_t mask = (1LL<> 1) & m1; //put count of each 2 bits into those 2 bits 17 | x = (x & m2) + ((x >> 2) & m2); //put count of each 4 bits into those 4 bits 18 | x = (x + (x >> 4)) & m4; //put count of each 8 bits into those 8 bits 19 | errs = (x * h01) >> 56; //returns left 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ... 20 | if (errs <= err_threshold) return true; 21 | return false; 22 | } 23 | 24 | #endif /* INCLUDED_CHECK_FRAME_SYNC_H */ 25 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/ezpwd/definitions: -------------------------------------------------------------------------------- 1 | // 2 | // C++ Definitions -- include once in a single C++ compilation unit 3 | // 4 | #ifndef _EZPWD_DEFINITIONS 5 | #define _EZPWD_DEFINITIONS 6 | 7 | #include "serialize_definitions" 8 | 9 | #endif // _EZPWD_DEFINITIONS -------------------------------------------------------------------------------- /lib/op25_repeater/lib/golay2087.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 by Jonathan Naylor G4KLX 3 | * 4 | * Modifications of original code to work with OP25 5 | * Copyright (C) 2019 by Graham J. Norbury 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef Golay2087_H 23 | #define Golay2087_H 24 | 25 | #include 26 | 27 | typedef std::vector bit_vector; 28 | 29 | class CGolay2087 { 30 | public: 31 | static void encode(bit_vector& data); 32 | static unsigned int decode(bit_vector& data); 33 | 34 | private: 35 | static unsigned int getSyndrome1987(unsigned int pattern); 36 | }; 37 | 38 | class CQR1676 { 39 | public: 40 | static void encode(bit_vector& data); 41 | static unsigned char decode(bit_vector& data); 42 | 43 | private: 44 | static unsigned int getSyndrome1576(unsigned int pattern); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/hamming.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 3 | * 4 | * Modifications of original code to work with OP25 5 | * Copyright (C) 2019 by Graham J. Norbury 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef Hamming_H 23 | #define Hamming_H 24 | 25 | class CHamming { 26 | public: 27 | static void encode15113_1(bool* d); 28 | static bool decode15113_1(bool* d); 29 | 30 | static void encode15113_2(bool* d); 31 | static bool decode15113_2(bool* d); 32 | 33 | static void encode1393(bool* d); 34 | static bool decode1393(bool* d); 35 | 36 | static void encode1063(bool* d); 37 | static bool decode1063(bool* d); 38 | 39 | static void encode16114(bool* d); 40 | static bool decode16114(bool* d); 41 | 42 | static void encode17123(bool* d); 43 | static bool decode17123(bool* d); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_decoder.cc: -------------------------------------------------------------------------------- 1 | #include "imbe_decoder.h" 2 | 3 | imbe_decoder::~imbe_decoder() 4 | { 5 | } 6 | 7 | imbe_decoder::imbe_decoder() : 8 | d_audio() 9 | { 10 | } 11 | 12 | audio_samples* 13 | imbe_decoder::audio() 14 | { 15 | return &d_audio; 16 | } 17 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | 3 | SET( MORE_FLAGS "-fPIC") 4 | SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MORE_FLAGS}" ) 5 | 6 | #list(APPEND imbe_vocoder_sources 7 | list(APPEND op25_repeater_sources 8 | aux_sub.cc 9 | basicop2.cc 10 | ch_decode.cc 11 | ch_encode.cc 12 | dc_rmv.cc 13 | decode.cc 14 | dsp_sub.cc 15 | encode.cc 16 | imbe_vocoder.cc 17 | math_sub.cc 18 | pe_lpf.cc 19 | pitch_est.cc 20 | pitch_ref.cc 21 | qnt_sub.cc 22 | rand_gen.cc 23 | sa_decode.cc 24 | sa_encode.cc 25 | sa_enh.cc 26 | tbls.cc 27 | uv_synt.cc 28 | v_synt.cc 29 | v_uv_det.cc 30 | ) 31 | 32 | #add_library(imbe_vocoder SHARED ${imbe_vocoder_sources}) 33 | #set_target_properties(imbe_vocoder PROPERTIES ENABLE_EXPORTS 1) -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/CTestTestfile.cmake: -------------------------------------------------------------------------------- 1 | # CMake generated Testfile for 2 | # Source directory: /Users/luke/Programming/trunk-recorder/op25_repeater/lib/imbe_vocoder 3 | # Build directory: /Users/luke/Programming/trunk-recorder/op25_repeater/lib/imbe_vocoder 4 | # 5 | # This file includes the relevant testing commands required for 6 | # testing this directory and lists subdirectories to be tested as well. 7 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/ch_decode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _CH_DECODE 23 | #define _CH_DECODE 24 | 25 | #include "typedef.h" 26 | 27 | #define BIT_STREAM_LEN (3 + 3*12 + 3*11 + 3) 28 | 29 | void decode_frame_vector(IMBE_PARAM *imbe_param, Word16 *frame_vector); 30 | void v_uv_decode(IMBE_PARAM *imbe_param); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/ch_encode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _CH_ENCODE 24 | #define _CH_ENCODE 25 | 26 | #define EN_BIT_STREAM_LEN (3 + 3*12 + 6 + 2*11 + 3) 27 | 28 | 29 | void encode_frame_vector(IMBE_PARAM *imbe_param, Word16 *frame_vector); 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/dc_rmv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _DC_RMV 24 | #define _DC_RMV 25 | 26 | //----------------------------------------------------------------------------- 27 | // PURPOSE: 28 | // High-pass filter to remove DC 29 | // 30 | // 31 | // INPUT: 32 | // *sigin - pointer to input signal buffer 33 | // *sigout - pointer to output signal buffer 34 | // *mem - pointer to filter's memory element 35 | // len - number of input signal samples 36 | // 37 | // OUTPUT: 38 | // None 39 | // 40 | // RETURN: 41 | // Saved filter state in mem 42 | // 43 | //----------------------------------------------------------------------------- 44 | void dc_rmv(Word16 *sigin, Word16 *sigout, Word32 *mem, Word16 len); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/decode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _DECODE 24 | #define _DECODE 25 | #if 0 26 | void decode_init(IMBE_PARAM *imbe_param); 27 | void decode(IMBE_PARAM *imbe_param, Word16 *frame_vector, Word16 *snd); 28 | #endif 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/encode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _ENCODE 24 | #define _ENCODE 25 | 26 | #define PITCH_EST_BUF_SIZE 621 27 | #if 0 28 | void encode_init(void); 29 | void encode(IMBE_PARAM *imbe_param, Word16 *frame_vector, Word16 *snd); 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/pe_lpf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _PE_LPF 23 | #define _PE_LPF 24 | 25 | 26 | //----------------------------------------------------------------------------- 27 | // PURPOSE: 28 | // Low-pass filter for pitch estimator 29 | // 30 | // 31 | // INPUT: 32 | // *sigin - pointer to input signal buffer 33 | // *sigout - pointer to output signal buffer 34 | // *mem - pointer to filter's memory element 35 | // len - number of input signal samples 36 | // 37 | // OUTPUT: 38 | // None 39 | // 40 | // RETURN: 41 | // Saved filter state in mem 42 | // 43 | //----------------------------------------------------------------------------- 44 | void pe_lpf(Word16 *sigin, Word16 *sigout, Word16 *mem, Word16 len); 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/pitch_est.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _PITCH_EST 24 | #define _PITCH_EST 25 | 26 | void pitch_est_init(void); 27 | void pitch_est(IMBE_PARAM *imbe_param, Word16 *frames_buf); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/pitch_ref.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _PITCH_REF 24 | #define _PITCH_REF 25 | 26 | void pitch_ref(IMBE_PARAM *imbe_param, Cmplx16 *fft_buf); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/rand_gen.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | 24 | #include "typedef.h" 25 | #include "basic_op.h" 26 | 27 | static UWord32 seed = 1; 28 | 29 | 30 | //----------------------------------------------------------------------------- 31 | // PURPOSE: 32 | // Generate pseudo-random numbers in range -1...1 33 | // 34 | // 35 | // INPUT: 36 | // None 37 | // 38 | // OUTPUT: 39 | // None 40 | // 41 | // RETURN: 42 | // Pseudo-random number in signed Q1.16 format 43 | // 44 | //----------------------------------------------------------------------------- 45 | Word16 rand_gen(void) 46 | { 47 | UWord32 hi, lo; 48 | 49 | lo = 16807 * (seed & 0xFFFF); 50 | hi = 16807 * (seed >> 16); 51 | 52 | lo += (Word32)(hi & 0x7FFF) << 16; 53 | lo += (hi >> 15); 54 | 55 | if(lo > 0x7FFFFFFF) 56 | lo -= 0x7FFFFFFF; 57 | 58 | seed = lo; 59 | 60 | return (Word16)lo; 61 | } 62 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/rand_gen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _RAND_GEN 24 | #define _RAND_GEN 25 | 26 | 27 | //----------------------------------------------------------------------------- 28 | // PURPOSE: 29 | // Generate pseudo-random numbers in range -1...1 30 | // 31 | // 32 | // INPUT: 33 | // None 34 | // 35 | // OUTPUT: 36 | // None 37 | // 38 | // RETURN: 39 | // Pseudo-random number in signed Q1.16 format 40 | // 41 | //----------------------------------------------------------------------------- 42 | Word16 rand_gen(void); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/sa_encode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _SA_ENCODE 24 | #define _SA_ENCODE 25 | 26 | 27 | void sa_encode_init(void); 28 | void sa_encode(IMBE_PARAM *imbe_param); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/sa_enh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _SA_ENH 24 | #define _SA_ENH 25 | 26 | #define CNST_0_9898_Q1_15 0x7EB3 27 | #define CNST_0_5_Q2_14 0x2000 28 | #define CNST_1_2_Q2_14 0x4CCC 29 | 30 | 31 | //----------------------------------------------------------------------------- 32 | // PURPOSE: 33 | // Perform Spectral Amplitude Enhancement 34 | // 35 | // 36 | // INPUT: 37 | // IMBE_PARAM *imbe_param - pointer to IMBE_PARAM structure with 38 | // valid num_harms, sa and fund_freq items 39 | // 40 | // OUTPUT: 41 | // None 42 | // 43 | // RETURN: 44 | // Enhanced Spectral Amplitudes 45 | // 46 | //----------------------------------------------------------------------------- 47 | void sa_enh(IMBE_PARAM *imbe_param); 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/uv_synt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _UV_SYNT 23 | #define _UV_SYNT 24 | 25 | void uv_synt_init(void); 26 | void uv_synt(IMBE_PARAM *imbe_param, Word16 *snd); 27 | void fft(Word16 *datam1, Word16 nn, Word16 isign); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/v_synt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _V_SYNT 24 | #define _V_SYNT 25 | 26 | void v_synt_init(void); 27 | void v_synt(IMBE_PARAM *imbe_param, Word16 *snd); 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/imbe_vocoder/v_uv_det.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project 25 IMBE Encoder/Decoder Fixed-Point implementation 3 | * Developed by Pavel Yazev E-mail: pyazev@gmail.com 4 | * Version 1.0 (c) Copyright 2009 5 | * 6 | * This is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * The software is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this; see the file COPYING. If not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | * 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef _V_UV_DET 24 | #define _V_UV_DET 25 | 26 | void v_uv_det(IMBE_PARAM *imbe_param, Cmplx16 *fft_buf); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/op25_p25_frame.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_OP25_P25_FRAME_H 2 | #define INCLUDED_OP25_P25_FRAME_H 1 3 | 4 | #include "frame_sync_magics.h" 5 | 6 | static const size_t P25_VOICE_FRAME_SIZE = 1728; 7 | static const size_t P25_HEADER_SYMBOLS = 24 + 32 + 1; 8 | static const size_t P25_HEADER_BITS = P25_HEADER_SYMBOLS * 2; 9 | 10 | /* Given a 64-bit frame header word and a frame body which is to be initialized 11 | * 1. Place flags at beginning of frame body 12 | * 2. Store 64-bit frame header word 13 | * 3. FIXME Place first status symbol 14 | */ 15 | static inline void 16 | p25_setup_frame_header(bit_vector& frame_body, uint64_t hw) { 17 | uint64_t acc = P25_FRAME_SYNC_MAGIC; 18 | for (int i=47; i>=0; i--) { 19 | frame_body[ i ] = acc & 1; 20 | acc >>= 1; 21 | } 22 | acc = hw; 23 | for (int i=113; i>=72; i--) { 24 | frame_body[ i ] = acc & 1; 25 | acc >>= 1; 26 | } 27 | // FIXME: insert proper status dibit bits at 70, 71 28 | frame_body[70] = 1; 29 | frame_body[71] = 0; 30 | for (int i=69; i>=48; i--) { 31 | frame_body[ i ] = acc & 1; 32 | acc >>= 1; 33 | } 34 | } 35 | 36 | #endif /* INCLUDED_OP25_P25_FRAME_H */ 37 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/op25_timer.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Microsecond timer 3 | // (C) Copyright 2019 Graham J. Norbury 4 | // 5 | // This file is part of OP25 6 | // 7 | // OP25 is free software; you can redistribute it and/or modify it 8 | // under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation; either version 3, or (at your option) 10 | // any later version. 11 | // 12 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 13 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 15 | // License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with OP25; see the file COPYING. If not, write to the Free 19 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 20 | // 02110-1301, USA. 21 | 22 | #include "op25_timer.h" 23 | 24 | op25_timer::op25_timer(uint64_t duration) : 25 | d_duration(duration) 26 | { 27 | reset(); 28 | } 29 | 30 | op25_timer::~op25_timer() 31 | { 32 | } 33 | 34 | void 35 | op25_timer::reset() 36 | { 37 | gettimeofday(&d_timer, 0); 38 | } 39 | 40 | bool 41 | op25_timer::expired() 42 | { 43 | struct timeval cur_time; 44 | gettimeofday(&cur_time, 0); 45 | 46 | int64_t diff_usec = cur_time.tv_usec - d_timer.tv_usec; 47 | int64_t diff_sec = cur_time.tv_sec - d_timer.tv_sec ; 48 | 49 | if (diff_usec < 0) { 50 | diff_usec += 1000000; 51 | diff_sec -= 1; 52 | } 53 | diff_usec += diff_sec * 1000000; 54 | if ((uint64_t)diff_usec >= d_duration) 55 | return true; 56 | 57 | return false; 58 | } 59 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/op25_timer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Microsecond timer 3 | // (C) Copyright 2019 Graham J. Norbury 4 | // 5 | // This file is part of OP25 6 | // 7 | // OP25 is free software; you can redistribute it and/or modify it 8 | // under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation; either version 3, or (at your option) 10 | // any later version. 11 | // 12 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 13 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 15 | // License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with OP25; see the file COPYING. If not, write to the Free 19 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 20 | // 02110-1301, USA. 21 | 22 | #ifndef INCLUDED_OP25_TIMER_H 23 | #define INCLUDED_OP25_TIMER_H 24 | 25 | #include 26 | #include 27 | 28 | class op25_timer { 29 | public: 30 | op25_timer(const uint64_t duration); 31 | ~op25_timer(); 32 | void reset(); 33 | bool expired(); 34 | 35 | private: 36 | struct timeval d_timer; 37 | uint64_t d_duration; 38 | }; 39 | 40 | #endif /* INCLUDED_OP25_TIMER_H */ 41 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/p25_framer.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | 3 | /* 4 | * construct P25 frames out of raw dibits 5 | * Copyright 2010, KA1RBI 6 | * Copyright 2020, Graham J. Norbury 7 | * 8 | * usage: after constructing, call rx_sym once per received dibit. 9 | * frame fields are available for inspection when true is returned 10 | */ 11 | 12 | #ifndef INCLUDED_P25_FRAMER_H 13 | #define INCLUDED_P25_FRAMER_H 14 | 15 | #include "log_ts.h" 16 | 17 | class p25_framer 18 | { 19 | private: 20 | typedef std::vector bit_vector; 21 | // internal functions 22 | bool nid_codeword(uint64_t acc); 23 | // internal instance variables and state 24 | int nid_syms; 25 | uint32_t next_bit; 26 | uint64_t nid_accum; 27 | 28 | uint32_t frame_size_limit; 29 | int d_debug; 30 | int d_msgq_id; 31 | uint32_t d_expected_nac; 32 | int d_unexpected_nac; 33 | log_ts& logts; 34 | 35 | public: 36 | p25_framer(log_ts& logger, int debug = 0, int msgq_id = 0); 37 | ~p25_framer (); // destructor 38 | void set_nac(uint32_t nac) { d_expected_nac = nac; } 39 | void set_debug(int debug) { d_debug = debug; } 40 | bool rx_sym(uint8_t dibit) ; 41 | uint32_t load_nid(const uint8_t *syms, int nsyms, const uint64_t fs); 42 | bool load_body(const uint8_t * syms, int nsyms); 43 | 44 | uint32_t symbols_received; 45 | 46 | // info from received frame 47 | uint64_t nid_word; // received NID word 48 | uint32_t nac; // extracted NAC 49 | uint32_t duid; // extracted DUID 50 | uint8_t parity; // extracted DUID parity 51 | bit_vector frame_body; // all bits in frame 52 | uint32_t frame_size; // number of bits in frame_body 53 | uint32_t bch_errors; // number of errors detected in bch 54 | }; 55 | 56 | #endif /* INCLUDED_P25_FRAMER_H */ 57 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/p25p2_duid.h: -------------------------------------------------------------------------------- 1 | 2 | // P25 TDMA Decoder (C) Copyright 2013, 2014 Max H. Parke KA1RBI 3 | // 4 | // This file is part of OP25 5 | // 6 | // OP25 is free software; you can redistribute it and/or modify it 7 | // under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 3, or (at your option) 9 | // any later version. 10 | // 11 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 12 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 14 | // License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with OP25; see the file COPYING. If not, write to the Free 18 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | // 02110-1301, USA. 20 | 21 | #ifndef INCLUDED_P25P2_DUID_H 22 | #define INCLUDED_P25P2_DUID_H 23 | 24 | #include 25 | 26 | /* static const char* duid_strings[] = { 27 | "4v", 28 | "?1", 29 | "?2", 30 | "sacch w", 31 | "?4", 32 | "?5", 33 | "2v", 34 | "?7", 35 | "?8", 36 | "facch w", 37 | "?10", 38 | "?11" 39 | "sacch w/o", 40 | "?13", 41 | "?14" 42 | "facch w/o" 43 | }; */ 44 | 45 | class p25p2_duid; 46 | class p25p2_duid 47 | { 48 | public: 49 | p25p2_duid(); // constructor 50 | int16_t duid_lookup(const uint8_t codeword); 51 | uint8_t extract_duid(const uint8_t dibits[]); 52 | private: 53 | }; 54 | #endif /* INCLUDED_P25P2_DUID_H */ 55 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/p25p2_framer.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | 3 | /* 4 | * construct P25 P2 TDMA frames out of raw dibits 5 | * Copyright 2014, Max H. Parke KA1RBI 6 | * 7 | * usage: after constructing, call rx_sym once per received dibit. 8 | * frame available when true is returned 9 | */ 10 | 11 | #ifndef INCLUDED_P25P2_FRAMER_H 12 | #define INCLUDED_P25P2_FRAMER_H 13 | 14 | #include "frame_sync_magics.h" 15 | 16 | static const unsigned int P25P2_BURST_SIZE=360; /* in bits */ 17 | 18 | class p25p2_framer; 19 | 20 | class p25p2_framer 21 | { 22 | private: 23 | typedef std::vector bit_vector; 24 | // internal instance variables and state 25 | uint32_t d_next_bit; 26 | uint32_t d_in_sync; 27 | uint64_t d_fs; 28 | uint64_t nid_accum; 29 | 30 | public: 31 | p25p2_framer(); // constructor 32 | ~p25p2_framer (); // destructor 33 | bool rx_sym(uint8_t dibit) ; 34 | uint64_t get_fs() { return d_fs; } 35 | 36 | uint32_t symbols_received; 37 | 38 | bit_vector d_frame_body; // all bits in frame 39 | }; 40 | 41 | #endif /* INCLUDED_P25P2_FRAMER_H */ 42 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/p25p2_isch.h: -------------------------------------------------------------------------------- 1 | 2 | // P25 TDMA Decoder (C) Copyright 2013, 2014 Max H. Parke KA1RBI 3 | // 4 | // This file is part of OP25 5 | // 6 | // OP25 is free software; you can redistribute it and/or modify it 7 | // under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 3, or (at your option) 9 | // any later version. 10 | // 11 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 12 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 14 | // License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with OP25; see the file COPYING. If not, write to the Free 18 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 19 | // 02110-1301, USA. 20 | 21 | #ifndef INCLUDED_P25P2_ISCH_H 22 | #define INCLUDED_P25P2_ISCH_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | class p25p2_isch; 29 | class p25p2_isch 30 | { 31 | public: 32 | p25p2_isch(); // constructor 33 | int16_t isch_lookup(uint64_t cw); 34 | int16_t isch_lookup(const uint8_t dibits[]); 35 | private: 36 | std::map isch_map; 37 | }; 38 | #endif /* INCLUDED_P25P2_ISCH_H */ 39 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/p25p2_sync.h: -------------------------------------------------------------------------------- 1 | // P25 TDMA Decoder (C) Copyright 2013, 2014 Max H. Parke KA1RBI 2 | // 3 | // This file is part of OP25 4 | // 5 | // OP25 is free software; you can redistribute it and/or modify it 6 | // under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 3, or (at your option) 8 | // any later version. 9 | // 10 | // OP25 is distributed in the hope that it will be useful, but WITHOUT 11 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 | // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 13 | // License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with OP25; see the file COPYING. If not, write to the Free 17 | // Software Foundation, Inc., 51 Franklin Street, Boston, MA 18 | // 02110-1301, USA. 19 | 20 | #ifndef INCLUDED_P25P2_SYNC_H 21 | #define INCLUDED_P25P2_SYNC_H 22 | 23 | #include 24 | #include "p25p2_isch.h" 25 | 26 | class p25p2_sync; 27 | class p25p2_sync 28 | { 29 | public: 30 | p25p2_sync(); // constructor 31 | p25p2_isch isch; 32 | void check_confidence (const uint8_t dibits[]); 33 | bool in_sync(void); 34 | uint32_t tdma_slotid(void) { return _tdma_slotid; } 35 | int last_rc(void) { return d_last_rc; } 36 | private: 37 | int32_t sync_confidence; 38 | uint32_t _tdma_slotid; 39 | uint32_t packets; 40 | int d_last_rc; 41 | }; 42 | #endif /* INCLUDED_P25P2_SYNC_H */ 43 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/qa_op25_repeater.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * GNU Radio is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Radio is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with GNU Radio; see the file COPYING. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | /* 23 | * This class gathers together all the test cases for the gr-filter 24 | * directory into a single test suite. As you create new test cases, 25 | * add them here. 26 | */ 27 | 28 | #include "qa_op25_repeater.h" 29 | 30 | CppUnit::TestSuite * 31 | qa_op25_repeater::suite() 32 | { 33 | CppUnit::TestSuite *s = new CppUnit::TestSuite("op25_repeater"); 34 | 35 | return s; 36 | } 37 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/qa_op25_repeater.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2012 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef _QA_OP25_REPEATER_H_ 24 | #define _QA_OP25_REPEATER_H_ 25 | 26 | #include 27 | #include 28 | 29 | //! collect all the tests for the gr-filter directory 30 | 31 | class __GR_ATTR_EXPORT qa_op25_repeater 32 | { 33 | public: 34 | //! return suite of tests for all of gr-filter directory 35 | static CppUnit::TestSuite *suite(); 36 | }; 37 | 38 | #endif /* _QA_OP25_REPEATER_H_ */ 39 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/rs.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef INCLUDED_OP25_RS_H 3 | #define INCLUDED_OP25_RS_H 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | uint32_t gly24128Dec (uint32_t n, size_t* errs = NULL) ; 11 | uint32_t gly23127Dec (uint32_t n, size_t* errs = NULL) ; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/test_op25_repeater.cc: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2012 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifdef HAVE_CONFIG_H 24 | #include "config.h" 25 | #endif 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | #include "qa_op25_repeater.h" 32 | #include 33 | 34 | int 35 | main (int argc, char **argv) 36 | { 37 | CppUnit::TextTestRunner runner; 38 | std::ofstream xmlfile(get_unittest_path("op25_repeater.xml").c_str()); 39 | CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); 40 | 41 | runner.addTest(qa_op25_repeater::suite()); 42 | runner.setOutputter(xmlout); 43 | 44 | bool was_successful = runner.run("", false); 45 | 46 | return was_successful ? 0 : 1; 47 | } 48 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/test_op25_repeater_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export VOLK_GENERIC=1 3 | export GR_DONT_LOAD_PREFS=1 4 | export srcdir=/Users/luke/Programming/trunk-recorder/op25_repeater/lib 5 | export GR_CONF_CONTROLPORT_ON=False 6 | export PATH=/Users/luke/Programming/trunk-recorder/op25_repeater/lib:$PATH 7 | export DYLD_LIBRARY_PATH=/Users/luke/Programming/trunk-recorder/op25_repeater/lib:$DYLD_LIBRARY_PATH 8 | export PYTHONPATH=$PYTHONPATH 9 | test-op25_repeater 10 | -------------------------------------------------------------------------------- /lib/op25_repeater/lib/trellis.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 by Jonathan Naylor, G4KLX 3 | * 4 | * Modifications of original code to work with OP25 5 | * Copyright (C) 2019 by Graham J. Norbury 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; version 2 of the License. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | */ 16 | 17 | #ifndef DMRTrellis_H 18 | #define DMRTrellis_H 19 | 20 | class CDMRTrellis { 21 | public: 22 | CDMRTrellis(); 23 | ~CDMRTrellis(); 24 | 25 | bool decode(const unsigned char* data, unsigned char* payload); 26 | 27 | private: 28 | void deinterleave(const unsigned char* in, signed char* dibits) const; 29 | void dibitsToPoints(const signed char* dibits, unsigned char* points) const; 30 | void pointsToDibits(const unsigned char* points, signed char* dibits) const; 31 | void bitsToTribits(const unsigned char* payload, unsigned char* tribits) const; 32 | void tribitsToBits(const unsigned char* tribits, unsigned char* payload) const; 33 | bool fixCode(unsigned char* points, unsigned int failPos, unsigned char* payload) const; 34 | unsigned int checkCode(const unsigned char* points, unsigned char* tribits) const; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /plugins/broadcastify_uploader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(broadcastify_uploader 2 | MODULE 3 | broadcastify_uploader.cc 4 | ) 5 | 6 | target_link_libraries(broadcastify_uploader trunk_recorder_library ssl crypto ${CURL_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES} ${LIBOP25_REPEATER_LIBRARIES} gnuradio-op25_repeater) # gRPC::grpc++_reflection protobuf::libprotobuf) 7 | 8 | if(NOT Gnuradio_VERSION VERSION_LESS "3.8") 9 | 10 | target_link_libraries(broadcastify_uploader 11 | gnuradio::gnuradio-analog 12 | gnuradio::gnuradio-blocks 13 | gnuradio::gnuradio-digital 14 | gnuradio::gnuradio-filter 15 | gnuradio::gnuradio-pmt 16 | ) 17 | 18 | endif() 19 | 20 | install(TARGETS broadcastify_uploader LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/trunk-recorder) -------------------------------------------------------------------------------- /plugins/openmhz_uploader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(openmhz_uploader 2 | MODULE 3 | openmhz_uploader.cc 4 | ) 5 | 6 | target_link_libraries(openmhz_uploader trunk_recorder_library ssl crypto ${CURL_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES} ${LIBOP25_REPEATER_LIBRARIES} gnuradio-op25_repeater ) # gRPC::grpc++_reflection protobuf::libprotobuf) 7 | 8 | if(NOT Gnuradio_VERSION VERSION_LESS "3.8") 9 | 10 | target_link_libraries(openmhz_uploader 11 | gnuradio::gnuradio-analog 12 | gnuradio::gnuradio-blocks 13 | gnuradio::gnuradio-digital 14 | gnuradio::gnuradio-filter 15 | gnuradio::gnuradio-pmt 16 | ) 17 | 18 | endif() 19 | 20 | install(TARGETS openmhz_uploader LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/trunk-recorder) -------------------------------------------------------------------------------- /plugins/rdioscanner_uploader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(rdioscanner_uploader 2 | MODULE 3 | rdioscanner_uploader.cc 4 | ) 5 | 6 | target_link_libraries(rdioscanner_uploader trunk_recorder_library ssl crypto ${CURL_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES} ${LIBOP25_REPEATER_LIBRARIES} gnuradio-op25_repeater ) # gRPC::grpc++_reflection protobuf::libprotobuf) 7 | 8 | if(NOT Gnuradio_VERSION VERSION_LESS "3.8") 9 | 10 | target_link_libraries(rdioscanner_uploader 11 | gnuradio::gnuradio-analog 12 | gnuradio::gnuradio-blocks 13 | gnuradio::gnuradio-digital 14 | gnuradio::gnuradio-filter 15 | gnuradio::gnuradio-pmt 16 | ) 17 | 18 | endif() 19 | 20 | install(TARGETS rdioscanner_uploader LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/trunk-recorder) -------------------------------------------------------------------------------- /plugins/simplestream/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(simplestream 2 | MODULE 3 | simplestream.cc 4 | ) 5 | 6 | target_link_libraries(simplestream trunk_recorder_library ssl crypto ${CURL_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES} ${LIBOP25_REPEATER_LIBRARIES} gnuradio-op25_repeater) # gRPC::grpc++_reflection protobuf::libprotobuf) 7 | 8 | if(NOT Gnuradio_VERSION VERSION_LESS "3.8") 9 | 10 | target_link_libraries(simplestream 11 | gnuradio::gnuradio-analog 12 | gnuradio::gnuradio-blocks 13 | gnuradio::gnuradio-digital 14 | gnuradio::gnuradio-filter 15 | gnuradio::gnuradio-pmt 16 | ) 17 | 18 | endif() 19 | 20 | install(TARGETS simplestream LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/trunk-recorder) -------------------------------------------------------------------------------- /plugins/stat_socket/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(stat_socket 2 | MODULE 3 | stat_socket.cc 4 | ) 5 | 6 | target_link_libraries(stat_socket trunk_recorder_library ssl crypto ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES} ${LIBOP25_REPEATER_LIBRARIES} gnuradio-op25_repeater) # gRPC::grpc++_reflection protobuf::libprotobuf) 7 | 8 | if(NOT Gnuradio_VERSION VERSION_LESS "3.8") 9 | 10 | target_link_libraries(stat_socket 11 | gnuradio::gnuradio-analog 12 | gnuradio::gnuradio-blocks 13 | gnuradio::gnuradio-digital 14 | gnuradio::gnuradio-filter 15 | gnuradio::gnuradio-pmt 16 | ) 17 | 18 | endif() 19 | 20 | install(TARGETS stat_socket LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/trunk-recorder) 21 | 22 | -------------------------------------------------------------------------------- /plugins/streamer/StreamerClient.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAMERCLIENT_H 2 | #define STREAMERCLIENT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include "streamer.grpc.pb.h" 11 | #include "streamer.pb.h" 12 | 13 | class StreamerClient { 14 | public: 15 | StreamerClient(); 16 | 17 | void Init(std::shared_ptr<::grpc::Channel> channel, bool enable_audio_streams); 18 | void Done(); 19 | 20 | void SendAudio(const ::streamer::AudioSample& request); 21 | void SendSignal(const ::streamer::SignalInfo& request); 22 | void CallStarted(const ::streamer::CallInfo& request); 23 | void CallEnded(const ::streamer::CallInfo& request); 24 | void SetupRecorder(const ::streamer::RecorderInfo& request); 25 | void SetupSystem(const ::streamer::SystemInfo& request); 26 | void SetupSource(const ::streamer::SourceInfo& request); 27 | void SetupConfig(const ::streamer::ConfigInfo& request); 28 | 29 | private: 30 | bool m_enable_audio_streams; 31 | std::unique_ptr< ::streamer::TrunkRecorderStreamer::Stub> stub_; 32 | std::unique_ptr< ::grpc::ClientWriter< ::streamer::SignalInfo>> signal_writer_; 33 | std::unique_ptr< ::grpc::ClientWriter< ::streamer::AudioSample>> audio_writer_; 34 | ::grpc::ClientContext signal_context_; 35 | ::grpc::ClientContext audio_context_; 36 | ::google::protobuf::Empty signal_response_; 37 | ::google::protobuf::Empty audio_response_; 38 | }; 39 | 40 | #endif // STREAMERCLIENT_H -------------------------------------------------------------------------------- /plugins/streamer/generate_protos.sh: -------------------------------------------------------------------------------- 1 | protoc -I . --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` streamer.proto 2 | protoc -I . --cpp_out=. streamer.proto 3 | -------------------------------------------------------------------------------- /plugins/streamer/streamer_client_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAMER_CLIENT_IMPL_H 2 | #define STREAMER_CLIENT_IMPL_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "../trunk-recorder/plugin_manager/plugin_common.h" 8 | #include "StreamerClient.h" 9 | 10 | typedef struct streamer_client_plugin_t streamer_client_plugin_t; 11 | 12 | struct streamer_client_plugin_t { 13 | bool enable_audio_streaming; 14 | std::string server_addr; 15 | StreamerClient client; 16 | }; 17 | 18 | #endif // STREAMER_CLIENT_IMPL_H -------------------------------------------------------------------------------- /plugins/streamer/streamer_proto_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAMER_PROTO_HELPER_H 2 | #define STREAMER_PROTO_HELPER_H 3 | 4 | #include "streamer.pb.h" 5 | #include "../../call.h" 6 | #include "../../recorders/recorder.h" 7 | #include "../../systems/system.h" 8 | #include "../../source.h" 9 | 10 | streamer::AudioSample* ToAudioSample(Recorder *recorder, float *samples, int sampleCount); 11 | streamer::CallInfo* ToCallInfo(Call *call); 12 | streamer::SystemInfo* ToSystemInfo(System *system); 13 | streamer::SourceInfo* ToSourceInfo(Source *source); 14 | streamer::RecorderInfo* ToRecorderInfo(Recorder *recorder); 15 | streamer::SignalInfo* ToSignalInfo(long unitId, const char *signaling_type, gr::blocks::SignalType sig_type, Call *call, System *system, Recorder *recorder); 16 | 17 | #endif // STREAMER_PROTO_HELPER_H -------------------------------------------------------------------------------- /plugins/unit_script/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(unit_script 2 | MODULE 3 | unit_script.cc 4 | ) 5 | 6 | target_link_libraries(unit_script trunk_recorder_library ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES} ${LIBOP25_REPEATER_LIBRARIES} gnuradio-op25_repeater) 7 | 8 | if(NOT Gnuradio_VERSION VERSION_LESS "3.8") 9 | 10 | target_link_libraries(unit_script 11 | gnuradio::gnuradio-analog 12 | gnuradio::gnuradio-blocks 13 | gnuradio::gnuradio-digital 14 | gnuradio::gnuradio-filter 15 | gnuradio::gnuradio-pmt 16 | ) 17 | 18 | endif() 19 | 20 | install(TARGETS unit_script LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/trunk-recorder) -------------------------------------------------------------------------------- /plugins/unit_script/example-unit-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #README: unit-script.txt 4 | 5 | CAPTUREDIR="" 6 | 7 | printf -v TRDATE '%(%Y/%-m/%-d)T' 8 | printf -v NOWTIME '%(%s)T' 9 | if [ ! "$3" == "ackresp" ]; then 10 | sed -i -e '/^'${2}',.*/{s//'${2}','${NOWTIME}','${3}','${4}',/;:a;n;ba;q}' -e '$a'${2}','${NOWTIME}','${3}','${4}',' $CAPTUREDIR/$1/radiolist.csv 11 | else 12 | sed -i -e '/^'${2}',\([0-9]*\),ackresp,,/{s//'${2}','${NOWTIME}',ackresp,,/;:a;n;ba;q}' -e '/^'${2}',\([0-9]*\),\([a-z]*\),\([0-9]*\),\([0-9]*\)/{s//'${2}',\1,\2,\3,'${NOWTIME}'/;:a;n;ba;q}' -e '$a'${2}','${NOWTIME}',ackresp,,' $CAPTUREDIR/$1/radiolist.csv 13 | fi 14 | echo "$2,$NOWTIME,$3,$4" >> $CAPTUREDIR/$1/$TRDATE/radiolog.csv 15 | -------------------------------------------------------------------------------- /plugins/unit_script/unit-script.md: -------------------------------------------------------------------------------- 1 | # unit-script.h 2 | 3 | Creates a list of radio IDs in a file named "radiolist.csv" located in the 4 | shortName directory along side the recordings, and logs radio activity to 5 | "radiolog.csv" files located in each day's recordings directory 6 | 7 | Make sure to fill in the CAPTUREDIR="" line with the path used in config.json, no ending / 8 | 9 | file format: radioID,timestamp,action,talkgroup, 10 | for radiolist.csv, acknowledgment response timestamps are added at the end 11 | when they are seen after a different action 12 | 13 | Feel free to customize the script; to use for multiple systems, include in 14 | each system's config.json section 15 | 16 | NOTE: You need to run "echo > radiolist.csv" where the file(s) is going to be 17 | beforehand as sed doesn't work on empty files, and to capture actions before 18 | trunk-recorder makes the daily directory upon recording the first call, set 19 | up a cron task of: 0 0 * * * mkdir -p /$(date +\%Y/\%-m/\%-d/) 20 | 21 | sed usage based on https://stackoverflow.com/a/49852337 22 | -------------------------------------------------------------------------------- /tests/mqtt/README.md: -------------------------------------------------------------------------------- 1 | # Testing out the MQTT Plugins 2 | 3 | This test walks through the steps for setting up both MQTT plugins and running them locally. 4 | 5 | ## Setup 6 | 7 | - Install the [MQTT Status Plugin](https://github.com/robotastic/trunk-recorder-mqtt-status) & [MQTT Statistics Plugin](https://github.com/robotastic/trunk-recorder-mqtt-statistics) 8 | 9 | - Starting Mosquitto on a Mac: 10 | ```bash 11 | /opt/homebrew/sbin/mosquitto -c /opt/homebrew/etc/mosquitto/mosquitto.conf -v 12 | ``` 13 | 14 | - Connect an RTL-SDR to the testing computer. 15 | 16 | ## Testing 17 | 18 | Run: 19 | `trunk-recorder` -------------------------------------------------------------------------------- /tests/mqtt/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ver": 2, 3 | 4 | "sources": [{ 5 | "center": 855700000, 6 | "rate": 2048000, 7 | "error": -300, 8 | "gain": 42, 9 | "digitalRecorders": 4, 10 | "driver": "osmosdr" 11 | } 12 | ], 13 | "systems": [{ 14 | "control_channels": [855462500], 15 | "type": "p25", 16 | "shortName": "dcfems", 17 | "modulation": "qpsk" 18 | }], 19 | "plugins": [ 20 | { 21 | "name": "MQTT Status", 22 | "library": "libmqtt_status_plugin.so", 23 | "broker": "tcp://localhost:1883", 24 | "topic": "robotastic/status" 25 | }, 26 | { 27 | "name": "MQTT Statistics", 28 | "library": "libmqtt_statistics_plugin.so", 29 | "broker": "tcp://localhost:1883", 30 | "topic": "robotastic/statistics" 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /trunk-recorder/call_concluder/call_concluder.h: -------------------------------------------------------------------------------- 1 | #ifndef CALL_CONCLUDER_H 2 | #define CALL_CONCLUDER_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "../call.h" 13 | #include "../formatter.h" 14 | #include "../global_structs.h" 15 | #include "../systems/system.h" 16 | #include "../systems/system_impl.h" 17 | 18 | Call_Data_t upload_call_worker(Call_Data_t call_info); 19 | 20 | class Call_Concluder { 21 | 22 | public: 23 | static const int MAX_RETRY; 24 | static std::list retry_call_list; 25 | static std::list> call_data_workers; 26 | 27 | static Call_Data_t create_call_data(Call *call, System *sys, Config config); 28 | static void conclude_call(Call *call, System *sys, Config config); 29 | static void manage_call_data_workers(); 30 | 31 | private: 32 | static Call_Data_t create_base_filename(Call *call, Call_Data_t call_info); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /trunk-recorder/call_conventional.cc: -------------------------------------------------------------------------------- 1 | 2 | #include "call_conventional.h" 3 | #include "formatter.h" 4 | #include "recorders/recorder.h" 5 | #include 6 | 7 | Call_conventional::Call_conventional(long t, double f, System *s, Config c, double squelch_db, bool signal_detection) : Call_impl(t, f, s, c) { 8 | this->squelch_db = squelch_db; 9 | this->signal_detection = signal_detection; 10 | BOOST_LOG_TRIVIAL(info) << "[" << sys->get_short_name() << "]\tFreq: " << format_freq(f) << "\tSquelch: " << squelch_db << " dB\tSignal Detection: " << signal_detection; 11 | } 12 | 13 | void Call_conventional::restart_call() { 14 | call_num = call_counter++; 15 | idle_count = 0; 16 | signal = DB_UNSET; 17 | noise = DB_UNSET; 18 | curr_src_id = -1; 19 | start_time = time(NULL); 20 | stop_time = time(NULL); 21 | last_update = time(NULL); 22 | state = RECORDING; 23 | debug_recording = false; 24 | phase2_tdma = false; 25 | tdma_slot = 0; 26 | encrypted = false; 27 | emergency = false; 28 | this->update_talkgroup_display(); 29 | recorder->start(this); 30 | } 31 | 32 | time_t Call_conventional::get_start_time() { 33 | // Fixes https://github.com/robotastic/trunk-recorder/issues/103#issuecomment-284825841 34 | return start_time = stop_time - final_length; 35 | } 36 | 37 | void Call_conventional::set_recorder(Recorder *r) { 38 | recorder = r; 39 | BOOST_LOG_TRIVIAL(info) << "[" << sys->get_short_name() << "]\tTG: " << this->get_talkgroup_display() << "\tFreq: " << format_freq(this->get_freq()); 40 | } 41 | 42 | void Call_conventional::recording_started() { 43 | start_time = time(NULL); 44 | } 45 | 46 | double Call_conventional::get_squelch_db() { 47 | return squelch_db; 48 | } 49 | 50 | bool Call_conventional::get_signal_detection() { 51 | return signal_detection; 52 | } -------------------------------------------------------------------------------- /trunk-recorder/call_conventional.h: -------------------------------------------------------------------------------- 1 | #ifndef CALL_CONVENTIONAL_H 2 | #define CALL_CONVENTIONAL_H 3 | #include "global_structs.h" 4 | class System; 5 | class Recorder; 6 | 7 | #include "call.h" 8 | #include "call_impl.h" 9 | #include 10 | 11 | class Call_conventional : public Call_impl { 12 | public: 13 | Call_conventional(long t, double f, System *s, Config c, double squelch_db, bool signal_detection); 14 | time_t get_start_time(); 15 | bool is_conventional() { return true; } 16 | void restart_call(); 17 | void set_recorder(Recorder *r); 18 | void recording_started(); 19 | double get_squelch_db(); 20 | bool get_signal_detection(); 21 | private: 22 | double squelch_db; 23 | bool signal_detection; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /trunk-recorder/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #include "cmake.h" 27 | #include "git.h" 28 | 29 | #include "./global_structs.h" 30 | #include "plugin_manager/plugin_manager.h" 31 | #include "source.h" 32 | #include "systems/system.h" 33 | 34 | #include 35 | 36 | bool load_config(std::string config_file, Config &config, gr::top_block_sptr &tb, std::vector &sources, std::vector &systems); 37 | 38 | #endif -------------------------------------------------------------------------------- /trunk-recorder/csv_helper.cc: -------------------------------------------------------------------------------- 1 | #include "csv_helper.h" 2 | 3 | // Retrieved from 4 | // https://stackoverflow.com/questions/6089231/getting-std-ifstream-to-handle-lf-cr-and-crlf 5 | std::istream &safeGetline(std::istream &is, std::string &t) { 6 | t.clear(); 7 | 8 | // The characters in the stream are read one-by-one using a std::streambuf. 9 | // That is faster than reading them one-by-one using the std::istream. 10 | // Code that uses streambuf this way must be guarded by a sentry object. 11 | // The sentry object performs various tasks, 12 | // such as thread synchronization and updating the stream state. 13 | 14 | std::istream::sentry se(is, true); 15 | std::streambuf *sb = is.rdbuf(); 16 | 17 | for (;;) { 18 | int c = sb->sbumpc(); 19 | 20 | switch (c) { 21 | case '\n': 22 | return is; 23 | 24 | case '\r': 25 | 26 | if (sb->sgetc() == '\n') 27 | sb->sbumpc(); 28 | return is; 29 | 30 | case EOF: 31 | 32 | // Also handle the case when the last line has no line ending 33 | if (t.empty()) 34 | is.setstate(std::ios::eofbit); 35 | return is; 36 | 37 | default: 38 | t += (char)c; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /trunk-recorder/csv_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef _CSV_HELPER_H_ 2 | #define _CSV_HELPER_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | std::istream &safeGetline(std::istream &is, std::string &t); 17 | 18 | #endif // _CSV_HELPER_H_ -------------------------------------------------------------------------------- /trunk-recorder/formatter.h: -------------------------------------------------------------------------------- 1 | #ifndef FORMATTER_H 2 | #define FORMATTER_H 3 | 4 | #include "state.h" 5 | #include 6 | #include 7 | 8 | extern boost::format format_freq(double f); 9 | extern boost::format FormatSamplingRate(float f); 10 | extern boost::format format_time(float f); 11 | extern std::string format_state(State state); 12 | extern std::string format_state(State state, MonitoringState monitoringState); 13 | std::string get_frequency_format(); 14 | extern std::string log_header(std::string short_name,long call_num, std::string talkgroup_display, double freq); 15 | extern int frequency_format; 16 | extern bool statusAsString; 17 | 18 | #endif // FORMATTER_H 19 | -------------------------------------------------------------------------------- /trunk-recorder/git.h: -------------------------------------------------------------------------------- 1 | ../git.h -------------------------------------------------------------------------------- /trunk-recorder/gr_blocks/decoders/fsync_types.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * fsync_types.h 3 | * common typedef header for fsync_decode.h, fsync_encode.h 4 | * 5 | * Author: Matthew Kaufman (matthew@eeph.com) 6 | * 7 | * Copyright (c) 2012, 2013, 2014 Matthew Kaufman All rights reserved. 8 | * 9 | * This file is part of Matthew Kaufman's fsync Encoder/Decoder Library 10 | * 11 | * The fsync Encoder/Decoder Library is free software; you can 12 | * redistribute it and/or modify it under the terms of version 2 of 13 | * the GNU General Public License as published by the Free Software 14 | * Foundation. 15 | * 16 | * If you cannot comply with the terms of this license, contact 17 | * the author for alternative license arrangements or do not use 18 | * or redistribute this software. 19 | * 20 | * The fsync Encoder/Decoder Library is distributed in the hope 21 | * that it will be useful, but WITHOUT ANY WARRANTY; without even the 22 | * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 23 | * PURPOSE. See the GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with this software; if not, write to the Free Software 27 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 28 | * USA. 29 | * 30 | * or see http://www.gnu.org/copyleft/gpl.html 31 | * 32 | -*/ 33 | 34 | #ifndef _FSYNC_TYPES_H_ 35 | #define _FSYNC_TYPES_H_ 36 | 37 | typedef int fsync_s32; 38 | typedef unsigned int fsync_u32_t; 39 | typedef short fsync_s16_t; 40 | typedef unsigned short fsync_u16_t; 41 | typedef char fsync_s8_t; 42 | typedef unsigned char fsync_u8_t; 43 | typedef double fsync_float_t; 44 | typedef int fsync_int_t; 45 | 46 | /* to change the data type, set this typedef: */ 47 | typedef float fsync_sample_t; 48 | 49 | /* AND set this to match: */ 50 | /* #define FSYNC_SAMPLE_FORMAT_U8 */ 51 | /* #define FSYNC_SAMPLE_FORMAT_S16 */ 52 | /* #define FSYNC_SAMPLE_FORMAT_U16 */ 53 | #define FSYNC_SAMPLE_FORMAT_FLOAT 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /trunk-recorder/gr_blocks/decoders/star_types.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * star_types.h 3 | * common typedef header for star_encode.h, star_decode.h 4 | * 5 | * Author: Matthew Kaufman (matthew@eeph.com) 6 | * 7 | * Copyright (c) 2012 Matthew Kaufman All rights reserved. 8 | * 9 | * This file is part of Matthew Kaufman's STAR Encoder/Decoder Library 10 | * 11 | * The STAR Encoder/Decoder Library is free software; you can 12 | * redistribute it and/or modify it under the terms of version 2 of 13 | * the GNU General Public License as published by the Free Software 14 | * Foundation. 15 | * 16 | * If you cannot comply with the terms of this license, contact 17 | * the author for alternative license arrangements or do not use 18 | * or redistribute this software. 19 | * 20 | * The STAR Encoder/Decoder Library is distributed in the hope 21 | * that it will be useful, but WITHOUT ANY WARRANTY; without even the 22 | * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 23 | * PURPOSE. See the GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with this software; if not, write to the Free Software 27 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 28 | * USA. 29 | * 30 | * or see http://www.gnu.org/copyleft/gpl.html 31 | * 32 | -*/ 33 | 34 | #ifndef _STAR_TYPES_H_ 35 | #define _STAR_TYPES_H_ 36 | 37 | typedef int star_s32_t; 38 | typedef unsigned int star_u32_t; 39 | typedef short star_s16_t; 40 | typedef unsigned short star_u16_t; 41 | typedef char star_s8_t; 42 | typedef unsigned char star_u8_t; 43 | typedef double star_float_t; 44 | typedef int star_int_t; 45 | 46 | /* to change the data type, set this typedef: */ 47 | typedef float star_sample_t; 48 | 49 | /* AND uncomment this to match: */ 50 | /* #define STAR_SAMPLE_FORMAT_U8 */ 51 | /* #define STAR_SAMPLE_FORMAT_S16 */ 52 | /* #define STAR_SAMPLE_FORMAT_U16 */ 53 | #define STAR_SAMPLE_FORMAT_FLOAT 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /trunk-recorder/gr_blocks/decoders/tps_decoder_sink.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2020 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef INCLUDED_GR_TPS_DECODER_SINK_H 24 | #define INCLUDED_GR_TPS_DECODER_SINK_H 25 | 26 | #include "../decoder_wrapper.h" 27 | #include 28 | #include 29 | #include 30 | 31 | namespace gr { 32 | namespace blocks { 33 | 34 | /*! 35 | * \brief Decodes Motorola Tactical Public Safety signals. 36 | * \ingroup audio_blk 37 | * 38 | * \details 39 | * Values must be floats within [-1;1]. 40 | */ 41 | class BLOCKS_API tps_decoder_sink : virtual public hier_block2 { 42 | public: 43 | // gr::blocks::wavfile_sink::sptr 44 | 45 | #if GNURADIO_VERSION < 0x030900 46 | typedef boost::shared_ptr sptr; 47 | #else 48 | typedef std::shared_ptr sptr; 49 | #endif 50 | 51 | virtual void set_enabled(bool b){}; 52 | 53 | virtual bool get_enabled() { return false; }; 54 | 55 | virtual void process_message_queues(void){}; 56 | }; 57 | 58 | } /* namespace blocks */ 59 | } /* namespace gr */ 60 | 61 | #endif /* INCLUDED_GR_TPS_DECODER_SINK_H */ 62 | -------------------------------------------------------------------------------- /trunk-recorder/gr_blocks/freq_xlating_fft_filter.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_GR_XLATING_FFT_FILTER_H 2 | #define INCLUDED_GR_XLATING_FFT_FILTER_H 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class freq_xlating_fft_filter; 12 | 13 | #if GNURADIO_VERSION < 0x030900 14 | typedef boost::shared_ptr freq_xlating_fft_filter_sptr; 15 | #else 16 | typedef std::shared_ptr freq_xlating_fft_filter_sptr; 17 | #endif 18 | 19 | freq_xlating_fft_filter_sptr make_freq_xlating_fft_filter(int decimation, std::vector &taps, double center_freq, double samp_rate); 20 | 21 | class freq_xlating_fft_filter : public gr::hier_block2 { 22 | 23 | friend freq_xlating_fft_filter_sptr make_freq_xlating_fft_filter(int decimation, std::vector &taps, double center_freq, double samp_rate); 24 | 25 | gr::blocks::rotator_cc::sptr rotator; 26 | gr::filter::fft_filter_ccc::sptr filter; 27 | int decim; 28 | std::vector taps; 29 | double center_freq; 30 | double samp_rate; 31 | 32 | void set_taps(std::vector taps); 33 | std::vector rotate_taps(float phase_inc); 34 | void refresh(); 35 | 36 | ~freq_xlating_fft_filter(); 37 | freq_xlating_fft_filter(int decimation, std::vector &taps, double center_freq, double sampling_freq); 38 | 39 | public: 40 | void set_center_freq(double center_freq); 41 | void set_nthreads(int nthreads); 42 | void declare_sample_delay(double samp_delay); 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /trunk-recorder/gr_blocks/plugin_wrapper.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2020 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef INCLUDED_GR_PLUGIN_WRAPPER_H 24 | #define INCLUDED_GR_PLUGIN_WRAPPER_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace gr { 32 | namespace blocks { 33 | 34 | typedef std::function plugin_callback; 35 | 36 | /*! 37 | * \brief Wrapps the plugin functions into a single block. 38 | * \ingroup audio_blk 39 | * 40 | * \details 41 | * Values must be floats within [-1;1]. 42 | * Check gr_make_plugin_wrapper() for extra info. 43 | */ 44 | class BLOCKS_API plugin_wrapper : virtual public sync_block { 45 | public: 46 | // gr::blocks::plugin_wrapper::sptr 47 | 48 | #if GNURADIO_VERSION < 0x030900 49 | typedef boost::shared_ptr sptr; 50 | #else 51 | typedef std::shared_ptr sptr; 52 | #endif 53 | }; 54 | 55 | } /* namespace blocks */ 56 | } /* namespace gr */ 57 | 58 | #endif /* INCLUDED_GR_PLUGIN_WRAPPER_H */ 59 | -------------------------------------------------------------------------------- /trunk-recorder/gr_blocks/plugin_wrapper_impl.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2020 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef INCLUDED_GR_PLUGIN_WRAPPER_IMPL_H 24 | #define INCLUDED_GR_PLUGIN_WRAPPER_IMPL_H 25 | 26 | #include "plugin_wrapper.h" 27 | #include 28 | 29 | namespace gr { 30 | namespace blocks { 31 | 32 | class plugin_wrapper_impl : public plugin_wrapper { 33 | private: 34 | plugin_callback d_callback; 35 | 36 | protected: 37 | boost::mutex d_mutex; 38 | virtual int dowork(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); 39 | 40 | public: 41 | #if GNURADIO_VERSION < 0x030900 42 | typedef boost::shared_ptr sptr; 43 | #else 44 | typedef std::shared_ptr sptr; 45 | #endif 46 | 47 | static sptr make(plugin_callback callback); 48 | 49 | plugin_wrapper_impl(plugin_callback callback); 50 | 51 | virtual int work(int noutput_items, 52 | gr_vector_const_void_star &input_items, 53 | gr_vector_void_star &output_items); 54 | }; 55 | 56 | } /* namespace blocks */ 57 | } /* namespace gr */ 58 | 59 | #endif /* INCLUDED_GR_PLUGIN_WRAPPER_IMPL_H */ 60 | -------------------------------------------------------------------------------- /trunk-recorder/gr_blocks/rms_agc.cc: -------------------------------------------------------------------------------- 1 | // 2 | // SPDX-License-Identifier: GPL-3.0 3 | // 4 | // GNU Radio Python Flow Graph 5 | // Title: RMS AGC 6 | // Author: Daniel Estevez & Luke Berndt 7 | // Description: AGC using RMS 8 | // GNU Radio version: 3.8.0.0 9 | 10 | #include "rms_agc.h" 11 | 12 | namespace gr { 13 | namespace blocks { 14 | 15 | rms_agc::sptr rms_agc::make(double alpha, double reference) { 16 | return gnuradio::get_initial_sptr( 17 | new rms_agc(alpha, reference)); 18 | } 19 | 20 | rms_agc::rms_agc(double a, double r) : gr::hier_block2("RMS AGC", 21 | gr::io_signature::make(1, 1, sizeof(gr_complex)), 22 | gr::io_signature::make(1, 1, sizeof(gr_complex))) { 23 | alpha = a; 24 | reference = r; 25 | rms_cf = gr::blocks::rms_cf::make(alpha); 26 | multiply_const = gr::blocks::multiply_const_ff::make(1.0 / reference); 27 | float_to_complex = gr::blocks::float_to_complex::make(1); 28 | divide = gr::blocks::divide_cc::make(1); 29 | add_const = gr::blocks::add_const_ff::make(1e-18); 30 | 31 | connect(add_const, 0, float_to_complex, 0); 32 | connect(divide, 0, self(), 0); 33 | connect(float_to_complex, 0, divide, 1); 34 | connect(multiply_const, 0, add_const, 0); 35 | connect(rms_cf, 0, multiply_const, 0); 36 | connect(self(), 0, divide, 0); 37 | connect(self(), 0, rms_cf, 0); 38 | } 39 | 40 | double rms_agc::get_alpha() { 41 | return alpha; 42 | } 43 | 44 | void rms_agc::set_alpha(double a) { 45 | alpha = a; 46 | rms_cf->set_alpha(alpha); 47 | } 48 | 49 | double rms_agc::get_reference() { 50 | return reference; 51 | } 52 | 53 | void rms_agc::set_reference(double r) { 54 | reference = r; 55 | multiply_const->set_k(1.0 / reference); 56 | } 57 | 58 | } // namespace blocks 59 | } // namespace gr 60 | -------------------------------------------------------------------------------- /trunk-recorder/gr_blocks/rms_agc.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_GR_RMS_AGC_H 2 | #define INCLUDED_GR_RMS_AGC_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #if GNURADIO_VERSION < 0x030800 13 | #include 14 | #include 15 | #else 16 | #include 17 | #include 18 | #endif 19 | 20 | class rms_agc; 21 | namespace gr { 22 | namespace blocks { 23 | 24 | class BLOCKS_API rms_agc : virtual public gr::hier_block2 { 25 | public: 26 | #if GNURADIO_VERSION < 0x030900 27 | typedef boost::shared_ptr sptr; 28 | #else 29 | typedef std::shared_ptr sptr; 30 | #endif 31 | 32 | static sptr make(double alpha, double reference); 33 | rms_agc(double a, double r); 34 | double alpha; 35 | double reference; 36 | 37 | gr::blocks::rms_cf::sptr rms_cf; 38 | gr::blocks::multiply_const_ff::sptr multiply_const; 39 | gr::blocks::float_to_complex::sptr float_to_complex; 40 | gr::blocks::divide_cc::sptr divide; 41 | gr::blocks::add_const_ff::sptr add_const; 42 | 43 | double get_alpha(); 44 | void set_alpha(double a); 45 | double get_reference(); 46 | void set_reference(double r); 47 | }; 48 | 49 | } // namespace blocks 50 | } // namespace gr 51 | #endif -------------------------------------------------------------------------------- /trunk-recorder/gr_blocks/squelch_base_cc.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2006,2012 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * SPDX-License-Identifier: GPL-3.0-or-later 8 | * 9 | */ 10 | 11 | #ifndef INCLUDED_ANALOG_SQUELCH_BASE_CC_H 12 | #define INCLUDED_ANALOG_SQUELCH_BASE_CC_H 13 | 14 | #include 15 | #include 16 | 17 | namespace gr { 18 | namespace analog { 19 | 20 | /*! 21 | * \brief basic squelch block; to be subclassed for other squelches. 22 | * \ingroup level_blk 23 | */ 24 | class ANALOG_API squelch_base_cc : virtual public block 25 | { 26 | protected: 27 | virtual void update_state(const gr_complex& sample) = 0; 28 | virtual bool mute() const = 0; 29 | 30 | public: 31 | squelch_base_cc(){}; 32 | virtual int ramp() const = 0; 33 | virtual void set_ramp(int ramp) = 0; 34 | virtual bool gate() const = 0; 35 | virtual void set_gate(bool gate) = 0; 36 | virtual bool unmuted() const = 0; 37 | 38 | virtual std::vector squelch_range() const = 0; 39 | }; 40 | 41 | } /* namespace analog */ 42 | } /* namespace gr */ 43 | 44 | #endif /* INCLUDED_ANALOG_SQUELCH_BASE_CC_H */ -------------------------------------------------------------------------------- /trunk-recorder/gr_blocks/squelch_base_cc_impl.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2006,2012 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * SPDX-License-Identifier: GPL-3.0-or-later 8 | * 9 | */ 10 | 11 | #ifndef INCLUDED_GR_SQUELCH_BASE_CC_IMPL_H 12 | #define INCLUDED_GR_SQUELCH_BASE_CC_IMPL_H 13 | 14 | #include "./squelch_base_cc.h" 15 | 16 | namespace gr { 17 | namespace analog { 18 | 19 | class squelch_base_cc_impl : public squelch_base_cc 20 | { 21 | private: 22 | int d_ramp; 23 | int d_ramped; 24 | bool d_gate; 25 | double d_envelope; 26 | enum { ST_MUTED, ST_ATTACK, ST_UNMUTED, ST_DECAY } d_state; 27 | const pmt::pmt_t d_sob_key, d_eob_key; 28 | bool d_tag_next_unmuted; 29 | 30 | protected: 31 | void update_state(const gr_complex& sample) override{}; 32 | bool mute() const override { return false; }; 33 | 34 | public: 35 | squelch_base_cc_impl(const char* name, int ramp, bool gate); 36 | ~squelch_base_cc_impl() override; 37 | 38 | int ramp() const override; 39 | void set_ramp(int ramp) override; 40 | bool gate() const override; 41 | void set_gate(bool gate) override; 42 | bool unmuted() const override; 43 | 44 | std::vector squelch_range() const override = 0; 45 | 46 | int general_work(int noutput_items, 47 | gr_vector_int& ninput_items, 48 | gr_vector_const_void_star& input_items, 49 | gr_vector_void_star& output_items) override; 50 | }; 51 | 52 | } /* namespace analog */ 53 | } /* namespace gr */ 54 | 55 | #endif /* INCLUDED_ANALOG_SQUELCH_BASE_IMPL_FF_H */ -------------------------------------------------------------------------------- /trunk-recorder/monitor_systems.h: -------------------------------------------------------------------------------- 1 | #ifndef MONITOR_SYSTEMS_H 2 | #define MONITOR_SYSTEMS_H 3 | #include 4 | #include 5 | 6 | #include "./global_structs.h" 7 | #include "call.h" 8 | #include "config.h" 9 | #include "source.h" 10 | #include "systems/p25_parser.h" 11 | #include "systems/p25_trunking.h" 12 | #include "systems/smartnet_parser.h" 13 | #include "systems/smartnet_trunking.h" 14 | #include "systems/system.h" 15 | #include 16 | 17 | int monitor_messages(Config &config, gr::top_block_sptr &tb, std::vector &sources, std::vector &systems, std::vector &calls); 18 | void retune_system(System *sys, gr::top_block_sptr &tb, std::vector &sources); 19 | #endif -------------------------------------------------------------------------------- /trunk-recorder/recorder_globals.h: -------------------------------------------------------------------------------- 1 | #ifndef RECORDER_GLOBALS_H 2 | #define RECORDER_GLOBALS_H 3 | 4 | #include "gr_blocks/decoder_wrapper.h" 5 | 6 | class Call; 7 | class Recorder; 8 | class System; 9 | void process_signal(long unitId, const char *signaling_type, gr::blocks::SignalType sig_type, Call *call, System *system, Recorder *recorder); 10 | 11 | #endif /* RECORDER_GLOBALS_H */ -------------------------------------------------------------------------------- /trunk-recorder/recorders/dmr_recorder.h: -------------------------------------------------------------------------------- 1 | #ifndef DMR_RECORDER_H 2 | #define DMR_RECORDER_H 3 | 4 | #define _USE_MATH_DEFINES 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "../gr_blocks/plugin_wrapper_impl.h" 14 | #include "../source.h" 15 | #include "recorder.h" 16 | #include 17 | #include 18 | #include 19 | 20 | class Source; 21 | class dmr_recorder; 22 | 23 | #if GNURADIO_VERSION < 0x030900 24 | typedef boost::shared_ptr dmr_recorder_sptr; 25 | #else 26 | typedef std::shared_ptr dmr_recorder_sptr; 27 | #endif 28 | 29 | dmr_recorder_sptr make_dmr_recorder(Source *src, Recorder_Type type); 30 | 31 | class dmr_recorder : virtual public gr::hier_block2, virtual public Recorder { 32 | 33 | public: 34 | dmr_recorder(){}; 35 | virtual ~dmr_recorder(){}; 36 | virtual void tune_freq(double f) = 0; 37 | virtual bool start(Call *call) = 0; 38 | virtual void stop() = 0; 39 | virtual double get_freq() = 0; 40 | virtual int get_freq_error() = 0; 41 | virtual int get_num() = 0; 42 | virtual void set_tdma(bool phase2) = 0; 43 | virtual void switch_tdma(bool phase2) = 0; 44 | virtual void set_tdma_slot(int slot) = 0; 45 | virtual double since_last_write() = 0; 46 | virtual double get_current_length() = 0; 47 | virtual void set_enabled(bool enabled) {}; 48 | virtual bool is_enabled() { return false; }; 49 | virtual bool is_active() = 0; 50 | virtual bool is_idle() = 0; 51 | virtual bool is_squelched() = 0; 52 | virtual double get_pwr() = 0; 53 | virtual std::vector get_transmission_list() = 0; 54 | virtual State get_state() = 0; 55 | virtual int lastupdate() = 0; 56 | virtual long elapsed() = 0; 57 | virtual Source *get_source() = 0; 58 | }; 59 | 60 | #endif // ifndef dmr_recorder_H 61 | -------------------------------------------------------------------------------- /trunk-recorder/recorders/recorder.cc: -------------------------------------------------------------------------------- 1 | #include "recorder.h" 2 | #include "../source.h" 3 | #include 4 | 5 | Recorder::Recorder(Recorder_Type type) { 6 | this->type = type; 7 | } 8 | 9 | boost::property_tree::ptree Recorder::get_stats() { 10 | boost::property_tree::ptree node; 11 | node.put("id", boost::lexical_cast(get_source()->get_num()) + "_" + boost::lexical_cast(get_num())); 12 | node.put("type", get_type_string()); 13 | node.put("srcNum", get_source()->get_num()); 14 | node.put("recNum", get_num()); 15 | node.put("count", recording_count); 16 | node.put("duration", recording_duration); 17 | node.put("state", get_state()); 18 | return node; 19 | } 20 | 21 | std::string Recorder::get_type_string() { 22 | switch(type) { 23 | case DEBUG: 24 | return "Debug"; 25 | case SIGMF: 26 | return "SIGMF"; 27 | case ANALOGC: 28 | return "AnalogC"; 29 | case ANALOG: 30 | return "Analog"; 31 | case P25: 32 | return "P25"; 33 | case P25C: 34 | return "P25C"; 35 | case DMR: 36 | return "DMR"; 37 | default: 38 | return "Unknown"; 39 | } 40 | } -------------------------------------------------------------------------------- /trunk-recorder/recorders/sigmf_recorder.h: -------------------------------------------------------------------------------- 1 | #ifndef SIGMF_RECORDER_H 2 | #define SIGMF_RECORDER_H 3 | 4 | #define _USE_MATH_DEFINES 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include "../gr_blocks/freq_xlating_fft_filter.h" 18 | #include "recorder.h" 19 | 20 | class Source; 21 | class sigmf_recorder; 22 | 23 | #if GNURADIO_VERSION < 0x030900 24 | typedef boost::shared_ptr sigmf_recorder_sptr; 25 | #else 26 | typedef std::shared_ptr sigmf_recorder_sptr; 27 | #endif 28 | 29 | sigmf_recorder_sptr make_sigmf_recorder(Source *src, Recorder_Type type); 30 | #include "../source.h" 31 | 32 | class sigmf_recorder : virtual public gr::hier_block2, virtual public Recorder { 33 | 34 | public: 35 | sigmf_recorder(){}; 36 | virtual ~sigmf_recorder(){}; 37 | virtual bool start(Call *call) = 0; 38 | virtual void stop() = 0; 39 | virtual double get_freq() = 0; 40 | virtual int get_freq_error() = 0; 41 | virtual int get_num() = 0; 42 | virtual double get_current_length() = 0; 43 | virtual void set_enabled(bool enabled) {}; 44 | virtual bool is_enabled() { return false; }; 45 | virtual bool is_active() = 0; 46 | virtual State get_state() = 0; 47 | virtual int lastupdate() = 0; 48 | virtual long elapsed() = 0; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /trunk-recorder/setup_systems.h: -------------------------------------------------------------------------------- 1 | #ifndef SETUP_SYSTEMS_H 2 | #define SETUP_SYSTEMS_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include "./global_structs.h" 9 | #include "call.h" 10 | #include "call_conventional.h" 11 | #include "config.h" 12 | #include "source.h" 13 | #include "systems/p25_trunking.h" 14 | #include "systems/smartnet_trunking.h" 15 | #include "systems/system.h" 16 | 17 | bool setup_conventional_channel(System *system, double frequency, long channel_index, Config &config, gr::top_block_sptr &tb, std::vector &sources, std::vector &calls); 18 | bool setup_conventional_system(System *system, Config &config, gr::top_block_sptr &tb, std::vector &sources, std::vector &calls); 19 | bool setup_systems(Config &config, gr::top_block_sptr &tb, std::vector &sources, std::vector &systems, std::vector &calls); 20 | 21 | #endif -------------------------------------------------------------------------------- /trunk-recorder/sources/iq_file_source.cc: -------------------------------------------------------------------------------- 1 | #include "iq_file_source.h" 2 | 3 | 4 | iq_file_source::sptr 5 | iq_file_source::make(std::string filename, double rate, bool repeat=false) { 6 | return gnuradio::get_initial_sptr(new iq_file_source(filename, rate, repeat)); 7 | } 8 | 9 | iq_file_source::iq_file_source(std::string filename, double rate, bool repeat=false) 10 | : gr::hier_block2("iq_file_source", 11 | gr::io_signature::make(0, 0, 0), 12 | gr::io_signature::make(1, 1, sizeof(gr_complex))), 13 | d_filename(filename), 14 | d_rate(rate), 15 | d_repeat(repeat) { 16 | 17 | file_source = gr::blocks::file_source::make(sizeof(gr_complex), filename.c_str(), repeat); 18 | throttle = gr::blocks::throttle::make(sizeof(gr_complex), rate); 19 | connect(file_source, 0, throttle, 0); 20 | connect(throttle, 0, self(), 0); 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /trunk-recorder/sources/iq_file_source.h: -------------------------------------------------------------------------------- 1 | #ifndef IQ_FILE_SOURCE_H 2 | #define IQ_FILE_SOURCE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | 10 | class iq_file_source : public gr::hier_block2 { 11 | private: 12 | 13 | std::string d_filename; 14 | double d_rate; 15 | bool d_repeat; 16 | gr::blocks::file_source::sptr file_source; 17 | gr::blocks::throttle::sptr throttle; 18 | 19 | public: 20 | #if GNURADIO_VERSION < 0x030900 21 | typedef boost::shared_ptr sptr; 22 | #else 23 | typedef std::shared_ptr sptr; 24 | #endif 25 | static sptr make(std::string filename, double rate, bool repeat); 26 | 27 | 28 | iq_file_source(std::string filename, double rate, bool repeat); 29 | 30 | 31 | 32 | }; 33 | 34 | 35 | 36 | 37 | #endif -------------------------------------------------------------------------------- /trunk-recorder/state.h: -------------------------------------------------------------------------------- 1 | #ifndef STATE_H 2 | #define STATE_H 3 | 4 | enum State { MONITORING = 0, 5 | RECORDING = 1, 6 | INACTIVE = 2, 7 | ACTIVE = 3, 8 | IDLE = 4, 9 | STOPPED = 6, 10 | AVAILABLE = 7, 11 | IGNORE = 8 }; 12 | 13 | enum MonitoringState { 14 | UNSPECIFIED = 0, 15 | UNKNOWN_TG = 1, 16 | IGNORED_TG = 2, 17 | NO_SOURCE = 3, 18 | NO_RECORDER = 4, 19 | ENCRYPTED = 5, 20 | DUPLICATE = 6, 21 | SUPERSEDED = 7}; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /trunk-recorder/systems/p25_parser.h: -------------------------------------------------------------------------------- 1 | #ifndef P25_PARSE_H 2 | #define P25_PARSE_H 3 | #include "parser.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "system.h" 9 | #include "system_impl.h" 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "../csv_helper.h" 16 | #include 17 | 18 | struct Freq_Table { 19 | unsigned long id; 20 | long offset; 21 | unsigned long step; 22 | unsigned long frequency; 23 | bool phase2_tdma; 24 | int slots_per_carrier; 25 | double bandwidth; 26 | }; 27 | 28 | class P25Parser : public TrunkParser { 29 | std::map> freq_tables; 30 | std::map::iterator it; 31 | bool custom_freq_table_loaded = false; 32 | 33 | public: 34 | P25Parser(); 35 | long get_tdma_slot(int chan_id, int sys_num); 36 | double get_bandwidth(int chan_id, int sys_num); 37 | std::vector decode_mbt_data(unsigned long opcode, boost::dynamic_bitset<> &header, boost::dynamic_bitset<> &mbt_data, unsigned long link_id, unsigned long nac, int sys_num); 38 | std::vector decode_tsbk(boost::dynamic_bitset<> &tsbk, unsigned long nac, int sys_num); 39 | unsigned long bitset_shift_mask(boost::dynamic_bitset<> &tsbk, int shift, unsigned long long mask); 40 | unsigned long bitset_shift_left_mask(boost::dynamic_bitset<> &tsbk, int shift, unsigned long long mask); 41 | std::string channel_id_to_freq_string(int chan_id, int sys_num); 42 | void print_bitset(boost::dynamic_bitset<> &tsbk); 43 | void add_freq_table(int freq_table_id, Freq_Table table, int sys_num); 44 | void load_freq_table(std::string custom_freq_table_file, int sys_num); 45 | double channel_id_to_frequency(int chan_id, int sys_num); 46 | std::string channel_to_string(int chan, int sys_num); 47 | std::vector parse_message(gr::message::sptr msg, System *system); 48 | }; 49 | 50 | #endif -------------------------------------------------------------------------------- /trunk-recorder/systems/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSE_H 2 | #define PARSE_H 3 | #include 4 | #include 5 | 6 | enum MessageType { 7 | GRANT = 0, 8 | STATUS = 1, 9 | UPDATE = 2, 10 | CONTROL_CHANNEL = 3, 11 | REGISTRATION = 4, 12 | DEREGISTRATION = 5, 13 | AFFILIATION = 6, 14 | SYSID = 7, 15 | ACKNOWLEDGE = 8, 16 | LOCATION = 9, 17 | PATCH_ADD = 10, 18 | PATCH_DELETE = 11, 19 | DATA_GRANT = 12, 20 | UU_ANS_REQ = 13, 21 | UU_V_GRANT = 14, 22 | UU_V_UPDATE = 15, 23 | INVALID_CC_MESSAGE = 16, 24 | TDULC = 17, 25 | UNKNOWN = 99 26 | }; 27 | 28 | struct PatchData { 29 | unsigned long sg; 30 | unsigned long ga1; 31 | unsigned long ga2; 32 | unsigned long ga3; 33 | }; 34 | 35 | struct TrunkMessage { 36 | MessageType message_type; 37 | std::string meta; 38 | double freq; 39 | long talkgroup; 40 | bool encrypted; 41 | bool emergency; 42 | bool duplex; 43 | bool mode; 44 | int priority; 45 | int tdma_slot; 46 | bool phase2_tdma; 47 | long source; 48 | int sys_num; 49 | unsigned long sys_id; 50 | int sys_rfss; 51 | int sys_site_id; 52 | unsigned long nac; 53 | unsigned long wacn; 54 | PatchData patch_data; 55 | unsigned long opcode; 56 | 57 | }; 58 | 59 | class TrunkParser { 60 | std::vector parse_message(std::string s); 61 | }; 62 | #endif 63 | -------------------------------------------------------------------------------- /trunk-recorder/systems/smartnet_types.h: -------------------------------------------------------------------------------- 1 | // datatypes for smartnet decoder 2 | 3 | struct smartnet_packet { 4 | unsigned int address; 5 | bool groupflag; 6 | unsigned int command; 7 | unsigned int crc; 8 | }; 9 | -------------------------------------------------------------------------------- /trunk-recorder/talkgroup.h: -------------------------------------------------------------------------------- 1 | #ifndef TALKGROUP_H 2 | #define TALKGROUP_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "global_structs.h" 8 | //#include 9 | 10 | class Talkgroup { 11 | public: 12 | long number; 13 | std::string mode; 14 | std::string alpha_tag; 15 | std::string description; 16 | std::string tag; 17 | std::string group; 18 | int priority; 19 | int sys_num; 20 | double squelch_db; 21 | bool signal_detection; 22 | 23 | 24 | // For Conventional 25 | double freq; 26 | double tone; 27 | 28 | Talkgroup(int sys_num, long num, std::string mode, std::string alpha_tag, std::string description, std::string tag, std::string group, int priority, unsigned long preferredNAC); 29 | Talkgroup(int sys_num, long num, double freq, double tone, std::string alpha_tag, std::string description, std::string tag, std::string group, double squelch_db, bool signal_detection); 30 | 31 | bool is_active(); 32 | int get_priority(); 33 | unsigned long get_preferredNAC(); 34 | void set_priority(int new_priority); 35 | void set_active(bool a); 36 | std::string menu_string(); 37 | 38 | private: 39 | unsigned long preferredNAC; 40 | bool active; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /trunk-recorder/talkgroups.h: -------------------------------------------------------------------------------- 1 | #ifndef TALKGROUPS_H 2 | #define TALKGROUPS_H 3 | 4 | #include "talkgroup.h" 5 | #include 6 | #include 7 | #include 8 | 9 | class Talkgroups { 10 | std::vector talkgroups; 11 | 12 | public: 13 | Talkgroups(); 14 | void load_talkgroups(int sys_num, std::string filename); 15 | void load_channels(int sys_num, std::string filename); 16 | Talkgroup *find_talkgroup(int sys_num, long tg); 17 | Talkgroup *find_talkgroup_by_freq(int sys_num, double freq); 18 | std::vector get_talkgroups(); 19 | }; 20 | #endif // TALKGROUPS_H 21 | -------------------------------------------------------------------------------- /trunk-recorder/unit_tag.cc: -------------------------------------------------------------------------------- 1 | #include "unit_tag.h" 2 | #include 3 | 4 | UnitTag::UnitTag(std::string p, std::string t) { 5 | pattern = p; 6 | tag = t; 7 | } 8 | -------------------------------------------------------------------------------- /trunk-recorder/unit_tag.h: -------------------------------------------------------------------------------- 1 | #ifndef UNIT_TAG_H 2 | #define UNIT_TAG_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class UnitTag { 10 | public: 11 | boost::regex pattern; 12 | std::string tag; 13 | 14 | UnitTag(std::string p, std::string t); 15 | }; 16 | 17 | #endif // UNIT_TAG_H 18 | -------------------------------------------------------------------------------- /trunk-recorder/unit_tags.h: -------------------------------------------------------------------------------- 1 | #ifndef UNIT_TAGS_H 2 | #define UNIT_TAGS_H 3 | 4 | #include "unit_tag.h" 5 | 6 | #include 7 | #include 8 | 9 | class UnitTags { 10 | std::vector unit_tags; 11 | 12 | public: 13 | UnitTags(); 14 | void load_unit_tags(std::string filename); 15 | std::string find_unit_tag(long unitID); 16 | void add(std::string pattern, std::string tag); 17 | }; 18 | #endif // UNIT_TAGS_H 19 | -------------------------------------------------------------------------------- /user_plugins/README.txt: -------------------------------------------------------------------------------- 1 | Please reference plugin development and installation instructions at: 2 | trunk-recorder/docs/Plugins.md 3 | or 4 | https://trunkrecorder.com/docs/Plugins -------------------------------------------------------------------------------- /utils/Dockerfile.arch-latest-aur.dev: -------------------------------------------------------------------------------- 1 | FROM archlinux:latest AS base 2 | 3 | # Install enought to run makepkg 4 | # PKGBUILD from the repo will pull all dependencies for build and install 5 | RUN pacman -Suy --noconfirm base-devel git 6 | 7 | ARG AUR_PACKAGE=trunk-recorder-git 8 | 9 | RUN useradd builduser -m \ 10 | && passwd -d builduser \ 11 | && cd /home/builduser \ 12 | && git clone "https://aur.archlinux.org/$AUR_PACKAGE.git" target \ 13 | && chown builduser -R target \ 14 | && (printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers) \ 15 | && sudo -u builduser bash -c 'cd ~/target && makepkg -si --noconfirm' \ 16 | && pacman -Rns --noconfirm $(pacman -Qtdq) 17 | 18 | # GNURadio requires a place to store some files, can only be set via $HOME env var. 19 | ENV HOME=/tmp 20 | 21 | CMD ["/usr/bin/trunk-recorder", "--config=/app/config.json"] -------------------------------------------------------------------------------- /utils/Dockerfile.arch-latest.dev: -------------------------------------------------------------------------------- 1 | FROM archlinux:latest AS base 2 | 3 | # Install everything except cmake 4 | RUN pacman -Suy --noconfirm base-devel cmake git boost gnuradio gnuradio-osmosdr libuhd 5 | 6 | 7 | # GNURadio requires a place to store some files, can only be set via $HOME env var. 8 | ENV HOME=/tmp 9 | 10 | CMD ["/usr/local/bin/trunk-recorder", "--config=/app/config.json"] 11 | -------------------------------------------------------------------------------- /utils/Dockerfile.debian-buster-10.dev: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim AS base 2 | 3 | # Install everything except cmake 4 | RUN apt-get update && \ 5 | apt-get -y upgrade &&\ 6 | export DEBIAN_FRONTEND=noninteractive && \ 7 | apt-get install -y \ 8 | apt-transport-https \ 9 | build-essential \ 10 | ca-certificates \ 11 | git \ 12 | gnupg \ 13 | gnuradio \ 14 | gnuradio-dev \ 15 | gr-osmosdr \ 16 | libboost-all-dev \ 17 | libcurl4-openssl-dev \ 18 | libgmp-dev \ 19 | libhackrf-dev \ 20 | liborc-0.4-dev \ 21 | libpthread-stubs0-dev \ 22 | libssl-dev \ 23 | libuhd-dev \ 24 | libusb-dev \ 25 | pkg-config \ 26 | software-properties-common \ 27 | cmake \ 28 | sox && \ 29 | rm -rf /var/lib/apt/lists/* 30 | 31 | 32 | 33 | 34 | # GNURadio requires a place to store some files, can only be set via $HOME env var. 35 | ENV HOME=/tmp 36 | 37 | CMD ["/usr/local/bin/trunk-recorder", "--config=/app/config.json"] 38 | -------------------------------------------------------------------------------- /utils/Dockerfile.fedora-35.dev: -------------------------------------------------------------------------------- 1 | FROM fedora:34 2 | MAINTAINER 3 | 4 | #RUN firewall-cmd --permanent --zone=trusted --add-interface=docker0 && \ 5 | # firewall-cmd --reload 6 | 7 | #RUN rm -rf /var/cache/dnf/*updates* ; dnf -y update 8 | 9 | #RUN useradd mock 10 | RUN dnf -y install cmake gcc-c++ openssl-devel python3-gnuradio gnuradio-devel gr-osmosdr sox gr-osmosdr-devel libusb-devel libcurl-devel fdk-aac-free-devel cppunit-devel libsndfile-devel log4cpp-devel mpir-devel mpir-c++ gmp-devel gmp-c++ fftw-devel uhd-firmware uhd-devel libunwind-devel wget 11 | 12 | 13 | #ADD https://github.com/robotastic/trunk-recorder/archive/refs/tags/v4.0.tar.gz /home/mock/v4.0.tar.gz 14 | #RUN cd /home/mock ; tar xf v4.0.tar.gz ; rm v4.0.tar.gz ; chown -R mock:mock trunk-recorder-4.0 15 | #RUN su - mock -c 'cd /home/mock/trunk-recorder-4.0/ ; cmake -S "." -B "redhat-linux-build" -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON ; cd redhat-linux-build ; make ' 16 | -------------------------------------------------------------------------------- /utils/Dockerfile.ubuntu-20.04.dev: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 AS base 2 | 3 | # Install everything except cmake 4 | RUN apt-get update && \ 5 | apt-get -y upgrade &&\ 6 | export DEBIAN_FRONTEND=noninteractive && \ 7 | apt-get install -y \ 8 | apt-transport-https \ 9 | build-essential \ 10 | ca-certificates \ 11 | fdkaac \ 12 | git \ 13 | gnupg \ 14 | gnuradio \ 15 | gnuradio-dev \ 16 | gr-osmosdr \ 17 | libboost-all-dev \ 18 | libcurl4-openssl-dev \ 19 | libgmp-dev \ 20 | libhackrf-dev \ 21 | liborc-0.4-dev \ 22 | libpthread-stubs0-dev \ 23 | libssl-dev \ 24 | libuhd-dev \ 25 | libusb-dev \ 26 | pkg-config \ 27 | software-properties-common \ 28 | cmake \ 29 | sox && \ 30 | rm -rf /var/lib/apt/lists/* 31 | 32 | 33 | 34 | 35 | # GNURadio requires a place to store some files, can only be set via $HOME env var. 36 | ENV HOME=/tmp 37 | 38 | CMD ["/usr/local/bin/trunk-recorder", "--config=/app/config.json"] 39 | -------------------------------------------------------------------------------- /utils/Dockerfile.ubuntu-21.04.dev: -------------------------------------------------------------------------------- 1 | FROM ubuntu:21.04 AS base 2 | 3 | # Install everything except cmake 4 | RUN apt-get update && \ 5 | apt-get -y upgrade &&\ 6 | export DEBIAN_FRONTEND=noninteractive && \ 7 | apt-get install -y \ 8 | apt-transport-https \ 9 | build-essential \ 10 | ca-certificates \ 11 | fdkaac \ 12 | git \ 13 | gnupg \ 14 | gnuradio \ 15 | gnuradio-dev \ 16 | gr-osmosdr \ 17 | libboost-all-dev \ 18 | libcurl4-openssl-dev \ 19 | libgmp-dev \ 20 | libhackrf-dev \ 21 | liborc-0.4-dev \ 22 | libpthread-stubs0-dev \ 23 | libssl-dev \ 24 | libuhd-dev \ 25 | libusb-dev \ 26 | pkg-config \ 27 | software-properties-common \ 28 | cmake \ 29 | sox && \ 30 | rm -rf /var/lib/apt/lists/* 31 | 32 | 33 | 34 | 35 | # GNURadio requires a place to store some files, can only be set via $HOME env var. 36 | ENV HOME=/tmp 37 | 38 | CMD ["/usr/local/bin/trunk-recorder", "--config=/app/config.json"] 39 | -------------------------------------------------------------------------------- /utils/Dockerfile.ubuntu-22.04.dev: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 AS base 2 | 3 | # Install everything except cmake 4 | RUN apt-get update && \ 5 | apt-get -y upgrade &&\ 6 | export DEBIAN_FRONTEND=noninteractive && \ 7 | apt-get install -y \ 8 | apt-transport-https \ 9 | build-essential \ 10 | ca-certificates \ 11 | fdkaac \ 12 | git \ 13 | gnupg \ 14 | gnuradio \ 15 | gnuradio-dev \ 16 | gr-osmosdr \ 17 | libboost-all-dev \ 18 | libcurl4-openssl-dev \ 19 | libgmp-dev \ 20 | libhackrf-dev \ 21 | liborc-0.4-dev \ 22 | libpthread-stubs0-dev \ 23 | libssl-dev \ 24 | libuhd-dev \ 25 | libusb-dev \ 26 | libsndfile1-dev \ 27 | pkg-config \ 28 | software-properties-common \ 29 | cmake \ 30 | sox && \ 31 | rm -rf /var/lib/apt/lists/* 32 | 33 | 34 | 35 | 36 | # GNURadio requires a place to store some files, can only be set via $HOME env var. 37 | ENV HOME=/tmp 38 | 39 | #CMD ["/usr/local/bin/trunk-recorder", "--config=/app/config.json"] 40 | -------------------------------------------------------------------------------- /utils/Dockerfile.ubuntu-23.04.dev: -------------------------------------------------------------------------------- 1 | FROM ubuntu:23.04 AS base 2 | 3 | # Install everything except cmake 4 | RUN apt-get update && \ 5 | apt-get -y upgrade &&\ 6 | export DEBIAN_FRONTEND=noninteractive && \ 7 | apt-get install -y \ 8 | apt-transport-https \ 9 | build-essential \ 10 | ca-certificates \ 11 | fdkaac \ 12 | git \ 13 | gnupg \ 14 | gnuradio \ 15 | gnuradio-dev \ 16 | gr-osmosdr \ 17 | libboost-all-dev \ 18 | libcurl4-openssl-dev \ 19 | libgmp-dev \ 20 | libhackrf-dev \ 21 | liborc-0.4-dev \ 22 | libpthread-stubs0-dev \ 23 | libssl-dev \ 24 | libuhd-dev \ 25 | libusb-dev \ 26 | libsndfile1-dev \ 27 | pkg-config \ 28 | software-properties-common \ 29 | cmake \ 30 | sox && \ 31 | rm -rf /var/lib/apt/lists/* 32 | 33 | 34 | 35 | 36 | # GNURadio requires a place to store some files, can only be set via $HOME env var. 37 | ENV HOME=/tmp 38 | 39 | #CMD ["/usr/local/bin/trunk-recorder", "--config=/app/config.json"] 40 | -------------------------------------------------------------------------------- /utils/rtlsdr-to-iq.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | // From: https://gist.github.com/DrPaulBrewer/917f990cc0a51f7febb5 6 | 7 | // rtlsdr-to-gqrx Copyright 2014 Paul Brewer KI6CQ 8 | // License: GNU GPL 3.0 9 | // 10 | // IQ file converter for Software Defined Radio Programs rtl_sdr, gqrx 11 | // from rtl_sdr recording format -- interleaved unsigned char 12 | // to gqrx/gnuradio .cfile playback format -- complex64 13 | // 14 | // compile on Linux with: gcc ./rtlsdr-to-iq.c -o rtlsdr-to-iq 15 | // 16 | // For further usage instructions, see my post at: 17 | // http://ham.stackexchange.com/q/2113/70 18 | // 19 | 20 | int main(int argc, char *argv[]) 21 | { 22 | int byte1, byte2; // int -- not unsigned char -- see fgetc man page 23 | float _Complex fc; 24 | const size_t fc_size = sizeof(fc); 25 | FILE *infile,*outfile; 26 | const float scale = 1.0/128.0; 27 | const char *infilename = argv[1]; 28 | const char *outfilename = argv[2]; 29 | if (argc<3){ 30 | printf("usage: rtlsdr-to-gqrx infile outfile\n"); 31 | exit(1); 32 | } 33 | // printf("in= %s out= %s \n", infilename, outfilename); 34 | infile=fopen(infilename,"rb"); 35 | outfile=fopen(outfilename,"wb"); 36 | if ((infile==NULL) || (outfile==NULL)){ 37 | printf("Error opening files\n"); 38 | exit(1); 39 | } 40 | while ((byte1=fgetc(infile)) != EOF){ 41 | if ((byte2=fgetc(infile)) == EOF){ 42 | exit(0); 43 | } 44 | fc = scale*(byte1-127) + I*scale*(byte2-127); 45 | fwrite(&fc,fc_size,1,outfile); 46 | } 47 | } --------------------------------------------------------------------------------