aboutsummaryrefslogtreecommitdiff
path: root/Measurements/LineMask.m
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-01-29 16:23:05 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-01-29 16:23:05 -0500
commit3983eb46023c1edd00617729ba929057fda8d0bd (patch)
tree816ad084f355000656c43da9160f1c257bbb1ddc /Measurements/LineMask.m
downloadl1magic-3983eb46023c1edd00617729ba929057fda8d0bd.tar.gz
l1magic-3983eb46023c1edd00617729ba929057fda8d0bd.zip
Initial import from https://statweb.stanford.edu/~candes/software/l1magic/v1.11
Additional Clean up of Mac dirs and tex generated files
Diffstat (limited to 'Measurements/LineMask.m')
-rw-r--r--Measurements/LineMask.m47
1 files changed, 47 insertions, 0 deletions
diff --git a/Measurements/LineMask.m b/Measurements/LineMask.m
new file mode 100644
index 0000000..d7e985f
--- /dev/null
+++ b/Measurements/LineMask.m
@@ -0,0 +1,47 @@
+% LineMask.m
+%
+% Returns the indicator of the domain in 2D fourier space for the
+% specified line geometry.
+% Usage : [M,Mh,mi,mhi] = LineMask(L,N)
+%
+% Written by : Justin Romberg
+% Created : 1/26/2004
+% Revised : 12/2/2004
+
+function [M,Mh,mi,mhi] = LineMask(L,N)
+
+
+thc = linspace(0, pi-pi/L, L);
+%thc = linspace(pi/(2*L), pi-pi/(2*L), L);
+
+M = zeros(N);
+
+% full mask
+for ll = 1:L
+
+ if ((thc(ll) <= pi/4) | (thc(ll) > 3*pi/4))
+ yr = round(tan(thc(ll))*(-N/2+1:N/2-1))+N/2+1;
+ for nn = 1:N-1
+ M(yr(nn),nn+1) = 1;
+ end
+ else
+ xc = round(cot(thc(ll))*(-N/2+1:N/2-1))+N/2+1;
+ for nn = 1:N-1
+ M(nn+1,xc(nn)) = 1;
+ end
+ end
+
+end
+
+
+% upper half plane mask (not including origin)
+Mh = zeros(N);
+Mh = M;
+Mh(N/2+2:N,:) = 0;
+Mh(N/2+1,N/2+1:N) = 0;
+
+
+M = ifftshift(M);
+mi = find(M);
+Mh = ifftshift(Mh);
+mhi = find(Mh);