<jupyter_start><jupyter_text>Claerbout FGDP Kolmogoroff spectral factorization (min phase rearrangement)<jupyter_code>import numpy
def Kolmogoroff(complexFilter) :
    N = complexFilter.shape[0]                  
    fft1 = numpy.fft.fft(complexFilter)         # Fourier transform 
    fft2 = 0.5*numpy.log(fft1*fft1.conj())      # Form the log of the amplitude spectrum
    fft3 = numpy.fft.ifft(fft2)                 # Begin Hilbert transform
    Nhalf = int(N/2)                            # Leave T=0 alone
    fft3[Nhalf+1:] = 0.0+0.0j                   # Zero values at negative time               
    fft3[1:Nhalf] *= 2.0                        # Double values at positive time
    fft4 = numpy.fft.fft(fft3)                  # End Hilbert transform
    fft5 = numpy.exp(fft4)                      # Exponentiate
    fft6 = numpy.fft.ifft(fft5)                 # Inverse transform
    return fft6                                 # Return minimum phase filter
#
# FGDP test case
#
# In: (0.0, 0.0), (0.0, 8.0), (16.0, 0.0), (0.0, 0.0)
#
# Out: (15.6, -0.0), (0.0, -8.7), (-0.4, -0.0), (0.0, -0.7)
#
complexFilterIn = numpy.zeros((4,),dtype=numpy.complex64)
complexFilterIn[0] = 0.0 + 0.0j
complexFilterIn[1] = 0.0 + 8.0j
complexFilterIn[2] = 16.0 + 0.0j
complexFilterIn[3] = 0.0 + 0.0j
complexFilterOut = Kolmogoroff(complexFilterIn)
print(complexFilterOut)<jupyter_output>[15.628452 +0.j        0.       -8.669764j -0.3715453+0.j
  0.       -0.669765j]
{'fraction_non_alphanumeric': 0.13287671232876713, 'fraction_numerical': 0.0821917808219178, 'mean_word_length': 1.9755600814663952, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '134155', 'license': 'Apache-2.0', 'n_tokens_mistral': 602, 'n_tokens_neox': 546, 'n_words': 112, 'path': 'claerbout-fgdp-1975/jupyter/Kolmogoroff.ipynb', 'repo_name': 'sygreer/repro-zoo-2018', 'size': '1460'}