From 3983eb46023c1edd00617729ba929057fda8d0bd Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Fri, 29 Jan 2021 16:23:05 -0500 Subject: Initial import from https://statweb.stanford.edu/~candes/software/l1magic/ Additional Clean up of Mac dirs and tex generated files --- Measurements/LineMask.m | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Measurements/LineMask.m (limited to 'Measurements/LineMask.m') 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); -- cgit v1.2.3