Skip to main content

Utility to obtain tap times from a tapping recording

Project description

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.

Project details


Release history Release notifications | RSS feed

This version

0.9

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

m2-rec2taps-0.9.tar.gz (5.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

m2_rec2taps-0.9-py3.8.egg (10.8 kB view details)

Uploaded Egg

m2_rec2taps-0.9-py3.7.egg (11.6 kB view details)

Uploaded Egg

m2_rec2taps-0.9-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file m2-rec2taps-0.9.tar.gz.

File metadata

  • Download URL: m2-rec2taps-0.9.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for m2-rec2taps-0.9.tar.gz
Algorithm Hash digest
SHA256 d50e9fe8af399094b662be658a18ced86c7237896489569c05cbc63f24ea1190
MD5 996faf7c1647410a670ed4e57f09c7a5
BLAKE2b-256 f0dcb9aaa50f51c75f99cf725a9fd6d36677f4cfaf56b1f9405ba689ca31bef9

See more details on using hashes here.

File details

Details for the file m2_rec2taps-0.9-py3.8.egg.

File metadata

  • Download URL: m2_rec2taps-0.9-py3.8.egg
  • Upload date:
  • Size: 10.8 kB
  • Tags: Egg
  • Uploaded using 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

File hashes

Hashes for m2_rec2taps-0.9-py3.8.egg
Algorithm Hash digest
SHA256 ec3af83921b5418e9fcfb76020309676477e557a04c5d66464f7d526d8be79fd
MD5 b2620a3d2ac0b135fc34ec3fead619ec
BLAKE2b-256 e58789954a299b97926f9de1ab19d93064ffff80ae58e599369215056cc19547

See more details on using hashes here.

File details

Details for the file m2_rec2taps-0.9-py3.7.egg.

File metadata

  • Download URL: m2_rec2taps-0.9-py3.7.egg
  • Upload date:
  • Size: 11.6 kB
  • Tags: Egg
  • Uploaded using 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

File hashes

Hashes for m2_rec2taps-0.9-py3.7.egg
Algorithm Hash digest
SHA256 0230465c7cba3b4ae8f498d96f95b538ea43878c20ab8cf5d20c6ea3316abee6
MD5 eea7ded39d5cb52ca65828302cfb3afa
BLAKE2b-256 a55df2feafeacc3ecba8500f704b23c11cba7bd8751341fe7ac4c27e71d90288

See more details on using hashes here.

File details

Details for the file m2_rec2taps-0.9-py3-none-any.whl.

File metadata

  • Download URL: m2_rec2taps-0.9-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for m2_rec2taps-0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f41260b5bb1cd143a79f4b1a8412559b192e83aea33929ecfa6016610c822de5
MD5 307e76b16b948aa65006add50ac13b28
BLAKE2b-256 c68ead6576694a7629bb3f3316e87a92baf1ee27c014d4af639f062c6a3bbdb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page