diff --git a/csdr.c b/csdr.c index 0c415ee..5cc9f15 100755 --- a/csdr.c +++ b/csdr.c @@ -3039,22 +3039,26 @@ int main(int argc, char *argv[]) { if(argc<=2) return badsyntax("required parameter is missing."); matched_filter_type_t type = matched_filter_get_type_from_string(argv[2]); - int samples_per_symbol = 0; + int samples_per_symbol = 0; if(argc<=3) return badsyntax("required parameter is missing."); sscanf(argv[3],"%d",&samples_per_symbol); int num_taps = 0; - if(argc<=4 && type!=MATCHED_FILTER_COSINE) - return badsyntax("required parameter is missing."); - sscanf(argv[4],"%d",&num_taps); + if(type!=MATCHED_FILTER_COSINE) + { + if(argc<=4) return badsyntax("required parameter is missing."); + sscanf(argv[4],"%d",&num_taps); + } + else num_taps = (2*samples_per_symbol)+1; float beta = 0; - if(argc<=5 && type==MATCHED_FILTER_RRC) - return badsyntax("required parameter is missing."); - sscanf(argv[5],"%f",&beta); + if(type==MATCHED_FILTER_RRC) + { + if(argc<=5) return badsyntax("required parameter is missing."); + sscanf(argv[5],"%f",&beta); + } - if(type==MATCHED_FILTER_COSINE) num_taps = (2*samples_per_symbol)+1; float* taps = (float*)malloc(sizeof(float)*num_taps); switch(type) { @@ -3065,6 +3069,7 @@ int main(int argc, char *argv[]) firdes_cosine_f(taps, num_taps, samples_per_symbol); break; } + //fprintf(stderr, "beta = %f, num_taps = %d, samples_per_symbol = %d\n", beta, num_taps, samples_per_symbol); if(!sendbufsize(initialize_buffers())) return -2; diff --git a/libcsdr.c b/libcsdr.c index 89e4b10..ced77c1 100755 --- a/libcsdr.c +++ b/libcsdr.c @@ -2371,13 +2371,13 @@ int firdes_rrc_f(float* taps, int taps_length, int samples_per_symbol, float bet { //needs an odd taps_length int middle_i=taps_length/2; - taps[middle_i]=(1/samples_per_symbol)*(1+beta*(4/PI-1)); - for(int i=1;i