Commit 34a9882d authored by markus.meier01's avatar markus.meier01
Browse files

Fixed some errors in CDP_candes

parent 771ed8f3
from numpy.random import randn, random_sample
from numpy.matlib import repmat
from numpy.linalg import norm
from numpy import sqrt, conj, reshape
from numpy.fft import fft2, ifft2
from numpy import sqrt, conj, reshape, mean
import matplotlib.pyplot as plt
import numpy as np
import random
......@@ -22,7 +21,7 @@ def CDP_Candes(config):
## Make image
n1 = 128,
n2 = 256,
x = randn(n1,n2) + 1j*andn(n1,n2)
x = randn(n1,n2) + 1j*randn(n1,n2)
# Make masks and linear sampling operators
......@@ -40,8 +39,8 @@ def CDP_Candes(config):
# Make linear operators; A is forward map and
# At its scaled adjoint (At(Y)*numel(Y) is the adjoint)
A = lambda I: fft2(conj(Masks)*reshape(repmat(I, 1, L), np.size(I,1), np.size(I,2), L)) # Input is n1 x n2 image, output is n1 x n2 x L array
At = lambda Y: mean(Masks*ifft2,3) # Input is n1 x n2 X L array, output is n1 x n2 image
A = lambda I: fft2(conj(Masks)*reshape(tile(I, [1,L]), [I.shape[0], I.shape[1], L])) # Input is n1 x n2 image, output is n1 x n2 x L array
At = lambda Y: mean(Masks*ifft2,axis=1) # Input is n1 x n2 X L array, output is n1 x n2 image
# Data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment