Close
0%
0%

Atomic Synchronator

Beyond '67 SMPTE timecode: an affordable GPS based AUX syncing track generator for dual-system sound or multicam setups

Public Chat
Similar projects worth following
This is a cheap hardware dongle for simultaneously injecting an audio syncing signal into the sound track of a camera and into an AUX track of an audio recorder (one dongle per device).

Who is this for?

Vidoegraphers who don't want to fork:

• 200 CAD for a batch syncing program
• neither 400 CAD for each recording device to sync (cams, audio recorders)

and for DIYers who can

• solder some thru-hole electronic components
• flash firmware on an Arduino compatible board
• intall some FOSS on their desktop and use the CLI

So I'll implement I've implemented an audio sync track using the 1 PPS from a GPS receptor (those pulses are precise to 10 nanoseconds typically). Between each seconds the time of day is encoded into the track and will be parsed in post-production by  PPSsoundmerge (a program to be written) that will merge sound clips with their corresponding video tracks (thanks to FFmpeg!) and this, before importing into your NLE.

The DD:HH:MM:SS UTC time of day are  BFSK  modulated. Initially I tought I would used ASK over FSK  so maybe (just maybe) NLE softwares doing wave form analysis syncing could use it (PluralEyes, Syncaila, FCP, Kdenlive, Resolve, any other?). But for now it's only BFSK:  I don't want to fight with multiple wave form analysis algorithms from all those NLEs.

  • 1 × a SAMD21 board eg Adafruit Feather M0 proto, 20 USD
  • 1 × a GPS module with 1PPS output eg Adafruit Feather Ultimate GPS 40 USD
  • 1 × a single supply opamp for mid-level reference aka virtual ground I'm using a LM358
  • 1 × Arduino IDE, python and FFmpeg installed

  • Almost a Kickstarter sales pitch

    Raymond Lutz3 days ago 0 comments

    8-)

  • On to BFSK demodulation!

    Raymond Lutz6 days ago 0 comments

    then

  • Back to a square

    Raymond Lutz06/15/2021 at 23:16 0 comments

    I didn't tell you I  changed, yet again, the synchronization pulse, did I? It's a square! Other shapes are too distorted when acoustic coupling is used and it was impossible to robustly detect it. See and ear for yourself the result (filmed on a NIKON D300s with mic input):

  • Working on doc

    Raymond Lutz06/15/2021 at 01:15 0 comments

    Signal:

    Encoding:

  • Find Silences

    Raymond Lutz06/12/2021 at 00:51 0 comments

    Before parsing the time of day BFKS modulated word, I want to locate exactly the PPS sync pulse in the audio track, and one step is finding where are silence segments. I tried pydub.silence.detect_silence() but it needs (not surprisingly) prior knowledge of a silence threshold. I wanted something more agnostic and with the simple pulse train of my signals, I opted for fitting a sinus over the square wave envelope (using the excellent wrapper lmfit-py). It's a GO:

  • Found the right sync pulse shape

    Raymond Lutz06/02/2021 at 16:45 0 comments

    But still, I'm stuck with strange artifacts (nothing too serious)... Note the exponential decay in the camera recording (a Canon PowerShot ELPH 330). Gonna do the same measurements with my Nikon D300S.

  • Celebrated too early

    Raymond Lutz06/01/2021 at 21:00 0 comments

    Well, I rejoiced too soon. A much larger sampling (a 10min take) revealed the pulse location is much less robust than I thought... back to the drawing board.

    Restating project goals

    For those who just jumped in, here's a recap: I want to design and implement an audio time code (and accompanying hardware) for automated video synchronization, cheaper than existing solutions, working on camera without sound input  and using off the shelf components.

    Acoustic coupling challenges

    I want to localize pulses at the highest possible precision in the recorded audio. Typical cameras use a sampling frequency of 48 kHz so I’m aiming at a maximum variation of more or less 4-5 sampling periods, ie ±100 μs. For now I’m still exploring which pulse shaping is better at avoiding transients in the recordings.

    Fighting against the camera automatic gain control

    I generate this symmetrical shape from the SAMD21 DAC output and feed it to a small headphone speaker:

    And here’s the resulting sound recording, note the asymmetry now present:

    I guess I should slow down the attack to avoid triggering the AGC too heavily, and I should generate an already odd signal (odd vs pair).

    Something like a tri-level sync pulse (surprise!) and aim at the zero-crossing point as the timing anchor.

    Time of day (UTC) is done and is part of the 23 bit BFSK word following the aforementioned sync pulse whose location I'm still optimizing:

    Nota: I don't modulate the amplitude, it's an artifact of some non-flatness in response curves (mic, speaker, air gap?) The two used frequencies are 1000 and 1800 Hz.

  • It's aaaliiive!

    Raymond Lutz05/28/2021 at 15:04 0 comments

    This is getting better and better...  Pulse location is off by only 20 μs for just a single pulse among four!

  • Gaussian pulse envelope

    Raymond Lutz05/28/2021 at 00:12 0 comments

    No more transient with acoustical coupling! Started working on signal processing...

    Next, PPS localization (at near audio sample precision!)  with gaussian pulse fitting:

  • acoustical problems

    Raymond Lutz05/25/2021 at 00:59 0 comments

    aaaahh...  Sync pulse direct recording is OK. See second track below, exactly 20 cycles, direct meaning with electrical connections between the board and my computer audio line in.

    But acoustical coupling shows transients that will make postprocessing harder...

    Acoustical coupling for board → speaker → mike → computer ADC

    I'll rather try to shape the pulse with a gaussian on the SAMD21 to avoid those.

View all 16 project logs

  • 1
    Lowering costs

    A motivated maker could lower the cost designing a PCB for a castellated SAMD21 board (from Adafruit or Seedstudio) and a "raw" GPS module Costs: 2 x5$ + PCB$ .

View all instructions

Enjoy this project?

Share

Discussions

Sean McVeigh wrote 01/03/2021 at 22:25 point

Considering this is an indoor device, why not use a chip-scale atomic clock?
EDIT: never mind, thought the price had come down, although you could sell as pro product :D

  Are you sure? yes | no

Raymond Lutz wrote 01/03/2021 at 22:36 point

ah ah! You got me on that one! And I thought you were joking until I looked it up!!! Those devices DO exist!!!  But for now prohibitively onerous... https://www.mouser.ca/ProductDetail/Microchip-Technology/090-03240-001/?qs=w%2Fv1CP2dgqpPJJa0jwVC6w%3D%3D

Anyway, you would have the hassle to jam sync them before use... Also this GPS chipset works OK indoor, even in a modern building with a steel framing (but in a basement reception in spotty).

  Are you sure? yes | no

Sean McVeigh wrote 01/03/2021 at 22:47 point

Yeah I worked on one in grad school (modded as magnetometer): https://tf.nist.gov/general/pdf/2703.pdf

  Are you sure? yes | no

Sean McVeigh wrote 01/03/2021 at 22:51 point

Wait, I assumed you only need one clock source? Use Ethernet for sync to capture devices: https://en.wikipedia.org/wiki/Precision_Time_Protocol

This is the technique used for multi-AP clock sync for triangulation in indoor location, often using GPS as CLK source. Didn't look too carefully if the recent updates meet your timing requirements.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates