umbmid/sigproc.py
def iczt(fd_data, ini_t, fin_t, n_time_pts, ini_f, fin_f):
    """Compute the ICZT of the fd_data, transforming to the time-domain.

    NOTE: Currently supports 1D or 2D fd_data arrays, and will perform
    the transform along the 0th axis of a 2D array

    Parameters
    ----------
    fd_data : array_like
        The frequency-domain array to be transformed via the ICZT to the
        time-domain
    ini_t : float
        The starting time-of-response to be used for computing the ICZT,
        in seconds
    fin_t : float
        The stopping time-of-response to be used for computing the ICZT,
        in seconds
    n_time_pts : int
        The number of points in the time-domain at which the transform 
        will be evaluated
    ini_f : float
        The initial frequency used in the scan, in Hz
    fin_f : float
        The final frequency used in the scan, in Hz

    Returns
    -------
    td_data : array_like
        Array of the transformed data
    """

    n_freqs = fd_data.shape[0]  # Find the number of frequencies use

    # Find the conversion factor to convert from time-of-response to
    # angle around the unit circle
    time_to_angle = (2 * np.pi) / np.max(get_scan_times(ini_f, fin_f, n_freqs))

    # Find the parameters for computing the ICZT over the specified
    # time window
    theta_naught = ini_t * time_to_angle
    phi_naught = (fin_t - ini_t) * time_to_angle / (n_time_pts - 1)

    # Compute the exponential values only once
    exp_theta_naught = np.exp(-1j * theta_naught)
    exp_phi_naught = np.exp(-1j * phi_naught)

    # Make a dummy vector to facilitate vectorized computation
    dummy_vec = -1 * np.arange(n_freqs)

    # Make dummy vector of time points to facilitate vectorized
    # computation
    time_pts = np.arange(n_time_pts)

    # Find the z-value matrix, to facilitate vectorized computation
    z_vals = exp_theta_naught * exp_phi_naught**time_pts
    zs_power = np.power(z_vals[None, :], dummy_vec[:, None])

    # If computing over a 2D array
    if len(fd_data.shape) > 1:

        # Init array to return
        td_data = np.zeros([n_time_pts, fd_data.shape[1]], dtype=complex)

        # For each antenna position
        for ant_pos in range(np.size(fd_data, axis=1)):

            # Find the ICZT
            td_data[:, ant_pos] = np.sum(fd_data[:, ant_pos][:, None] *
                                         zs_power, axis=0) / n_freqs

    else:  # If the fd_data is a 1D array

        # Find the ICZT
        td_data = np.sum(fd_data[:, None] * zs_power, axis=0) / n_freqs

    # Apply phase compensation
    td_data = phase_compensate(td_data, ini_f=ini_f, ini_t=ini_t, fin_t=fin_t,
                               n_time_pts=n_time_pts)

    return td_data
Compute the ICZT of the fd_data, transforming to the time-domain.

    NOTE: Currently supports 1D or 2D fd_data arrays, and will perform
    the transform along the 0th axis of a 2D array

    Parameters
    ----------
    fd_data : array_like
        The frequency-domain array to be transformed via the ICZT to the
        time-domain
    ini_t : float
        The starting time-of-response to be used for computing the ICZT,
        in seconds
    fin_t : float
        The stopping time-of-response to be used for computing the ICZT,
        in seconds
    n_time_pts : int
        The number of points in the time-domain at which the transform 
        will be evaluated
    ini_f : float
        The initial frequency used in the scan, in Hz
    fin_f : float
        The final frequency used in the scan, in Hz

    Returns
    -------
    td_data : array_like
        Array of the transformed data
    
Compute the ICZT of the fd_data, transforming to the time-domain.
NOTE: Currently supports 1D or 2D fd_data arrays, and will perform
the transform along the 0th axis of a 2D array
Compute the ICZT of the fd_data transforming to the time - domain . NOTE : Currently supports 1D or 2D fd_data arrays and will perform the transform along the 0th axis of a 2D array
def iczt(fd_data, ini_t, fin_t, n_time_pts, ini_f, fin_f):
    n_freqs = fd_data.shape[0]  
    time_to_angle = (2 * np.pi) / np.max(get_scan_times(ini_f, fin_f, n_freqs))
    theta_naught = ini_t * time_to_angle
    phi_naught = (fin_t - ini_t) * time_to_angle / (n_time_pts - 1)
    exp_theta_naught = np.exp(-1j * theta_naught)
    exp_phi_naught = np.exp(-1j * phi_naught)
    dummy_vec = -1 * np.arange(n_freqs)
    time_pts = np.arange(n_time_pts)
    z_vals = exp_theta_naught * exp_phi_naught**time_pts
    zs_power = np.power(z_vals[None, :], dummy_vec[:, None])
    if len(fd_data.shape) > 1:
        td_data = np.zeros([n_time_pts, fd_data.shape[1]], dtype=complex)
        for ant_pos in range(np.size(fd_data, axis=1)):
            td_data[:, ant_pos] = np.sum(fd_data[:, ant_pos][:, None] *
                                         zs_power, axis=0) / n_freqs
    else:  
        td_data = np.sum(fd_data[:, None] * zs_power, axis=0) / n_freqs
    td_data = phase_compensate(td_data, ini_f=ini_f, ini_t=ini_t, fin_t=fin_t,
                               n_time_pts=n_time_pts)
    return td_data
