hichamjanati / pyldpc

Creation of LDPC codes & simulation of coding and decoding binary data. Applications to sound and image files.
BSD 3-Clause "New" or "Revised" License
119 stars 32 forks source link

possible speedup? #23

Closed nbecker closed 2 years ago

nbecker commented 2 years ago

Have you considered this modified method to compute Lr in decoder? It may offer some speedup, although I haven't tested it.

def phi0(x):
    x = abs(x)
    if (x < 9.08e-5 ):
        return( 10 );
    else:
        return -log (tanh (x/2))

def G(Lq):
    X = sum (phi0(e) for e in Lq)
    s = np.prod(np.sign(Lq))
    return s * phi0(X)
nbecker commented 2 years ago

No, this won't speed up.