Exemple #1
0
def iaidft(F):
    from ia636 import iadftmatrix

    s = F.shape
    if len(F.shape) == 1: F = F[newaxis,newaxis,:]
    if len(F.shape) == 2: F = F[newaxis,:,:]

    (p,m,n) = F.shape
    A = iadftmatrix(m)
    B = iadftmatrix(n)
    C = iadftmatrix(p)
    Faux = dot(conjugate(A),F)
    Faux = dot(Faux,conjugate(B))
    f = dot(conjugate(C),Faux)/(sqrt(p)*sqrt(m)*sqrt(n))

    return f.reshape(s)
Exemple #2
0
def iaidft(F):
    from ia636 import iadftmatrix

    s = F.shape
    if len(F.shape) == 1: F = F[newaxis, newaxis, :]
    if len(F.shape) == 2: F = F[newaxis, :, :]

    (p, m, n) = F.shape
    A = iadftmatrix(m)
    B = iadftmatrix(n)
    C = iadftmatrix(p)
    Faux = dot(conjugate(A), F)
    Faux = dot(Faux, conjugate(B))
    f = dot(conjugate(C), Faux) / (sqrt(p) * sqrt(m) * sqrt(n))

    return f.reshape(s)
Exemple #3
0
def iadft(f):
    from ia636 import iadftmatrix
    f = asarray(f).astype(float64)
    if (len(f.shape) == 1):
        m = len(f)
        A = iadftmatrix(f.shape[0])
        F = sqrt(m) * dot(A, f)
    elif (len(f.shape) == 2):
        (m, n) = f.shape
        A = iadftmatrix(m)
        B = iadftmatrix(n)
        F = sqrt(m * n) * dot(dot(A, f), B)
    else:
        (p, m, n) = f.shape
        A = iadftmatrix(m)
        B = iadftmatrix(n)
        C = iadftmatrix(p)
        Faux = dot(A, f)
        Faux = dot(Faux, B)
        F = sqrt(p) * sqrt(m) * sqrt(n) * dot(C, Faux)
    return F
Exemple #4
0
def iadft(f):
    from ia636 import iadftmatrix
    f = asarray(f).astype(float64)
    if (len(f.shape) == 1):
        m = len(f)
        A = iadftmatrix(f.shape[0])
        F = sqrt(m) * dot(A, f)
    elif (len(f.shape) == 2):
        (m, n) = f.shape
        A = iadftmatrix(m)
        B = iadftmatrix(n)
        F = sqrt(m * n) * dot(dot(A, f), B)
    else:
        (p,m,n) = f.shape
        A = iadftmatrix(m)
        B = iadftmatrix(n)
        C = iadftmatrix(p)
        Faux = dot(A,f)
        Faux = dot(Faux,B)
        F = sqrt(p)*sqrt(m)*sqrt(n)*dot(C,Faux)
    return F