From 479a1f42e988fd59c6202b82d45148d33168e458 Mon Sep 17 00:00:00 2001 From: F5OEO Date: Sun, 18 Mar 2018 13:39:54 +0000 Subject: [PATCH] Remove liquid-dsp dependency for simplicity --- app/Makefile | 2 +- app/testrpitx.cpp | 11 ++++++----- src/Makefile | 2 +- src/dsp.cpp | 2 +- src/dsp.h | 4 ++-- src/iqdmasync.cpp | 2 +- src/iqdmasync.h | 3 +-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/Makefile b/app/Makefile index 2b59d5e..189c248 100644 --- a/app/Makefile +++ b/app/Makefile @@ -1,7 +1,7 @@ all: testrpitx CFLAGS = -Wall -g -O3 -Wno-unused-variable -LDFLAGS = -lm -lrt -lpthread -lliquid +LDFLAGS = -lm -lrt -lpthread CCP = g++ CC = gcc diff --git a/app/testrpitx.cpp b/app/testrpitx.cpp index f0280ec..1623b30 100644 --- a/app/testrpitx.cpp +++ b/app/testrpitx.cpp @@ -21,7 +21,7 @@ void SimpleTest(uint64_t Freq) clkgpio clk; clk.print_clock_tree(); - //clk.SetPllNumber(clk_plld,2); + clk.SetPllNumber(clk_plld,1); clk.SetAdvancedPllMode(true); clk.SetCenterFrequency(Freq,100000); int Deviation=0; @@ -75,6 +75,7 @@ void SimpleTestDMA(uint64_t Freq) ngfmtest.stop(); } +/* using std::complex; void SimpleTestLiquid() { @@ -123,7 +124,7 @@ void SimpleTestLiquid() ngfmtest.stop(); } - +*/ void SimpleTestFileIQ(uint64_t Freq) { FILE *iqfile=NULL; @@ -155,7 +156,7 @@ void SimpleTestFileIQ(uint64_t Freq) for(int i=0;i(IQBuffer[i*2]/32768.0,IQBuffer[i*2+1]/32768.0); + std::complex x=std::complex(IQBuffer[i*2]/32768.0,IQBuffer[i*2+1]/32768.0); iqtest.SetIQSample(Index+i,x); } @@ -392,8 +393,8 @@ int main(int argc, char* argv[]) //SimpleTest(Freq); //SimpleTestbpsk(Freq); - //SimpleTestFileIQ(Freq); - SimpleTestDMA(Freq); + SimpleTestFileIQ(Freq); + //SimpleTestDMA(Freq); //SimpleTestAm(Freq); //SimpleTestOOK(Freq); //SimpleTestBurstFsk(Freq); diff --git a/src/Makefile b/src/Makefile index ac356e7..65a2c9c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ all: librpitx CFLAGS = -Wall -O3 -Wno-unused-variable -LDFLAGS = -lm -lrt -lpthread -lliquid +LDFLAGS = -lm -lrt -lpthread CCP = g++ CC = gcc diff --git a/src/dsp.cpp b/src/dsp.cpp index 5f658c6..6d68a0f 100644 --- a/src/dsp.cpp +++ b/src/dsp.cpp @@ -68,7 +68,7 @@ int dsp::arctan2(int y, int x) // Should be replaced with fast_atan2 from rtl_fm return (y < 0) ? -angle : angle; // negate if in quad III or IV } -void dsp::pushsample(liquid_float_complex sample) +void dsp::pushsample(std::complex sample) { amplitude=norm(sample); diff --git a/src/dsp.h b/src/dsp.h index b85c007..e09c7b1 100644 --- a/src/dsp.h +++ b/src/dsp.h @@ -5,7 +5,7 @@ #include #include #include -#include + class dsp { protected: @@ -25,7 +25,7 @@ class dsp dsp(); dsp(uint32_t samplerate); - void pushsample(liquid_float_complex sample); + void pushsample(std::complex sample); }; #endif diff --git a/src/iqdmasync.cpp b/src/iqdmasync.cpp index c8b26e3..ed75588 100644 --- a/src/iqdmasync.cpp +++ b/src/iqdmasync.cpp @@ -134,7 +134,7 @@ void iqdmasync::SetDmaAlgo() } -void iqdmasync::SetIQSample(uint32_t Index,liquid_float_complex sample) +void iqdmasync::SetIQSample(uint32_t Index,std::complex sample) { Index=Index%buffersize; mydsp.pushsample(sample); diff --git a/src/iqdmasync.h b/src/iqdmasync.h index 2422f1b..ac1a092 100644 --- a/src/iqdmasync.h +++ b/src/iqdmasync.h @@ -5,7 +5,6 @@ #include "dma.h" #include "gpio.h" #include "dsp.h" -#include class iqdmasync:public bufferdma,public clkgpio,public pwmgpio,public pcmgpio @@ -21,7 +20,7 @@ class iqdmasync:public bufferdma,public clkgpio,public pwmgpio,public pcmgpio void SetDmaAlgo(); void SetPhase(bool inversed); - void SetIQSample(uint32_t Index,liquid_float_complex sample); + void SetIQSample(uint32_t Index,std::complex sample); }; #endif