52 int main(
int argc,
char** argv) {
55 fprintf(stdout,
"Usage: test_conv_semi_fly signal_file filter_file "
60 int bw = atoi(argv[4]);
63 double* rsignal = (
double*)malloc(
sizeof(
double) * size * size);
64 double* rfilter = (
double*)malloc(
sizeof(
double) * size * size);
67 fprintf(stdout,
"Reading signal file...\n");
68 FILE* fp = fopen(argv[1],
"r");
69 for (
int i = 0; i < size * size; ++i)
70 fscanf(fp,
"%lf", rsignal + i);
73 fprintf(stdout,
"Reading filter file...\n");
74 fp = fopen(argv[2],
"r");
75 for (
int i = 0; i < size * size; ++i)
76 fscanf(fp,
"%lf", rfilter + i);
81 double* isignal = (
double*)calloc((
size_t)(size * size),
sizeof(
double));
82 double* ifilter = (
double*)calloc((
size_t)(size * size),
sizeof(
double));
84 double* rresult = (
double*)malloc(
sizeof(
double) * size * size);
85 double* iresult = (
double*)malloc(
sizeof(
double) * size * size);
86 double* workspace = (
double*)malloc(
sizeof(
double) * (14 * bw * bw + 26 * bw));
88 fprintf(stdout,
"Calling ConvOn2SphereSemiFly()\n");
93 fprintf(stdout,
"Writing output file...\n");
94 fp = fopen(argv[3],
"w");
95 for (
int i = 0; i < size * size; ++i)
96 fprintf(fp,
"%.16f\n", rresult[i]);