Skip to main content

rec2taps

This utility extracts tap times from a input device recording synchronized to the start time of an stimuli device under the assumption that the recording has one channel where a loopback from the stimuli was recorded.

This tool was written as part of a proposed setup for recording tap times presented in "Simple and cheap setup for measuring timed responses to auditory stimuli" (Miguel et. al. 2020).

The tool works as follows: according the proposed experimental setup, a channel from the output is looped back into the recording device and recorded along with the signal of the input device where the participant performs the tapping. The tool takes as input the stimuli presented and the recording and analyses the signals to obtain tap times relative to the beginning of the simuli. This requires the tool to find which channel of the stimuli is also recorded in at which file of the recording. With this information, the tool can recognize which channel in the recording corresponds with the the stimuli and which is the input. The lag between the stimuli start and its start in the recording is found by maximizing the crosscorrelation between the loopback and the original signal (in the looped-back channel).

Next, the input signal is analyzes to obtain peaks. Peaks are found according to the algorithm in scipy.signal.find_peaks by detectecting peaks with a minimum prominence and distance between the peaks. These parameters can be configured (see rec2taps -h).

Installation

  • From pypi:
    pip install m2-rec2taps
  • From sources:
    git clone https://github.com/m2march/rec2taps.git
    cd rec2taps
    python setup.py install

Usage

rec2taps stimuli_file recording_file > outfile.txt
  • stimuli_file is the original audio file played
  • recording_file is the audio recording done during the experiment. Should have the same sample rate as the stimuli_file and have one channel of the stimuli recorded as one channel of the recording.
  • The utility writes the tap times detected, in milliseconds, one per line, to the standard output. The example pipes the output into a new file.

Further options can be provided to calibrate the sensitivity and minimum distance between detected taps. Use the -h flag or more details.

Release files for m2-rec2taps 0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for m2-rec2taps 0.9
File Size Uploaded
m2-rec2taps-0.9.tar.gz 5.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for m2-rec2taps 0.9
File Interpreter ABI Platform
m2_rec2taps-0.9-py3.8.egg Legacy Egg format - - Details
m2_rec2taps-0.9-py3.7.egg Legacy Egg format - - Details
m2_rec2taps-0.9-py3-none-any.whl Python 3 none any Details

Total release size: 34.9 kB

Release files / m2-rec2taps-0.9.tar.gz

Download URL m2-rec2taps-0.9.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d50e9fe8af399094b662be658a18ced86c7237896489569c05cbc63f24ea1190
BLAKE2b-256 checksum
How to use checksums
f0dcb9aaa50f51c75f99cf725a9fd6d36677f4cfaf56b1f9405ba689ca31bef9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release files / m2_rec2taps-0.9-py3.8.egg

Download URL m2_rec2taps-0.9-py3.8.egg
Size 10.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
ec3af83921b5418e9fcfb76020309676477e557a04c5d66464f7d526d8be79fd
BLAKE2b-256 checksum
How to use checksums
e58789954a299b97926f9de1ab19d93064ffff80ae58e599369215056cc19547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release files / m2_rec2taps-0.9-py3.7.egg

Download URL m2_rec2taps-0.9-py3.7.egg
Size 11.6 kB
Tags Egg
SHA-256 checksum
How to use checksums
0230465c7cba3b4ae8f498d96f95b538ea43878c20ab8cf5d20c6ea3316abee6
BLAKE2b-256 checksum
How to use checksums
a55df2feafeacc3ecba8500f704b23c11cba7bd8751341fe7ac4c27e71d90288
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release files / m2_rec2taps-0.9-py3-none-any.whl

Download URL m2_rec2taps-0.9-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f41260b5bb1cd143a79f4b1a8412559b192e83aea33929ecfa6016610c822de5
BLAKE2b-256 checksum
How to use checksums
c68ead6576694a7629bb3f3316e87a92baf1ee27c014d4af639f062c6a3bbdb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.9 This release

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page