Explicit almost-periodic factorization for a class of triangular matrix functions