From 4380bec6fa5bfbda51a30371e17c19b7dd1dda6d Mon Sep 17 00:00:00 2001 From: ha7ilm Date: Mon, 30 Nov 2015 00:20:22 +0100 Subject: [PATCH] Tested all shifts, and they seem to work! --- grc_tests/test_shift.grc | 2573 ++++++++++++++++++++++++-------------- libcsdr.c | 39 + test200.c | 9 + 3 files changed, 1653 insertions(+), 968 deletions(-) diff --git a/grc_tests/test_shift.grc b/grc_tests/test_shift.grc index 9fc1eb7..0b48387 100644 --- a/grc_tests/test_shift.grc +++ b/grc_tests/test_shift.grc @@ -1,49 +1,49 @@ - - + + Thu Jan 15 18:51:48 2015 options - - id - top_block - - - _enabled - True - - - title - - author - - description - - window_size 1280, 1024 - - generate_options - wx_gui - category Custom - run_options - prompt + comment + - run + description + + + + _enabled True + + _coordinate + (10, 10) + + + _rotation + 0 + + + generate_options + wx_gui + + + id + top_block + max_nouts 0 @@ -53,63 +53,32 @@ - alias + run_options + prompt + + + run + True + + + thread_safe_setters - _coordinate - (10, 10) - - - _rotation - 0 + title + variable - id - rate + comment + _enabled True - - value - -0.055 - - - alias - - - - _coordinate - (8, 195) - - - _rotation - 0 - - - - variable - - id - decimation - - - _enabled - True - - - value - 3 - - - alias - - _coordinate (16, 267) @@ -118,25 +87,111 @@ _rotation 0 - - - variable id - samp_rate + decimation + + + value + 3 + + + + variable_slider + + comment + + + + converver + float_converter + + + value + 0 _enabled True - value - 250e3 + _coordinate + (184, 219) - alias + _rotation + 0 + + + grid_pos + + id + gen_freq + + + label + + + + max + samp_rate/2 + + + min + -samp_rate/2 + + + notebook + + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (8, 195) + + + _rotation + 0 + + + id + rate + + + value + -0.055 + + + + variable + + comment + + + + _enabled + True + _coordinate (176, 11) @@ -145,16 +200,64 @@ _rotation 0 + + id + samp_rate + + + value + 250e3 + analog_sig_source_x + + amp + 1 + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + freq + gen_freq + + + _coordinate + (8, 67) + + + _rotation + 0 + id analog_sig_source_x_0 - _enabled - True + maxoutbuf + 0 + + + minoutbuf + 0 + + + offset + 0 type @@ -166,605 +269,217 @@ waveform - analog.GR_CONST_WAVE - - - freq - 20000 - - - amp - 1 - - - offset - 0 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (8, 75) - - - _rotation - 0 - - - - ha5kfu_execproc_xx - - id - ha5kfu_execproc_xx_0 - - - _enabled - True - - - type - cc - - - commandline - "csdr shift_math_cc %g"%rate - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (488, 251) - - - _rotation - 0 - - - - ha5kfu_execproc_xx - - id - ha5kfu_execproc_xx_0_0 - - - _enabled - True - - - type - cc - - - commandline - "csdr shift_addition_cc %g"%rate - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (472, 411) - - - _rotation - 0 - - - - notebook - - id - nb0 - - - _enabled - True - - - style - wx.NB_TOP - - - labels - ['shift_math_cc', 'shift_addition_cc', 'shift_table_cc', 'decimating_shift_addition_cc','original'] - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (272, 11) - - - _rotation - 0 - - - - wxgui_fftsink2 - - id - wxgui_fftsink2_0_0 - - - _enabled - True - - - type - complex - - - title - FFT Plot - - - samp_rate - samp_rate - - - baseband_freq - 0 - - - y_per_div - 10 - - - y_divs - 10 - - - ref_level - 0 - - - ref_scale - 2.0 - - - fft_size - 1024 - - - fft_rate - 15 - - - peak_hold - False - - - average - False - - - avg_alpha - 0 - - - win - None - - - win_size - - - - grid_pos - - - - notebook - nb0,4 - - - freqvar - None - - - alias - - - - affinity - - - - _coordinate - (496, 27) - - - _rotation - 0 + analog.GR_SIN_WAVE blocks_throttle - id - blocks_throttle_0 + alias + + + + comment + + + + affinity + _enabled True - type - complex + _coordinate + (224, 99) - samples_per_second - samp_rate + _rotation + 0 - vlen - 1 + id + blocks_throttle_0 ignoretag True - alias - - - - affinity - + maxoutbuf + 0 minoutbuf 0 - maxoutbuf - 0 - - - _coordinate - (224, 107) - - - _rotation - 0 - - - - wxgui_scopesink2 - - id - wxgui_scopesink2_0_0_0 - - - _enabled - True - - - type - complex - - - title - Scope Plot - - - samp_rate + samples_per_second samp_rate - - v_scale - 0 - - - v_offset - 0 - - - t_scale - 0 - - - ac_couple - False - - - xy_mode - False - - - num_inputs - 1 - - - win_size - - - - grid_pos - - - - notebook - nb0,2 - - - trig_mode - wxgui.TRIG_MODE_NORM - - - y_axis_label - Counts - - - alias - - - - affinity - - - - _coordinate - (1080, 899) - - - _rotation - 0 - - - - wxgui_fftsink2 - - id - wxgui_fftsink2_0_1_0_0 - - - _enabled - True - type complex - title - FFT Plot - - - samp_rate - samp_rate/decimation - - - baseband_freq - 0 - - - y_per_div - 10 - - - y_divs - 10 - - - ref_level - 0 - - - ref_scale - 2.0 - - - fft_size - 1024 - - - fft_rate - 15 - - - peak_hold - False - - - average - False - - - avg_alpha - 0 - - - win - None - - - win_size - - - - grid_pos - - - - notebook - nb0,3 - - - freqvar - None - - - alias - - - - affinity - - - - _coordinate - (320, 667) - - - _rotation - 0 - - - - wxgui_scopesink2 - - id - wxgui_scopesink2_0_0_0_0 - - - _enabled - True - - - type - complex - - - title - Scope Plot - - - samp_rate - samp_rate/decimation - - - v_scale - 0 - - - v_offset - 0 - - - t_scale - 0 - - - ac_couple - False - - - xy_mode - False - - - num_inputs + vlen 1 - - win_size - - - - grid_pos - - - - notebook - nb0,3 - - - trig_mode - wxgui.TRIG_MODE_NORM - - - y_axis_label - Counts - - - alias - - - - affinity - - - - _coordinate - (320, 883) - - - _rotation - 0 - ha5kfu_execproc_xx - id - ha5kfu_execproc_xx_0_0_0_0 + alias + + + + commandline + "csdr shift_math_cc %g"%rate + + + comment + + + + affinity + _enabled True + + _coordinate + (832, 99) + + + _rotation + 0 + + + id + ha5kfu_execproc_xx_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + type cc + + + ha5kfu_execproc_xx + + alias + + + + commandline + "csdr shift_addition_cc %g"%rate + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (824, 443) + + + _rotation + 0 + + + id + ha5kfu_execproc_xx_0_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + cc + + + + ha5kfu_execproc_xx + + alias + + + + commandline + "csdr shift_table_cc %g 32768"%rate + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (824, 931) + + + _rotation + 0 + + + id + ha5kfu_execproc_xx_0_0_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + cc + + + + ha5kfu_execproc_xx + + alias + + commandline "csdr decimating_shift_addition_cc %g %d"%(rate, decimation) - alias + comment @@ -772,12 +487,8 @@ - minoutbuf - 0 - - - maxoutbuf - 0 + _enabled + True _coordinate @@ -787,83 +498,221 @@ _rotation 0 - - - ha5kfu_execproc_xx id - ha5kfu_execproc_xx_0_0_0 + ha5kfu_execproc_xx_0_0_0_0 - _enabled - True + maxoutbuf + 0 + + + minoutbuf + 0 type cc - - commandline - "csdr shift_table_cc %g 32768"%rate - + + + ha5kfu_execproc_xx alias + + commandline + "csdr shift_addfast_cc %g"%rate + + + comment + + affinity - minoutbuf + _enabled + True + + + _coordinate + (608, 603) + + + _rotation 0 + + id + ha5kfu_execproc_xx_0_1 + maxoutbuf 0 - _coordinate - (824, 771) + minoutbuf + 0 - _rotation - 0 + type + cc - wxgui_fftsink2 + ha5kfu_execproc_xx - id - wxgui_fftsink2_0_1_0 + alias + + + + commandline + "csdr shift_unroll_cc %g"%rate + + + comment + + + + affinity + _enabled True + + _coordinate + (104, 563) + + + _rotation + 0 + + + id + ha5kfu_execproc_xx_0_1_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + type - complex + cc + + + + notebook + + alias + - title - FFT Plot + comment + - samp_rate - samp_rate + _enabled + True + + + _coordinate + (272, 11) + + + _rotation + 0 + + + grid_pos + + + + id + nb0 + + + labels + ['shift_math_cc', 'shift_addition_cc', 'shift_table_cc', 'decimating_shift_addition_cc','shift_addfast_cc','shift_unroll_cc','original'] + + + notebook + + + + style + wx.NB_TOP + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False baseband_freq 0 - y_per_div - 10 + alias + - y_divs - 10 + comment + + + + affinity + + + + _enabled + True + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (1096, 19) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0 + + + notebook + nb0,0 + + + peak_hold + False ref_level @@ -873,54 +722,283 @@ ref_scale 2.0 - - fft_size - 1024 - fft_rate 15 - peak_hold - False + samp_rate + samp_rate - average - False + title + FFT Plot - avg_alpha - 0 - - - win - None + type + complex win_size - grid_pos - - - - notebook - nb0,2 - - - freqvar + win None + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + 0 + alias + + comment + + affinity + + _enabled + True + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (848, 187) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0_0 + + + notebook + nb0,6 + + + peak_hold + False + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + FFT Plot + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (1096, 355) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0_1 + + + notebook + nb0,1 + + + peak_hold + False + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + FFT Plot + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + fft_size + 1024 + + + freqvar + None + _coordinate (1080, 691) @@ -929,123 +1007,21 @@ _rotation 0 - - - wxgui_scopesink2 - - id - wxgui_scopesink2_0_0 - - - _enabled - True - - - type - complex - - - title - Scope Plot - - - samp_rate - samp_rate - - - v_scale - 0 - - - v_offset - 0 - - - t_scale - 0 - - - ac_couple - False - - - xy_mode - False - - - num_inputs - 1 - - - win_size - - grid_pos - - notebook - nb0,1 - - - trig_mode - wxgui.TRIG_MODE_NORM - - - y_axis_label - Counts - - - alias - - - - affinity - - - - _coordinate - (824, 571) - - - _rotation - 0 - - - - wxgui_fftsink2 id - wxgui_fftsink2_0_1 + wxgui_fftsink2_0_1_0 - _enabled - True + notebook + nb0,2 - type - complex - - - title - FFT Plot - - - samp_rate - samp_rate - - - baseband_freq - 0 - - - y_per_div - 10 - - - y_divs - 10 + peak_hold + False ref_level @@ -1055,244 +1031,869 @@ ref_scale 2.0 - - fft_size - 1024 - fft_rate 15 - peak_hold - False + samp_rate + samp_rate - average - False + title + FFT Plot - avg_alpha - 0 - - - win - None + type + complex win_size - grid_pos - - - - notebook - nb0,1 - - - freqvar + win None + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + 0 + alias + + comment + + affinity + + _enabled + True + + + fft_size + 1024 + + + freqvar + None + _coordinate - (824, 355) + (320, 667) _rotation 0 + + grid_pos + + + + id + wxgui_fftsink2_0_1_0_0 + + + notebook + nb0,3 + + + peak_hold + False + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate/decimation + + + title + FFT Plot + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (840, 523) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0_1_1 + + + notebook + nb0,4 + + + peak_hold + False + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + FFT Plot + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (336, 315) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0_1_1_0 + + + notebook + nb0,5 + + + peak_hold + False + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + FFT Plot + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + wxgui_scopesink2 + + ac_couple + False + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (1096, 235) + + + _rotation + 0 + + + grid_pos + + id wxgui_scopesink2_0 - _enabled - True - - - type - complex - - - title - Scope Plot - - - samp_rate - samp_rate - - - v_scale - 0 - - - v_offset - 0 - - - t_scale - 0 - - - ac_couple - False - - - xy_mode - False + notebook + nb0,0 num_inputs 1 - win_size - + samp_rate + samp_rate - grid_pos - + t_scale + 0 - notebook - nb0,0 + title + Scope Plot trig_mode wxgui.TRIG_MODE_NORM - - y_axis_label - Counts - - - alias - - - - affinity - - - - _coordinate - (824, 235) - - - _rotation - 0 - - - - wxgui_fftsink2 - - id - wxgui_fftsink2_0 - - - _enabled - True - type complex - title - FFT Plot - - - samp_rate - samp_rate - - - baseband_freq + v_offset 0 - y_per_div - 10 - - - y_divs - 10 - - - ref_level + v_scale 0 - - ref_scale - 2.0 - - - fft_size - 1024 - - - fft_rate - 15 - - - peak_hold - False - - - average - False - - - avg_alpha - 0 - - - win - None - win_size - grid_pos - + xy_mode + False - notebook - nb0,0 + y_axis_label + Counts + + + wxgui_scopesink2 - freqvar - None + ac_couple + False alias + + comment + + affinity + + _enabled + True + _coordinate - (824, 19) + (1096, 571) _rotation 0 + + grid_pos + + + + id + wxgui_scopesink2_0_0 + + + notebook + nb0,1 + + + num_inputs + 1 + + + samp_rate + samp_rate + + + t_scale + 0 + + + title + Scope Plot + + + trig_mode + wxgui.TRIG_MODE_NORM + + + type + complex + + + v_offset + 0 + + + v_scale + 0 + + + win_size + + + + xy_mode + False + + + y_axis_label + Counts + + + + wxgui_scopesink2 + + ac_couple + False + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (1080, 899) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_scopesink2_0_0_0 + + + notebook + nb0,2 + + + num_inputs + 1 + + + samp_rate + samp_rate + + + t_scale + 0 + + + title + Scope Plot + + + trig_mode + wxgui.TRIG_MODE_NORM + + + type + complex + + + v_offset + 0 + + + v_scale + 0 + + + win_size + + + + xy_mode + False + + + y_axis_label + Counts + + + + wxgui_scopesink2 + + ac_couple + False + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (320, 883) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_scopesink2_0_0_0_0 + + + notebook + nb0,3 + + + num_inputs + 1 + + + samp_rate + samp_rate/decimation + + + t_scale + 0 + + + title + Scope Plot + + + trig_mode + wxgui.TRIG_MODE_NORM + + + type + complex + + + v_offset + 0 + + + v_scale + 0 + + + win_size + + + + xy_mode + False + + + y_axis_label + Counts + + + + wxgui_scopesink2 + + ac_couple + False + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (840, 747) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_scopesink2_0_0_1 + + + notebook + nb0,4 + + + num_inputs + 1 + + + samp_rate + samp_rate + + + t_scale + 0 + + + title + Scope Plot + + + trig_mode + wxgui.TRIG_MODE_NORM + + + type + complex + + + v_offset + 0 + + + v_scale + 0 + + + win_size + + + + xy_mode + False + + + y_axis_label + Counts + + + + wxgui_scopesink2 + + ac_couple + False + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (336, 531) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_scopesink2_0_0_1_0 + + + notebook + nb0,5 + + + num_inputs + 1 + + + samp_rate + samp_rate + + + t_scale + 0 + + + title + Scope Plot + + + trig_mode + wxgui.TRIG_MODE_NORM + + + type + complex + + + v_offset + 0 + + + v_scale + 0 + + + win_size + + + + xy_mode + False + + + y_axis_label + Counts + analog_sig_source_x_0 @@ -1300,48 +1901,18 @@ 0 0 - - blocks_throttle_0 - wxgui_fftsink2_0_0 - 0 - 0 - - - ha5kfu_execproc_xx_0 - wxgui_scopesink2_0 - 0 - 0 - - - ha5kfu_execproc_xx_0 - wxgui_fftsink2_0 - 0 - 0 - blocks_throttle_0 ha5kfu_execproc_xx_0 0 0 - - ha5kfu_execproc_xx_0_0 - wxgui_fftsink2_0_1 - 0 - 0 - blocks_throttle_0 ha5kfu_execproc_xx_0_0 0 0 - - ha5kfu_execproc_xx_0_0 - wxgui_scopesink2_0_0 - 0 - 0 - blocks_throttle_0 ha5kfu_execproc_xx_0_0_0 @@ -1355,14 +1926,44 @@ 0 - ha5kfu_execproc_xx_0_0_0_0 - wxgui_scopesink2_0_0_0_0 + blocks_throttle_0 + ha5kfu_execproc_xx_0_1 0 0 - ha5kfu_execproc_xx_0_0_0_0 - wxgui_fftsink2_0_1_0_0 + blocks_throttle_0 + ha5kfu_execproc_xx_0_1_0 + 0 + 0 + + + blocks_throttle_0 + wxgui_fftsink2_0_0 + 0 + 0 + + + ha5kfu_execproc_xx_0 + wxgui_fftsink2_0 + 0 + 0 + + + ha5kfu_execproc_xx_0 + wxgui_scopesink2_0 + 0 + 0 + + + ha5kfu_execproc_xx_0_0 + wxgui_fftsink2_0_1 + 0 + 0 + + + ha5kfu_execproc_xx_0_0 + wxgui_scopesink2_0_0 0 0 @@ -1378,4 +1979,40 @@ 0 0 + + ha5kfu_execproc_xx_0_0_0_0 + wxgui_fftsink2_0_1_0_0 + 0 + 0 + + + ha5kfu_execproc_xx_0_0_0_0 + wxgui_scopesink2_0_0_0_0 + 0 + 0 + + + ha5kfu_execproc_xx_0_1 + wxgui_fftsink2_0_1_1 + 0 + 0 + + + ha5kfu_execproc_xx_0_1 + wxgui_scopesink2_0_0_1 + 0 + 0 + + + ha5kfu_execproc_xx_0_1_0 + wxgui_fftsink2_0_1_1_0 + 0 + 0 + + + ha5kfu_execproc_xx_0_1_0 + wxgui_scopesink2_0_0_1_0 + 0 + 0 + diff --git a/libcsdr.c b/libcsdr.c index df87266..150a7e6 100644 --- a/libcsdr.c +++ b/libcsdr.c @@ -394,6 +394,44 @@ float shift_addfast_cc(complexf *input, complexf* output, int input_size, shift_ #else + +#if 1 + +#define SADF_L1(j) cos_vals_ ## j = cos_start * dcos_ ## j - sin_start * dsin_ ## j; \ + sin_vals_ ## j = sin_start * dcos_ ## j + cos_start * dsin_ ## j; +#define SADF_L2(j) iof(output,4*i+j)=(cos_vals_ ## j)*iof(input,4*i+j)-(sin_vals_ ## j)*qof(input,4*i+j); \ + qof(output,4*i+j)=(sin_vals_ ## j)*iof(input,4*i+j)+(cos_vals_ ## j)*qof(input,4*i+j); + +float shift_addfast_cc(complexf *input, complexf* output, int input_size, shift_addfast_data_t* d, float starting_phase) +{ + //input_size should be multiple of 4 + //fprintf(stderr, "shift_addfast_cc: input_size = %d\n", input_size); + float cos_start=cos(starting_phase); + float sin_start=sin(starting_phase); + float register cos_vals_0, cos_vals_1, cos_vals_2, cos_vals_3, + sin_vals_0, sin_vals_1, sin_vals_2, sin_vals_3, + dsin_0 = d->dsin[0], dsin_1 = d->dsin[1], dsin_2 = d->dsin[2], dsin_3 = d->dsin[3], + dcos_0 = d->dcos[0], dcos_1 = d->dcos[1], dcos_2 = d->dcos[2], dcos_3 = d->dcos[3]; + + for(int i=0;iphase_increment; + while(starting_phase>PI) starting_phase-=2*PI; + while(starting_phase<-PI) starting_phase+=2*PI; + return starting_phase; +} +#else float shift_addfast_cc(complexf *input, complexf* output, int input_size, shift_addfast_data_t* d, float starting_phase) { //input_size should be multiple of 4 @@ -421,6 +459,7 @@ float shift_addfast_cc(complexf *input, complexf* output, int input_size, shift_ while(starting_phase<-PI) starting_phase+=2*PI; return starting_phase; } +#endif #endif diff --git a/test200.c b/test200.c index 9feb457..d2da851 100644 --- a/test200.c +++ b/test200.c @@ -70,6 +70,15 @@ int main() clock_gettime(CLOCK_MONOTONIC_RAW, &end_time); fprintf(stderr,"shift_math_cc done in %g seconds.\n",TIME_TAKEN(start_time,end_time)); + //shift_table_cc + shift_table_data_t shift_table_data=shift_table_init(65536); + starting_phase = 0; + + clock_gettime(CLOCK_MONOTONIC_RAW, &start_time); + for(int i=0;i