summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--draw/tui.c4
-rw-r--r--filt/f_5th.c32
-rw-r--r--filt/filt.h11
-rw-r--r--filt/make.mk10
-rw-r--r--mod/make.mk10
-rw-r--r--mod/mod.h11
-rw-r--r--mod/mod_fm.c12
-rw-r--r--test/ui_tui_waterfall.c2
9 files changed, 92 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 2955502..788987c 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,9 @@ OBJECTS=
OBJECTS_FINAL=
include draw/make.mk
+include filt/make.mk
include hw/make.mk
+include mod/make.mk
make: $(OBJECTS)
$(CC) $(OBJECTS_FINAL) $(PROJECT).c -o $(PROJECT) $(LDFLAGS)
diff --git a/draw/tui.c b/draw/tui.c
index ba6ed1e..c431a61 100644
--- a/draw/tui.c
+++ b/draw/tui.c
@@ -190,6 +190,7 @@ uint8_t tui_waterfall_color( uint8_t d )
uint8_t color=15;
+
/*
if ( d < 50 )
{
@@ -210,6 +211,7 @@ uint8_t tui_waterfall_color( uint8_t d )
*/
+
if ( d == 0 )
{
color = 17;
@@ -236,7 +238,7 @@ uint8_t tui_waterfall_color( uint8_t d )
color = 44;
} else
{
- color = 230;
+ color = 45;
}
/*
diff --git a/filt/f_5th.c b/filt/f_5th.c
new file mode 100644
index 0000000..811fb18
--- /dev/null
+++ b/filt/f_5th.c
@@ -0,0 +1,32 @@
+#include "filt.h"
+
+void f_5th(int16_t *data, int length, int16_t *hist)
+/* for half of interleaved data */
+{
+ int i;
+ int16_t a, b, c, d, e, f;
+ a = hist[1];
+ b = hist[2];
+ c = hist[3];
+ d = hist[4];
+ e = hist[5];
+ f = data[0];
+ /* a downsample should improve resolution, so don't fully shift */
+ data[0] = (a + (b+e)*5 + (c+d)*10 + f) >> 4;
+ for (i=4; i<length; i+=4) {
+ a = c;
+ b = d;
+ c = e;
+ d = f;
+ e = data[i-2];
+ f = data[i];
+ data[i/2] = (a + (b+e)*5 + (c+d)*10 + f) >> 4;
+ }
+ /* archive */
+ hist[0] = a;
+ hist[1] = b;
+ hist[2] = c;
+ hist[3] = d;
+ hist[4] = e;
+ hist[5] = f;
+} \ No newline at end of file
diff --git a/filt/filt.h b/filt/filt.h
new file mode 100644
index 0000000..d235449
--- /dev/null
+++ b/filt/filt.h
@@ -0,0 +1,11 @@
+#ifndef __RADIOLA_FILT_H
+#define __RADIOLA_FILT_H
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+//fifth order filter from rtlsdr
+void f_5th(int16_t *data, int length, int16_t *hist);
+
+#endif \ No newline at end of file
diff --git a/filt/make.mk b/filt/make.mk
new file mode 100644
index 0000000..e65653c
--- /dev/null
+++ b/filt/make.mk
@@ -0,0 +1,10 @@
+DIR_FILT = filt/
+SOURCES_FILT += filt/f_5th.c
+OBJECTS_FILT += $(SOURCES_FILT:.c=.o)
+LDFLAGS +=
+
+
+OBJECTS_DIR_FILT += $(subst $(DIR_FILT),$(BUILD_DIR)$(DIR_FILT),$(OBJECTS_FILT))
+
+OBJECTS += $(OBJECTS_FILT)
+OBJECTS_FINAL += $(OBJECTS_DIR_FILT) \ No newline at end of file
diff --git a/mod/make.mk b/mod/make.mk
new file mode 100644
index 0000000..6093819
--- /dev/null
+++ b/mod/make.mk
@@ -0,0 +1,10 @@
+DIR_MOD = mod/
+SOURCES_MOD += mod/mod_fm.c
+OBJECTS_MOD += $(SOURCES_MOD:.c=.o)
+LDFLAGS +=
+
+
+OBJECTS_DIR_MOD += $(subst $(DIR_MOD),$(BUILD_DIR)$(DIR_MOD),$(OBJECTS_MOD))
+
+OBJECTS += $(OBJECTS_MOD)
+OBJECTS_FINAL += $(OBJECTS_DIR_MOD) \ No newline at end of file
diff --git a/mod/mod.h b/mod/mod.h
new file mode 100644
index 0000000..288d40b
--- /dev/null
+++ b/mod/mod.h
@@ -0,0 +1,11 @@
+#ifndef __RADIOLA_MOD_H
+#define __RADIOLA_MOD_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+void fm_demod();
+void fm_mod();
+
+#endif \ No newline at end of file
diff --git a/mod/mod_fm.c b/mod/mod_fm.c
new file mode 100644
index 0000000..22b296b
--- /dev/null
+++ b/mod/mod_fm.c
@@ -0,0 +1,12 @@
+#include "mod.h"
+
+
+void fm_demod()
+{
+
+}
+
+void fm_mod()
+{
+
+}
diff --git a/test/ui_tui_waterfall.c b/test/ui_tui_waterfall.c
index bc4f297..46445b0 100644
--- a/test/ui_tui_waterfall.c
+++ b/test/ui_tui_waterfall.c
@@ -9,7 +9,7 @@
#define SAMPLE_RATE 2048000
-#define CENTER_FREQ 446500000
+#define CENTER_FREQ 445500000
#define FFT_LEVEL 10
#define FFT_SIZE (1 << FFT_LEVEL)
#define SAMPLE_LENGHT (2 * FFT_SIZE)