README.md 4.17 KB
Newer Older
ferrari's avatar
ferrari committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
-----
```
26
27
Computes TDOA estimates from a multi-channel recording.

ferrari's avatar
ferrari committed
28
29
30
31
32
33
34
35
36
37
38
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
39
40

Channels:
ferrari's avatar
ferrari committed
41
42
43
44
45
46
47
48
49
  -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.
50
51

Size settings:
ferrari's avatar
ferrari committed
52
53
54
  -f FRAME_SIZE, --frame-size FRAME_SIZE
                        The size of the cross-correlation frames in seconds
                        (default: 0.2)
55
  -s STRIDE, --stride STRIDE
ferrari's avatar
ferrari committed
56
57
58
59
60
                        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).
61
62
63
64
65
66
  -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:
ferrari's avatar
ferrari committed
67
68
69
70
71
72
73
  -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.
74
75
76

Other:
  -e, --erase           Erase existing outfile. If outfile exist and --erase
ferrari's avatar
ferrari committed
77
                        is not provide, the script will exit.
78
  -n, --no-hyperres     Disable the hyper resolution evalutation of the TDOA
ferrari's avatar
ferrari committed
79
  -M {smart,auto,on-the-fly,prepare}, --mode {smart,auto,on-the-fly,prepare}
80
81
82
83
84
85
86
                        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'.
ferrari's avatar
ferrari committed
87
88
                        'smart' gradually increase the search space dimension, '
                        reducing the number of tdoa to evaluate.
89
90
91
92
                        'auto' automatically try to pick the right
                        method.

Process finished with exit code 0
ferrari's avatar
ferrari committed
93
```