Commit 3de8778c authored by alexander.dornheim's avatar alexander.dornheim
Browse files

Added reshape to operators in CDP_processor

parent 332d1416
from numpy.random import randn, random_sample
from numpy.linalg import norm
from numpy import sqrt, conj, tile, mean
from numpy import sqrt, conj, tile, mean, exp, angle, trace
from numpy.fft import fft, ifft
import numpy as np
import time
......@@ -47,14 +47,14 @@ def CDP_processor(config):
if n2==1:
# Make linear operators; A is forward map and At its scaled adjoint (At(Y)*numel(Y) is the adjoint)
A = lambda I: fft(conj(Masks) * tile(I,[1, L])) # Input is n x 1 signal, output is n x L array
At = lambda Y: mean(Masks * ifft(Y), 1) # Input is n x L array, output is n x 1 signal
At = lambda Y: mean(Masks * ifft(Y), 1).reshape((n1,n2)) # Input is n x L array, output is n x 1 signal
elif n1==1 :
# Make linear operators; A is forward map and At its scaled adjoint (At(Y)*numel(Y) is the adjoint)
A = lambda I: fft(conj(Masks) * tile(I,[L, 1])) # Input is 1 x n signal, output is L x n array
At = lambda Y: mean(Masks * ifft(Y), 0) # Input is L x n array, output is 1 x n signal
At = lambda Y: mean(Masks * ifft(Y), 0).reshape((n1,n2)) # Input is L x n array, output is 1 x n signal
else:
A = lambda I: fft2(config['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(Y), 2) # Input is n1 x n2 X L array, output is n1 x n2 image
At = lambda Y: mean(Masks * ifft2(Y), 2).reshape((n1,n2)) # Input is n1 x n2 X L array, output is n1 x n2 image
# Data
Y = abs(A(x))
......
Supports Markdown
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