53 int main(
int argc,
char** argv) {
55 fprintf(stdout,
"Usage: test_conv_semi_memo signal_file filter_file output_file bw\n");
59 int bw = atoi(argv[4]);
65 double* rsignal = (
double*)malloc(
sizeof(
double) * size * size);
66 double* rfilter = (
double*)malloc(
sizeof(
double) * size * size);
69 fprintf(stdout,
"Reading signal file...\n");
70 FILE* fp = fopen(argv[1],
"r");
71 for (
int i = 0; i < size * size; ++i)
72 fscanf(fp,
"%lf", rsignal + i);
75 fprintf(stdout,
"Reading filter file...\n");
76 fp = fopen(argv[2],
"r");
77 for (
int i = 0; i < size * size; ++i)
78 fscanf(fp,
"%lf", rfilter + i);
83 double* isignal = (
double*)calloc((
size_t)(size * size),
sizeof(
double));
84 double* ifilter = (
double*)calloc((
size_t)(size * size),
sizeof(
double));
86 double* rresult = (
double*)malloc(
sizeof(
double) * size * size);
87 double* iresult = (
double*)malloc(
sizeof(
double) * size * size);
88 double* workspace = (
double*)malloc(
sizeof(
double) * (2 * legendreSize + 12 * bw * bw + 12 * bw));
90 fprintf(stdout,
"Calling ConvOn2SphereSemiMemo()\n");
95 fprintf(stdout,
"Writing output file...\n");
96 fp = fopen(argv[3],
"w");
97 for (
int i = 0; i < size * size; ++i)
98 fprintf(fp,
"%.16f\n", rresult[i]);