summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlab/rcosFn.m
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-20 03:47:33 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-20 03:47:33 -0400
commita32f220f06cc463e5b56e7fa0b1b1334d94d08f3 (patch)
tree4af4caa60074465d85fc2ef5cc1b23e74c064329 /SD-VBS/benchmarks/texture_synthesis/src/matlab/rcosFn.m
parent79f30887129145e15e5172e36a7d7602859fc932 (diff)
matlab removed
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/rcosFn.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlab/rcosFn.m45
1 files changed, 0 insertions, 45 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/rcosFn.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/rcosFn.m
deleted file mode 100755
index 5dac344..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/rcosFn.m
+++ /dev/null
@@ -1,45 +0,0 @@
1% [X, Y] = rcosFn(WIDTH, POSITION, VALUES)
2%
3% Return a lookup table (suitable for use by INTERP1)
4% containing a "raised cosine" soft threshold function:
5%
6% Y = VALUES(1) + (VALUES(2)-VALUES(1)) *
7% cos^2( PI/2 * (X - POSITION + WIDTH)/WIDTH )
8%
9% WIDTH is the width of the region over which the transition occurs
10% (default = 1). POSITION is the location of the center of the
11% threshold (default = 0). VALUES (default = [0,1]) specifies the
12% values to the left and right of the transition.
13
14% Eero Simoncelli, 7/96.
15
16function [X, Y] = rcosFn(width,position,values)
17
18%------------------------------------------------------------
19% OPTIONAL ARGS:
20
21if (exist('width') ~= 1)
22 width = 1;
23end
24
25if (exist('position') ~= 1)
26 position = 0;
27end
28
29if (exist('values') ~= 1)
30 values = [0,1];
31end
32
33%------------------------------------------------------------
34
35sz = 256; %% arbitrary!
36
37X = pi * [-sz-1:1] / (2*sz);
38
39Y = values(1) + (values(2)-values(1)) * cos(X).^2;
40
41% Make sure end values are repeated, for extrapolation...
42Y(1) = Y(2);
43Y(sz+3) = Y(sz+2);
44
45X = position + (2*width/pi) * (X + pi/4);