Skip to content
Snippets Groups Projects
Select Git revision
  • test-error_interval
  • master default protected
2 results

gsrp-tdoa

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    ferrari authored
    7b3e656c
    History

    GSPR TDOA Hyper resolution

    gsrp_tdoa_hyperres.py is a python script made to compute the time difference of arrival (TDOA) using the geometric steered response power (GSRP) method. This script also produces TDOA with a resolution higher than the initial sampling rate by interpolating the GSPR loss function with a second-order polynomial.

    Prerequisite

    This program uses the following libraries (other versions might work):

    Usage

    usage: gsrp_tdoa_hyperres.py [-h] [-c CHANNELS] [-i INVERSE] [-f FRAME_SIZE] [-s HOP_SIZE] [-m MAX_TDOA] [-l LOW] [-u UP] [-d DECIMATE] [-t] [-e] [--start SECONDS] [--end SECONDS] infile outfile

    Arguments

    Computes TDOA estimates from a multi-channel recording.
    
    positional arguments:
      infile                The sound file to process.
      outfile               The text or npy file to write results to. Each row
                            gives the position (in samples), cross-correlation
                            product, the independent TDOAs (in samples), and TDOAs
                            derived from the independent ones. For plots, the
                            panes give the cross-correlation product, independent
                            TDOAS and derived TDOAs from top to bottom.
    
    optional arguments:
      -h, --help            show this help message and exit
    
    Channels:
      -c CHANNELS, --channels CHANNELS
                            The channels to cross-correlate. Accepts two or more,
                            but beware of high memory use. To be given as a comma-
                            separated list of numbers, with 0 referring to the
                            first channel (default: all channels).
      -i INVERSE, --inverse INVERSE
                            Inverse the channel. To be given as a comma-separated
                            list of numbers,with 0 referring to the first channel
                            once channels have been chosen by --channels.
    
    Size settings:
      -f FRAME_SIZE, --frame-size FRAME_SIZE
                            The size of the cross-correlation frames in seconds
                            (default: 0.2)
      -s STRIDE, --stride STRIDE
                            The step between the beginnings of sequential frames
                            in seconds (default: 0.01), or the postion in second
                            if csv file path is given.
      -m MAX_TDOA, --max-tdoa MAX_TDOA
                            The maximum TDOA in seconds (default: 0.0011).
      -S SECONDS, --start SECONDS
                            If given, only analyze from the given position.
      -E SECONDS, --end SECONDS
                            If given, only analyze up to the given position.
    
    Filtering:
      -l LOW, --low LOW     Bottom cutoff frequency. Disabled by default.
      -u UP, --up UP        Top cutoff frequency. Disabled by default.
      -d DECIMATE, --decimate DECIMATE
                            Downsample the signal by the given factor. Disabled by
                            default
      -t, --temporal        If given, any decimation will be applied in the time
                            domain instead of the spectral domain.
    
    Other:
      -e, --erase           Erase existing outfile. If outfile exist and --erase
                            is not provide, the script will exit.
      -n, --no-hyperres     Disable the hyper resolution evalutation of the TDOA
      -M {smart,auto,on-the-fly,prepare}, --mode {smart,auto,on-the-fly,prepare}
                            How to explore the TDOA space (default: prepare).
                            'prepare' precomputes all the possible TDOA
                            pairs and then evaluate them. All the results are save
                            in memory.
                            'on-the-fly' compute the TDOA pairs at the same
                            time as it compute the loss function. Only the maximum
                            is saved. Can be slower than 'prepare'.
                            'smart' gradually increase the search space dimension, '
                            reducing the number of tdoa to evaluate.
                            'auto' automatically try to pick the right
                            method.
    
    Process finished with exit code 0