From: drowe67 Date: Tue, 19 Aug 2014 10:24:55 +0000 (+0000) Subject: made both args shorts for 8-16 kHz sample rate conversion X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=6bccf0a07fe3b19bf74d950e58595ffabea5ac42;p=freetel-svn-tracking.git made both args shorts for 8-16 kHz sample rate conversion git-svn-id: https://svn.code.sf.net/p/freetel/code@1810 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/src/codec2_fdmdv.h b/codec2-dev/src/codec2_fdmdv.h index 8e8978dc..df1d3725 100644 --- a/codec2-dev/src/codec2_fdmdv.h +++ b/codec2-dev/src/codec2_fdmdv.h @@ -109,9 +109,9 @@ void fdmdv_get_demod_stats(struct FDMDV *fdmdv_state, struct FDMDV_STA void fdmdv_get_rx_spectrum(struct FDMDV *fdmdv_state, float mag_dB[], COMP rx_fdm[], int nin); void fdmdv_8_to_16(float out16k[], float in8k[], int n); -void fdmdv_8_to_16_short(short out16k[], float in8k[], int n); +void fdmdv_8_to_16_short(short out16k[], short in8k[], int n); void fdmdv_16_to_8(float out8k[], float in16k[], int n); -void fdmdv_16_short_to_8(float out8k[], short in16k[], int n); +void fdmdv_16_to_8_short(short out8k[], short in16k[], int n); void fdmdv_freq_shift(COMP rx_fdm_fcorr[], COMP rx_fdm[], float foff, COMP *foff_phase_rect, int nin); diff --git a/codec2-dev/src/fdmdv.c b/codec2-dev/src/fdmdv.c index b40bad53..fd0f3554 100644 --- a/codec2-dev/src/fdmdv.c +++ b/codec2-dev/src/fdmdv.c @@ -1740,7 +1740,7 @@ void fdmdv_8_to_16(float out16k[], float in8k[], int n) } -void fdmdv_8_to_16_short(short out16k[], float in8k[], int n) +void fdmdv_8_to_16_short(short out16k[], short in8k[], int n) { int i,j,k,l; float acc; @@ -1754,7 +1754,7 @@ void fdmdv_8_to_16_short(short out16k[], float in8k[], int n) for(j=0; j +#include +#include +#include +#include "codec2_fdmdv.h" + +#define N8 160 /* procssing buffer size at 8 kHz */ +#define N16 (N8*FDMDV_OS) +#define FRAMES 100 +#define TWO_PI 6.283185307 +#define FS 16000 + +#define SINE + +int main() { + short in8k_short[FDMDV_OS_TAPS_8K + N8]; + short out16k_short[N16]; + FILE *f16; + + short in16k_short[FDMDV_OS_TAPS_16K + N16]; + short out8k_short[N16]; + FILE *f8; + + int i,f,t,t1; + float freq = 800.0; + + f16 = fopen("out16_short.raw", "wb"); + assert(f16 != NULL); + f8 = fopen("out8.raw", "wb"); + assert(f8 != NULL); + + /* clear filter memories */ + + for(i=0; i -#include -#include -#include -#include "codec2_fdmdv.h" - -#define N8 160 /* procssing buffer size at 8 kHz */ -#define N16 (N8*FDMDV_OS) -#define FRAMES 100 -#define TWO_PI 6.283185307 -#define FS 16000 - -#define SINE - -int main() { - float in8k[FDMDV_OS_TAPS_8K + N8]; - short out16k_short[N16]; - FILE *f16; - - short in16k_short[FDMDV_OS_TAPS_16K + N16]; - float out8k[N16]; - short out8k_short[N8]; - FILE *f8; - - int i,f,t,t1; - float freq = 800.0; - - f16 = fopen("out16_short.raw", "wb"); - assert(f16 != NULL); - f8 = fopen("out8.raw", "wb"); - assert(f8 != NULL); - - /* clear filter memories */ - - for(i=0; i