aboutsummaryrefslogtreecommitdiffstats
path: root/src/cnetz
diff options
context:
space:
mode:
Diffstat (limited to 'src/cnetz')
-rw-r--r--src/cnetz/cnetz.h2
-rw-r--r--src/cnetz/dsp.c6
-rw-r--r--src/cnetz/scrambler.c4
-rw-r--r--src/cnetz/scrambler.h4
4 files changed, 8 insertions, 8 deletions
diff --git a/src/cnetz/cnetz.h b/src/cnetz/cnetz.h
index b9b434a..2eb51a6 100644
--- a/src/cnetz/cnetz.h
+++ b/src/cnetz/cnetz.h
@@ -88,7 +88,7 @@ typedef struct cnetz {
/* dsp states */
enum dsp_mode dsp_mode; /* current mode: audio, "Telegramm", .... */
- filter_t lp; /* low pass filter to eliminate noise above 5280 Hz */
+ iir_filter_t lp; /* low pass filter to eliminate noise above 5280 Hz */
fsk_fm_demod_t fsk_demod; /* demod process */
double fsk_deviation; /* deviation of FSK signal on sound card */
sample_t fsk_ramp_up[256]; /* samples of upward ramp shape */
diff --git a/src/cnetz/dsp.c b/src/cnetz/dsp.c
index 40b2bc6..a74a749 100644
--- a/src/cnetz/dsp.c
+++ b/src/cnetz/dsp.c
@@ -123,7 +123,7 @@ int dsp_init_sender(cnetz_t *cnetz, int measure_speed, double clock_speed[2])
dsp_init_ramp(cnetz);
/* init low pass filter for received signal */
- filter_lowpass_init(&cnetz->lp, MAX_MODULATION, cnetz->sender.samplerate, 2);
+ iir_lowpass_init(&cnetz->lp, MAX_MODULATION, cnetz->sender.samplerate, 2);
/* create speech buffer */
cnetz->dsp_speech_buffer = calloc(sizeof(sample_t), cnetz->sender.samplerate); /* buffer is greater than sr/1.1, just to be secure */
@@ -134,7 +134,7 @@ int dsp_init_sender(cnetz_t *cnetz, int measure_speed, double clock_speed[2])
}
/* reinit the sample rate to shrink/expand audio */
- init_samplerate(&cnetz->sender.srstate, 0x8000, (double)cnetz->sender.samplerate / 1.1); /* 66 <-> 60 */
+ init_samplerate(&cnetz->sender.srstate, 8000.0, (double)cnetz->sender.samplerate / 1.1, 3300.0); /* 66 <-> 60 */
rc = fsk_fm_init(&cnetz->fsk_demod, cnetz, cnetz->sender.samplerate, (double)BITRATE / (1.0 + clock_speed[0] / 1000000.0));
if (rc < 0)
@@ -584,7 +584,7 @@ void sender_receive(sender_t *sender, sample_t *samples, int length)
#endif
if (cnetz->dsp_mode != DSP_MODE_OFF) {
- filter_process(&cnetz->lp, samples, length);
+ iir_process(&cnetz->lp, samples, length);
fsk_fm_demod(&cnetz->fsk_demod, samples, length);
}
return;
diff --git a/src/cnetz/scrambler.c b/src/cnetz/scrambler.c
index f5adc03..ad57b08 100644
--- a/src/cnetz/scrambler.c
+++ b/src/cnetz/scrambler.c
@@ -50,7 +50,7 @@ void scrambler_init(void)
void scrambler_setup(scrambler_t *scrambler, int samplerate)
{
- filter_lowpass_init(&scrambler->lp, CARRIER_HZ - FILTER_BELOW, samplerate, FILTER_TURNS);
+ iir_lowpass_init(&scrambler->lp, CARRIER_HZ - FILTER_BELOW, samplerate, FILTER_TURNS);
scrambler->carrier_phaseshift65536 = 65536.0 / ((double)samplerate / CARRIER_HZ);
}
@@ -77,7 +77,7 @@ void scrambler(scrambler_t *scrambler, sample_t *samples, int length)
scrambler->carrier_phase65536 = phase;
/* cut off carrier frequency and modulation above carrier frequency */
- filter_process(&scrambler->lp, samples, length);
+ iir_process(&scrambler->lp, samples, length);
}
diff --git a/src/cnetz/scrambler.h b/src/cnetz/scrambler.h
index 19adba7..f06e4ac 100644
--- a/src/cnetz/scrambler.h
+++ b/src/cnetz/scrambler.h
@@ -1,9 +1,9 @@
-#include "../common/filter.h"
+#include "../common/iir_filter.h"
typedef struct scrambler {
double carrier_phaseshift65536;/* carrier phase shift per sample */
double carrier_phase65536; /* current phase of carrier frequency */
- filter_t lp; /* filter to remove carrier frequency */
+ iir_filter_t lp; /* filter to remove carrier frequency */
} scrambler_t;
void scrambler_init(void);