def iczt ( fd_data , ini_t , fin_t , n_time_pts , ini_f , fin_f ) : n_freqs = fd_data . shape [ 0 ] time_to_angle = ( 2 * np . pi ) / np . max ( get_scan_times ( ini_f , fin_f , n_freqs ) ) theta_naught = ini_t * time_to_angle phi_naught = ( fin_t - ini_t ) * time_to_angle / ( n_time_pts - 1 ) exp_theta_naught = np . exp ( - 1j * theta_naught ) exp_phi_naught = np . exp ( - 1j * phi_naught ) dummy_vec = - 1 * np . arange ( n_freqs ) time_pts = np . arange ( n_time_pts ) z_vals = exp_theta_naught * exp_phi_naught ** time_pts zs_power = np . power ( z_vals [ None , : ] , dummy_vec [ : , None ] ) if len ( fd_data . shape ) > 1 : td_data = np . zeros ( [ n_time_pts , fd_data . shape [ 1 ] ] , dtype = complex ) for ant_pos in range ( np . size ( fd_data , axis = 1 ) ) : td_data [ : , ant_pos ] = np . sum ( fd_data [ : , ant_pos ] [ : , None ] * zs_power , axis = 0 ) / n_freqs else : td_data = np . sum ( fd_data [ : , None ] * zs_power , axis = 0 ) / n_freqs td_data = phase_compensate ( td_data , ini_f = ini_f , ini_t = ini_t , fin_t = fin_t , n_time_pts = n_time_pts ) return td_data
Compute the ICZT of the fd_data, transforming to the time-domain.
Compute the ICZT of the fd_data transforming to the time - domain .
"""Compute the ICZT of the fd_data, transforming to the time-domain.

    NOTE: Currently supports 1D or 2D fd_data arrays, and will perform
    the transform along the 0th axis of a 2D array

    Parameters
    ----------
    fd_data : array_like
        The frequency-domain array to be transformed via the ICZT to the
        time-domain
    ini_t : float
        The starting time-of-response to be used for computing the ICZT,
        in seconds
    fin_t : float
        The stopping time-of-response to be used for computing the ICZT,
        in seconds
    n_time_pts : int
        The number of points in the time-domain at which the transform 
        will be evaluated
    ini_f : float
        The initial frequency used in the scan, in Hz
    fin_f : float
        The final frequency used in the scan, in Hz

    Returns
    -------
    td_data : array_like
        Array of the transformed data
    """ # Find the number of frequencies use
 # Find the conversion factor to convert from time-of-response to
 # angle around the unit circle
 # Find the parameters for computing the ICZT over the specified
 # time window
 # Compute the exponential values only once
 # Make a dummy vector to facilitate vectorized computation
 # Make dummy vector of time points to facilitate vectorized
 # computation
 # Find the z-value matrix, to facilitate vectorized computation
 # If computing over a 2D array
 # Init array to return
 # For each antenna position
 # Find the ICZT
 # If the fd_data is a 1D array
 # Find the ICZT
 # Apply phase compensation

Array of the transformed data
Array of the transformed data
array_like

fd_data
The frequency-domain array to be transformed via the ICZT to the
time-domain
The frequency - domain array to be transformed via the ICZT to the time - domain
ini_t
The starting time-of-response to be used for computing the ICZT,
in seconds
The starting time - of - response to be used for computing the ICZT in seconds
fin_t
The stopping time-of-response to be used for computing the ICZT,
in seconds
The stopping time - of - response to be used for computing the ICZT in seconds
n_time_pts
The number of points in the time-domain at which the transform
will be evaluated
The number of points in the time - domain at which the transform will be evaluated
ini_f
The initial frequency used in the scan, in Hz
The initial frequency used in the scan in Hz
fin_f
The final frequency used in the scan, in Hz
The final frequency used in the scan in Hz