Remove liquid-dsp dependency for simplicity

This commit is contained in:
F5OEO 2018-03-18 13:39:54 +00:00
parent 83c39fabf2
commit 479a1f42e9
7 changed files with 13 additions and 13 deletions

View file

@ -1,7 +1,7 @@
all: testrpitx all: testrpitx
CFLAGS = -Wall -g -O3 -Wno-unused-variable CFLAGS = -Wall -g -O3 -Wno-unused-variable
LDFLAGS = -lm -lrt -lpthread -lliquid LDFLAGS = -lm -lrt -lpthread
CCP = g++ CCP = g++
CC = gcc CC = gcc

View file

@ -21,7 +21,7 @@ void SimpleTest(uint64_t Freq)
clkgpio clk; clkgpio clk;
clk.print_clock_tree(); clk.print_clock_tree();
//clk.SetPllNumber(clk_plld,2); clk.SetPllNumber(clk_plld,1);
clk.SetAdvancedPllMode(true); clk.SetAdvancedPllMode(true);
clk.SetCenterFrequency(Freq,100000); clk.SetCenterFrequency(Freq,100000);
int Deviation=0; int Deviation=0;
@ -75,6 +75,7 @@ void SimpleTestDMA(uint64_t Freq)
ngfmtest.stop(); ngfmtest.stop();
} }
/*
using std::complex; using std::complex;
void SimpleTestLiquid() void SimpleTestLiquid()
{ {
@ -123,7 +124,7 @@ void SimpleTestLiquid()
ngfmtest.stop(); ngfmtest.stop();
} }
*/
void SimpleTestFileIQ(uint64_t Freq) void SimpleTestFileIQ(uint64_t Freq)
{ {
FILE *iqfile=NULL; FILE *iqfile=NULL;
@ -155,7 +156,7 @@ void SimpleTestFileIQ(uint64_t Freq)
for(int i=0;i<nbread/2;i++) for(int i=0;i<nbread/2;i++)
{ {
liquid_float_complex x=complex<float>(IQBuffer[i*2]/32768.0,IQBuffer[i*2+1]/32768.0); std::complex<float> x=std::complex<float>(IQBuffer[i*2]/32768.0,IQBuffer[i*2+1]/32768.0);
iqtest.SetIQSample(Index+i,x); iqtest.SetIQSample(Index+i,x);
} }
@ -392,8 +393,8 @@ int main(int argc, char* argv[])
//SimpleTest(Freq); //SimpleTest(Freq);
//SimpleTestbpsk(Freq); //SimpleTestbpsk(Freq);
//SimpleTestFileIQ(Freq); SimpleTestFileIQ(Freq);
SimpleTestDMA(Freq); //SimpleTestDMA(Freq);
//SimpleTestAm(Freq); //SimpleTestAm(Freq);
//SimpleTestOOK(Freq); //SimpleTestOOK(Freq);
//SimpleTestBurstFsk(Freq); //SimpleTestBurstFsk(Freq);

View file

@ -2,7 +2,7 @@
all: librpitx all: librpitx
CFLAGS = -Wall -O3 -Wno-unused-variable CFLAGS = -Wall -O3 -Wno-unused-variable
LDFLAGS = -lm -lrt -lpthread -lliquid LDFLAGS = -lm -lrt -lpthread
CCP = g++ CCP = g++
CC = gcc CC = gcc

View file

@ -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 return (y < 0) ? -angle : angle; // negate if in quad III or IV
} }
void dsp::pushsample(liquid_float_complex sample) void dsp::pushsample(std::complex<float> sample)
{ {
amplitude=norm(sample); amplitude=norm(sample);

View file

@ -5,7 +5,7 @@
#include <iostream> #include <iostream>
#include <math.h> #include <math.h>
#include <complex> #include <complex>
#include <liquid/liquid.h>
class dsp class dsp
{ {
protected: protected:
@ -25,7 +25,7 @@ class dsp
dsp(); dsp();
dsp(uint32_t samplerate); dsp(uint32_t samplerate);
void pushsample(liquid_float_complex sample); void pushsample(std::complex<float> sample);
}; };
#endif #endif

View file

@ -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<float> sample)
{ {
Index=Index%buffersize; Index=Index%buffersize;
mydsp.pushsample(sample); mydsp.pushsample(sample);

View file

@ -5,7 +5,6 @@
#include "dma.h" #include "dma.h"
#include "gpio.h" #include "gpio.h"
#include "dsp.h" #include "dsp.h"
#include <liquid/liquid.h>
class iqdmasync:public bufferdma,public clkgpio,public pwmgpio,public pcmgpio 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 SetDmaAlgo();
void SetPhase(bool inversed); void SetPhase(bool inversed);
void SetIQSample(uint32_t Index,liquid_float_complex sample); void SetIQSample(uint32_t Index,std::complex<float> sample);
}; };
#endif #endif