Giter Site home page Giter Site logo

pcm-align's Introduction

pcm-align

Scala CI

Test if WAV files captured from DAT tapes are aligned (i.e. more or less the same). This is a project I needed for a very specific case. My old Sony TCD-D100 portable DAT recorder has an S/PDIF output, but there's some digital noise on the 4 least significant bits (random, not noticeable, completely acceptable in my case). This is something I noticed with my current hardware (2019), as well as a very long time ago with my old soundcard. The problem probably comes from the Sony recorder. Another problem is that I want to automatically detect drops (i.e. short bursts of lost data), if they occur. So the idea is that I will transfer one DAT tape several times. Then, I want to automatically align the resulting WAV files and determine whether some data was lost in one WAV file or another. The algorithm I use for the computation of the best shift/alignment is neither fast nor memory-efficient (WAV files are loaded into memory!). But it works.

Example of output:

$ ./pcmalign.sh /DATs
Parsing files in /DATs...

WAV file count: 5
 (1) /DATs/recording1.wav
 (2) /DATs/recording2.wav
 (3) /DATs/recording3.wav
 (4) /DATs/recording4.wav
 (5) /DATs/recording5.wav

Comparing files 1 and 2... avg diff = 138.221, percentile(99.99) = 5678, aligned = false
Comparing files 1 and 3... avg diff = 222.371, percentile(99.99) = 19445, aligned = false
Comparing files 1 and 4... avg diff = 222.146, percentile(99.99) = 19446, aligned = false
Comparing files 1 and 5... avg diff = 222.365, percentile(99.99) = 19445, aligned = false
Comparing files 2 and 3... avg diff = 52.559, percentile(99.99) = 5868, aligned = false
Comparing files 2 and 4... avg diff = 29.272, percentile(99.99) = 5556, aligned = false
Comparing files 2 and 5... avg diff = 52.562, percentile(99.99) = 5868, aligned = false
Comparing files 3 and 4... avg diff = 25.606, percentile(99.99) = 3867, aligned = false
Comparing files 3 and 5... avg diff = 2.346, percentile(99.99) = 11, aligned = true
Comparing files 4 and 5... avg diff = 24.680, percentile(99.99) = 3827, aligned = false

WAV file pair candidate count: 1
 - 'recording3.wav' vs 'recording5.wav': avg diff = 2.346, percentile(99.99) = 11, aligned = true
    -> favoring 'recording3.wav' since it is longer by 1896 samples

pcm-align's People

Contributors

obruchez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.