From 28a18d3e2fa2fd883b08b2bffca19309be1db140 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 8 Apr 2008 15:27:31 +0200 Subject: [PATCH] * Let the libmontiumc version output it's input and output in a matlab compatible format. * Use a longer period worth of sinus function. --- FFT_support.cpp | 52 ++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/FFT_support.cpp b/FFT_support.cpp index 7fc2484..2ddf150 100644 --- a/FFT_support.cpp +++ b/FFT_support.cpp @@ -6,7 +6,7 @@ #define FIXED_POINT 15 #define WORD_SIZE 16 -#define WORDS_PER_LINE 8 +#define WORDS_PER_LINE 4 #define WORDS_PER_GROUP 1 mem input_a_re, input_a_im, input_b_re, input_b_im, output_a_re, output_a_im, output_b_re, output_b_im, twiddle_re, twiddle_im; @@ -27,7 +27,7 @@ float from_fixed(int n) return n / (float)(1<id, i))); else printf("%04hx", (short)get_mem(m->id, i)); - if ((i + 1) % WORDS_PER_LINE == 0) + if (newline && (i + 1) % WORDS_PER_LINE == 0) printf("\n"); else if ((i + 1) % WORDS_PER_GROUP == 0) printf(" "); } - if (i % WORDS_PER_LINE != 0) + if (newline && i % WORDS_PER_LINE != 0) printf("\n"); } @@ -67,9 +67,9 @@ void pre_run() for (i=0;iid, 0, PARAM_N_t/2, "Memory/sin_a_re.mm"); save_mem_range_to_file(input_a_im->id, 0, PARAM_N_t/2, "Memory/sin_a_im.mm"); @@ -126,18 +131,21 @@ void post_run() output_b_re = alloc_mem(P2M1); output_b_im = alloc_mem(P3M1); } + printf("re_out = ["); + print_mem(output_a_re, 0, PARAM_N_t/2, true, false); + print_mem(output_b_re, 0, PARAM_N_t/2, true, false); + printf("];\n"); + printf("im_out = ["); + print_mem(output_a_im, 0, PARAM_N_t/2, true, false); + print_mem(output_b_im, 0, PARAM_N_t/2, true, false); + printf("];\n"); + /* printf("re(out)\n"); - print_mem(output_a_re, 0, PARAM_N_t/2, true); - print_mem(output_b_re, 0, PARAM_N_t/2, true); - printf("im(out)\n"); - print_mem(output_a_im, 0, PARAM_N_t/2, true); - print_mem(output_b_im, 0, PARAM_N_t/2, true); - - printf("re(out)\n"); - print_mem(output_a_re, 0, PARAM_N_t/2, false); - print_mem(output_b_re, 0, PARAM_N_t/2, false); + print_mem(output_a_re, 0, PARAM_N_t/2, false, true); + print_mem(output_b_re, 0, PARAM_N_t/2, false, true); printf("im(out)\n"); - print_mem(output_a_im, 0, PARAM_N_t/2, false); - print_mem(output_b_im, 0, PARAM_N_t/2, false); + print_mem(output_a_im, 0, PARAM_N_t/2, false, true); + print_mem(output_b_im, 0, PARAM_N_t/2, false, true); + */ } -- 2.30.2