-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_twiddle_type.m
More file actions
62 lines (56 loc) · 2.74 KB
/
get_twiddle_type.m
File metadata and controls
62 lines (56 loc) · 2.74 KB
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Center for Astronomy Signal Processing and Electronics Research %
% http://casper.berkeley.edu %
% Copyright (C) 2011 Suraj Gowda Hong Chen %
% %
% This program is free software; you can redistribute it and/or modify %
% it under the terms of the GNU General Public License as published by %
% the Free Software Foundation; either version 2 of the License, or %
% (at your option) any later version. %
% %
% This program is distributed in the hope that it will be useful, %
% but WITHOUT ANY WARRANTY; without even the implied warranty of %
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% GNU General Public License for more details. %
% %
% You should have received a copy of the GNU General Public License along %
% with this program; if not, write to the Free Software Foundation, Inc., %
% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function twiddle_type = get_twiddle_type(Coeffs, biplex, opt_target, use_embedded,StepPeriod,FFTSize)
opt_target
opt_logic = strcmp(opt_target, 'logic');
% Determine twiddle type from 'Coeffs'
if length(Coeffs) == 1,
if Coeffs(1) == 0,
%if used in biplex core and first stage
if(strcmp(biplex, 'on')),
twiddle_type = 'twiddle_pass_through';
else
twiddle_type = 'twiddle_coeff_0';
end
elseif Coeffs(1) == 1,
twiddle_type = 'twiddle_coeff_1';
else
if opt_logic && use_embedded,
twiddle_type = 'twiddle_general_dsp48e';
elseif opt_logic,
twiddle_type = 'twiddle_general_4mult';
else
twiddle_type = 'twiddle_general_3mult';
end
end
elseif length(Coeffs)==2 && Coeffs(1)==0 && Coeffs(2)==1 && StepPeriod==FFTSize-2,
twiddle_type = 'twiddle_stage_2';
else
if use_embedded,
twiddle_type = 'twiddle_general_dsp48e';
elseif opt_logic,
twiddle_type = 'twiddle_general_4mult';
else
twiddle_type = 'twiddle_general_3mult';
end
end
end