From 84d23227f3e7f442cb0533ea87c74c61ea97e9ae Mon Sep 17 00:00:00 2001 From: ha7ilm Date: Mon, 1 May 2017 13:09:42 +0200 Subject: [PATCH] Added plain_interpolate_cc --- csdr.c | 22 ++++++++++++++++++++++ libcsdr.c | 10 ++++++++++ libcsdr.h | 1 + 3 files changed, 33 insertions(+) diff --git a/csdr.c b/csdr.c index 5cc9f15..feff244 100755 --- a/csdr.c +++ b/csdr.c @@ -143,7 +143,11 @@ char usage[]= " gaussian_noise_c\n" " awgn_cc [--snrshow]\n" " pack_bits_8to1_u8_u8\n" +" firdes_matched_filter_f (RRC | COSINE )\n" +" matched_filter_cc (RRC | COSINE )\n" " add_n_zero_samples_at_beginning_f \n" +" generic_slicer_f_u8 \n" +" plain_interpolate_cc \n" " ?\n" " =\n" " \n" @@ -3106,6 +3110,24 @@ int main(int argc, char *argv[]) return 0; } + if(!strcmp(argv[1], "plain_interpolate_cc")) // + { + int interpolation = 0; + if(argc<=2) return badsyntax("required parameter is missing."); + sscanf(argv[2],"%d",&interpolation); + if(!sendbufsize(interpolation*initialize_buffers())) return -2; + complexf* plainint_output_buffer = (complexf*)malloc(sizeof(complexf)*the_bufsize*interpolation); + for(;;) + { + FEOF_CHECK; + FREAD_C; + plain_interpolate_cc((complexf*)input_buffer, plainint_output_buffer, the_bufsize, interpolation); + fwrite(plainint_output_buffer, sizeof(float)*2, the_bufsize*interpolation, stdout); + TRY_YIELD; + } + return 0; + } + if(!strcmp(argv[1],"none")) { return 0; diff --git a/libcsdr.c b/libcsdr.c index ced77c1..15a147b 100755 --- a/libcsdr.c +++ b/libcsdr.c @@ -2383,6 +2383,15 @@ int firdes_rrc_f(float* taps, int taps_length, int samples_per_symbol, float bet } } +void plain_interpolate_cc(complexf* input, complexf* output, int input_size, int interpolation) +{ + for(int i=0;i