aboutsummaryrefslogtreecommitdiff
path: root/Measurements/A_f.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/A_f.m
downloadl1magic-1.11.tar.gz
l1magic-1.11.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/A_f.m')
-rw-r--r--Measurements/A_f.m30
1 files changed, 30 insertions, 0 deletions
diff --git a/Measurements/A_f.m b/Measurements/A_f.m
new file mode 100644
index 0000000..3a793aa
--- /dev/null
+++ b/Measurements/A_f.m
@@ -0,0 +1,30 @@
+% A_f.m
+%
+% Takes "scrambled Fourier" measurements.
+%
+% Usage: b = A_f(x, OMEGA, P)
+%
+% x - N vector
+%
+% b - K vector = [real part; imag part]
+%
+% OMEGA - K/2 vector denoting which Fourier coefficients to use
+% (the real and imag parts of each freq are kept).
+%
+% P - Permutation to apply to the input vector. Fourier coeffs of
+% x(P) are calculated.
+% Default = 1:N (no scrambling).
+%
+% Written by: Justin Romberg, Caltech
+% Created: October 2005
+% Email: jrom@acm.caltech.edu
+%
+
+function b = A_f(x, OMEGA, P)
+
+N = length(x);
+if (nargin < 3), P = 1:N; end
+
+fx = 1/sqrt(N)*fft(x(P));
+b = [sqrt(2)*real(fx(OMEGA)); sqrt(2)*imag(fx(OMEGA))];
+