From a9d66c6a759515c7061e2e8aac661eeb0082ea1e Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Wed, 30 Dec 2015 19:20:20 +0000 Subject: More configurable sources. Move some math functions to core/math.h. Move delay filter from sdr_fm --- test/Makefile | 2 +- test/sdr_fm.c | 94 ++----------------------------------------------- test/ui_gl_waterfall.c | 5 ++- test/ui_tui_waterfall.c | 16 ++++----- 4 files changed, 16 insertions(+), 101 deletions(-) (limited to 'test') diff --git a/test/Makefile b/test/Makefile index c447b55..05714ae 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,5 +1,5 @@ CC=gcc -CFLAGS=-std=gnu11 -I../ +CFLAGS=-I../ #LDFLAGS= `pkg-config --libs libusb` -L../../../r820t -lr820t -Wl,-rpath=../../../r820t LDFLAGS=`pkg-config --libs libusb` `sdl2-config --cflags --libs` -lrtlsdr -lm ../radiola.o -lasound SOURCE = $(wildcard *.c) diff --git a/test/sdr_fm.c b/test/sdr_fm.c index a7f5551..4fc4c98 100644 --- a/test/sdr_fm.c +++ b/test/sdr_fm.c @@ -8,8 +8,10 @@ #include +#include #include #include +#include #define SAMPLE_RATE 1000000 #define RESAMPLE_RATE 50000 @@ -149,99 +151,9 @@ uint8_t super_div20u8( uint16_t num ) return (uint8_t)r; } -void rotate_90(uint8_t *buf, uint32_t len) -/* 90 rotation is 1+0j, 0+1j, -1+0j, 0-1j - or [0, 1, -3, 2, -4, -5, 7, -6] */ -{ - uint32_t i; - uint8_t tmp; - for (i=0; i= n ) - { - cycle = 0; - } - - out1 = (avg_i - delay_i)/n; - out2 = (avg_q - delay_q)/n; - - buf[i] = out1; - buf[i+1] = out2; - - //printf("%d,avg=[%d,%d],delay=[%d,%d],in=[%d,%d],out=[%d,%d]\n", - // cycle, avg_i,avg_q,delay_i,delay_q,in1,in2,out1,out2); - - } -} int main( int argc, char **argv ) { @@ -334,7 +246,7 @@ int main( int argc, char **argv ) // fbuf[i] = to_float(sample_buf[i]); //} //delay boxed filter - delay_filt( sample_buf, sample_len ); + filt_delay( sample_buf, sample_len ); //rotate by 90 degrees uint8_t diff --git a/test/ui_gl_waterfall.c b/test/ui_gl_waterfall.c index 837383f..33fbdb6 100644 --- a/test/ui_gl_waterfall.c +++ b/test/ui_gl_waterfall.c @@ -6,6 +6,9 @@ #include //radiola +//#define CONFIG_OS_LINUX +//#include +//#include #include #include #include @@ -329,4 +332,4 @@ main_exit: sdr_close( sdr ); return 0; -} \ No newline at end of file +} diff --git a/test/ui_tui_waterfall.c b/test/ui_tui_waterfall.c index cc63fc3..82362c1 100644 --- a/test/ui_tui_waterfall.c +++ b/test/ui_tui_waterfall.c @@ -8,14 +8,14 @@ #include #include -#define SAMPLE_RATE 2048000 - -#define CENTER_FREQ 445500000 -#define FFT_LEVEL 10 -#define FFT_SIZE (1 << FFT_LEVEL) -#define SAMPLE_LENGHT (2 * FFT_SIZE) -#define PRESCALE 8 -#define POSTSCALE 2 +#define SAMPLE_RATE 2048000 + +#define CENTER_FREQ 445500000 +#define FFT_LEVEL 10 +#define FFT_SIZE (1 << FFT_LEVEL) +#define SAMPLE_LENGHT (2 * FFT_SIZE) +#define PRESCALE 8 +#define POSTSCALE 2 int16_t* Sinewave; -- cgit v1.2.3