-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_circular_conv.m
66 lines (51 loc) · 1.36 KB
/
test_circular_conv.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
%UNTITLED3 - One line description of what the script performs (H1 line)
% Optional file header info (to give more details about the function than in the H1 line)
% Optional file header info (to give more details about the function than in the H1 line)
% Optional file header info (to give more details about the function than in the H1 line)
%
% Description:
% UNTITLED3 description
%
% Output:
% UNTITLED3 output
%
% Other m-files required: none
% MAT-files required: none
%
% See also: OTHER_SCRIPT_NAME, OTHER_FUNCTION_NAME
% Author: Shane Kepley
% email: [email protected]
% Date: 04-Aug-2018; Last revision: 04-Aug-2018
%% ================================================== TEST FOURIER/TAYLOR MIXED CONVOLUTION ==================================================
N = 100;
a = intval(randi(10,N,1));
b = intval(randi(10,N,1));
c1 = cconv(mid(a),mid(b),N);
c2 = fouriertimes(a,b);
max(abs(c1-c2))
return
%% ================================================== SECTION 1 ==================================================
a=randi(10,N,1);
b=randi(10,N,1);
for j = 1:3
cconv(a,b,N);
end
tic
for j=1:1000
a=randi(10,N,1);
b=randi(10,N,1);
cconv(a,b,N);
end
toc
a=randi(10,N,1);
b=randi(10,N,1);
for j = 1:3
fouriertimes(a,b);
end
tic
for j=1:1000
a=randi(10,N,1);
b=randi(10,N,1);
fouriertimes(a,b);
end
toc