-
Notifications
You must be signed in to change notification settings - Fork 0
/
FFT_Inverse_32.m
64 lines (50 loc) · 7.78 KB
/
FFT_Inverse_32.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
function f_fft_inverse_output = FFT_Inverse_32(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31)
% Input:
% f_inputs - 32 arrays (F01, ... , F31) of 32 items <= RESULT OF
% POWER POINT PRODUCT
% Output:
% f_fft_output - matrix 32x32 where f_fft_output(i,:) is the
% array of coefficients
% (a_0 + a_1*y + a_2*y^2 + ... + a_31*y^31)*w^i
f_fft_inverse_output = zeros(32,32);
addpath(genpath('Inverse_FFT_32')); %We add the path to the libraries
%modulo = 2048;
modulo = 65536;
%modulo = 131072;
%debug
%modulo = 0; %TODO: DELETE
f_fft_inverse_output(1,:) = Inverse_FFT_32_00(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(2,:) = Inverse_FFT_32_01(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(3,:) = Inverse_FFT_32_02(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(4,:) = Inverse_FFT_32_03(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(5,:) = Inverse_FFT_32_04(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(6,:) = Inverse_FFT_32_05(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(7,:) = Inverse_FFT_32_06(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(8,:) = Inverse_FFT_32_07(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(9,:) = Inverse_FFT_32_08(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(10,:) = Inverse_FFT_32_09(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(11,:) = Inverse_FFT_32_10(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(12,:) = Inverse_FFT_32_11(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(13,:) = Inverse_FFT_32_12(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(14,:) = Inverse_FFT_32_13(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(15,:) = Inverse_FFT_32_14(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(16,:) = Inverse_FFT_32_15(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(17,:) = Inverse_FFT_32_16(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(18,:) = Inverse_FFT_32_17(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(19,:) = Inverse_FFT_32_18(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(20,:) = Inverse_FFT_32_19(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(21,:) = Inverse_FFT_32_20(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(22,:) = Inverse_FFT_32_21(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(23,:) = Inverse_FFT_32_22(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(24,:) = Inverse_FFT_32_23(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(25,:) = Inverse_FFT_32_24(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(26,:) = Inverse_FFT_32_25(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(27,:) = Inverse_FFT_32_26(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(28,:) = Inverse_FFT_32_27(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(29,:) = Inverse_FFT_32_28(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(30,:) = Inverse_FFT_32_29(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(31,:) = Inverse_FFT_32_30(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
f_fft_inverse_output(32,:) = Inverse_FFT_32_31(F00, F01, F02, F03, F04, F05, F06, F07, F08, F09, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, modulo);
%% Final step: We must divide by 32 as the inverse butterflies have 1/2 in each level
f_fft_inverse_output = f_fft_inverse_output/32;
end