pySoundToolbox.py
def genAnalyticSignal(data):
    """
    Generates an analytic signal to given real data (converts real signal into a complex one).
    I'm using "Computing the discrete-time analytic signal via fft" by S. Lawrence Marple.

    @param data real data as 24 PCM numpy array. A row represents the response of one microphone.
    @return the complex response of the microphone array. A row represents the response of one microphone.
    """

    # Step 1: Compute FFT
    spectrum = np.fft.fft(data.flat)
    # Step 2: Half the spectrum
    n = spectrum.shape[0]
    h = np.empty(n, dtype=np.complex256)
    h[0] = spectrum[0]
    h[n / 2] = spectrum[n / 2]
    h[1:n / 2] = 2 * spectrum[1:n / 2]
    h[n / 2 + 1:] = 0
    # Step 3: Apply IFFT
    analyticSignal = np.fft.ifft(h).conjugate() # Need to conjugate to preserve the convention, that the vector should run clockwise for positive frequencies

    return analyticSignal

    Generates an analytic signal to given real data (converts real signal into a complex one).
    I'm using "Computing the discrete-time analytic signal via fft" by S. Lawrence Marple.

    @param data real data as 24 PCM numpy array. A row represents the response of one microphone.
    @return the complex response of the microphone array. A row represents the response of one microphone.
    
Generates an analytic signal to given real data (converts real signal into a complex one).
I'm using "Computing the discrete-time analytic signal via fft" by S. Lawrence Marple.

@param data real data as 24 PCM numpy array. A row represents the response of one microphone.
@return the complex response of the microphone array. A row represents the response of one microphone.
Generates an analytic signal to given real data ( converts real signal into a complex one ) . I ' m using " Computing the discrete - time analytic signal via fft " by S . Lawrence Marple . @param data real data as 24 PCM numpy array . A row represents the response of one microphone . @return the complex response of the microphone array . A row represents the response of one microphone .
def genAnalyticSignal(data):
    spectrum = np.fft.fft(data.flat)
    n = spectrum.shape[0]
    h = np.empty(n, dtype=np.complex256)
    h[0] = spectrum[0]
    h[n / 2] = spectrum[n / 2]
    h[1:n / 2] = 2 * spectrum[1:n / 2]
    h[n / 2 + 1:] = 0
    analyticSignal = np.fft.ifft(h).conjugate() 
    return analyticSignal
def genAnalyticSignal ( data ) : spectrum = np . fft . fft ( data . flat ) n = spectrum . shape [ 0 ] h = np . empty ( n , dtype = np . complex256 ) h [ 0 ] = spectrum [ 0 ] h [ n / 2 ] = spectrum [ n / 2 ] h [ 1 : n / 2 ] = 2 * spectrum [ 1 : n / 2 ] h [ n / 2 + 1 : ] = 0 analyticSignal = np . fft . ifft ( h ) . conjugate ( ) return analyticSignal
Generates an analytic signal to given real data (converts real signal into a complex one).
Generates an analytic signal to given real data ( converts real signal into a complex one ) .
"""
    Generates an analytic signal to given real data (converts real signal into a complex one).
    I'm using "Computing the discrete-time analytic signal via fft" by S. Lawrence Marple.

    @param data real data as 24 PCM numpy array. A row represents the response of one microphone.
    @return the complex response of the microphone array. A row represents the response of one microphone.
    """ # Step 1: Compute FFT # Step 2: Half the spectrum # Step 3: Apply IFFT # Need to conjugate to preserve the convention, that the vector should run clockwise for positive frequencies
data