fastddc_inv_cc is now controllable via --fd and --fifo.
This commit is contained in:
parent
35b3f631d6
commit
5fede66e27
4 changed files with 37 additions and 18 deletions
35
csdr.c
35
csdr.c
|
@ -1808,22 +1808,38 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !strcmp(argv[1],"fastddc_inv_cc") ) //<decimation> <shift_rate> [transition_bw [window]]
|
if( !strcmp(argv[1],"fastddc_inv_cc") ) //<shift_rate> <decimation> [transition_bw [window]]
|
||||||
{
|
{
|
||||||
int decimation;
|
|
||||||
if(argc<=2) return badsyntax("need required parameter (decimation)");
|
|
||||||
sscanf(argv[2],"%d",&decimation);
|
|
||||||
|
|
||||||
float shift_rate;
|
float shift_rate;
|
||||||
if(argc>3) sscanf(argv[3],"%g",&shift_rate);
|
int plusarg=0;
|
||||||
|
|
||||||
|
int fd;
|
||||||
|
if(fd=init_fifo(argc,argv))
|
||||||
|
{
|
||||||
|
while(!read_fifo_ctl(fd,"%g\n",&shift_rate)) usleep(10000);
|
||||||
|
plusarg=1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(argc<=2) return badsyntax("need required parameter (rate)");
|
||||||
|
sscanf(argv[2],"%g",&shift_rate);
|
||||||
|
}
|
||||||
|
|
||||||
|
int decimation;
|
||||||
|
if(argc<=3+plusarg) return badsyntax("need required parameter (decimation)");
|
||||||
|
sscanf(argv[3+plusarg],"%d",&decimation);
|
||||||
|
//fprintf(stderr, "dec=%d %d\n", decimation);
|
||||||
|
|
||||||
float transition_bw = 0.05;
|
float transition_bw = 0.05;
|
||||||
if(argc>4) sscanf(argv[4],"%g",&transition_bw);
|
if(argc>4+plusarg) sscanf(argv[4+plusarg],"%g",&transition_bw);
|
||||||
|
|
||||||
window_t window = WINDOW_DEFAULT;
|
window_t window = WINDOW_DEFAULT;
|
||||||
if(argc>5) window=firdes_get_window_from_string(argv[5]);
|
if(argc>5+plusarg) window=firdes_get_window_from_string(argv[5+plusarg]);
|
||||||
else fprintf(stderr,"fastddc_apply_cc: window = %s\n",firdes_get_string_from_window(window));
|
else fprintf(stderr,"fastddc_apply_cc: window = %s\n",firdes_get_string_from_window(window));
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
|
||||||
fastddc_t ddc;
|
fastddc_t ddc;
|
||||||
if(fastddc_init(&ddc, transition_bw, decimation, shift_rate)) { badsyntax("error in fastddc_init()"); return 1; }
|
if(fastddc_init(&ddc, transition_bw, decimation, shift_rate)) { badsyntax("error in fastddc_init()"); return 1; }
|
||||||
fastddc_print(&ddc,"fastddc_inv_cc");
|
fastddc_print(&ddc,"fastddc_inv_cc");
|
||||||
|
@ -1864,6 +1880,9 @@ int main(int argc, char *argv[])
|
||||||
fwrite(output, sizeof(complexf), shift_stat.output_size, stdout);
|
fwrite(output, sizeof(complexf), shift_stat.output_size, stdout);
|
||||||
//fprintf(stderr, "ss os = %d\n", shift_stat.output_size);
|
//fprintf(stderr, "ss os = %d\n", shift_stat.output_size);
|
||||||
TRY_YIELD;
|
TRY_YIELD;
|
||||||
|
if(read_fifo_ctl(fd,"%g\n",&shift_rate)) break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
ddcd.cpp
2
ddcd.cpp
|
@ -479,7 +479,7 @@ void client()
|
||||||
sprintf(client_subprocess_cmd_buf, subprocess_cmd_td, pipe_ctl[0], decimation, transition_bw);
|
sprintf(client_subprocess_cmd_buf, subprocess_cmd_td, pipe_ctl[0], decimation, transition_bw);
|
||||||
break;
|
break;
|
||||||
case M_FASTDDC:
|
case M_FASTDDC:
|
||||||
sprintf(client_subprocess_cmd_buf, subprocess_args_fastddc_2, decimation, pipe_ctl[0], transition_bw);
|
sprintf(client_subprocess_cmd_buf, subprocess_args_fastddc_2, pipe_ctl[0], decimation, transition_bw);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
8
ddcd.h
8
ddcd.h
|
@ -56,7 +56,7 @@ const char subprocess_cmd_td[] = "csdr "
|
||||||
#endif
|
#endif
|
||||||
" --fd %d | csdr fir_decimate_cc %d %g";
|
" --fd %d | csdr fir_decimate_cc %d %g";
|
||||||
|
|
||||||
//const char subprocess_args_fastddc_1[] = "csdr fastddc_fwd_cc %d %g";
|
const char subprocess_args_fastddc_1[] = "csdr fastddc_fwd_cc %d %g";
|
||||||
const char subprocess_args_fastddc_1[] = "csdr through %d %g";
|
//const char subprocess_args_fastddc_1[] = "csdr through %d %g";
|
||||||
//const char subprocess_args_fastddc_2[] = "csdr fastddc_inv_cc %d --pipe %d %g";
|
const char subprocess_args_fastddc_2[] = "csdr fastddc_inv_cc --fd %d %d %g";
|
||||||
const char subprocess_args_fastddc_2[] = "csdr convert_u8_f %d %d %g";
|
//const char subprocess_args_fastddc_2[] = "csdr convert_u8_f %d %d %g";
|
||||||
|
|
|
@ -257,7 +257,7 @@
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>_coordinate</key>
|
<key>_coordinate</key>
|
||||||
<value>(112, 875)</value>
|
<value>(112, 675)</value>
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>_rotation</key>
|
<key>_rotation</key>
|
||||||
|
@ -375,7 +375,7 @@
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>_coordinate</key>
|
<key>_coordinate</key>
|
||||||
<value>(136, 763)</value>
|
<value>(368, 691)</value>
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>_rotation</key>
|
<key>_rotation</key>
|
||||||
|
@ -465,7 +465,7 @@
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>commandline</key>
|
<key>commandline</key>
|
||||||
<value>csdr fastddc_fwd_cc %d | csdr fastddc_inv_cc %d 0.4"%(decimation,decimation)+"</value>
|
<value>csdr fastddc_fwd_cc %d | csdr fastddc_inv_cc 0.4 %d"%(decimation,decimation)+"</value>
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>comment</key>
|
<key>comment</key>
|
||||||
|
@ -690,7 +690,7 @@
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>_coordinate</key>
|
<key>_coordinate</key>
|
||||||
<value>(616, 379)</value>
|
<value>(616, 291)</value>
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>_rotation</key>
|
<key>_rotation</key>
|
||||||
|
@ -789,7 +789,7 @@
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>_coordinate</key>
|
<key>_coordinate</key>
|
||||||
<value>(400, 691)</value>
|
<value>(576, 619)</value>
|
||||||
</param>
|
</param>
|
||||||
<param>
|
<param>
|
||||||
<key>_rotation</key>
|
<key>_rotation</key>
|
||||||
|
|
Loading…
Reference in a new issue