Timecode Analyzer Request

Has anyone looked into or interested in developing a SMPTE Linear Time Code Analyzer? The protocol is well documented but I have no experience in creating analyzers. Is there a good tutorial on how to create custom analyzers. Looking for an estimate on the development time it would take to create this analyzer.

Here is a Link for the Protocol:

Thanks in Advance!

@Jaboop Thanks for writing in! I’m not too familiar with Linear timecode, but I took a look at the link you shared and noticed that it mentions the following:

The bits are encoded using the biphase mark code (also known as FM )

We do have a built-in Manchester analyzer as per the below image, which includes the ability to decode in Bi-Phase Mark Code mode.

Could that potentially work out for you as an “out-of-the-box” solution?

Ooh, I’ll bet this would make a good python HLA!

@Jaboop, do you have a sample capture of this data? If so, I encourage you to post it!

We could recommend a python HLA that uses the output of our Manchester analyzer. You can learn more about creating HLAs here:

Our tutorial is fairly limited, but I suggest looking at our example HLAs.

Here is a sample capture of the timecode data over 10 seconds. (there is a small blip after 10 seconds where the Timecode device was disconnected). I attached the Manchester Analyzer that @timreyes suggested and used a bits/frame of 40 since LTC uses 80 bits/frame but the analyzer doesn’t have that option. I also changed the User Bits on the TimeCode Generator from 00:00:00:00 to FF:FF:FF:FF right aroung the 9.14 second mark on the Logic Capture. Currently working on decoding the hex to see if this analyzer will work as a stepping stone to a LTC analyzer

TimeCodewUserBitsChange.sal (77.8 KB)

Thanks for sending that over! That’s great to hear the manchester analyzer puts us at a great starting point. It certainly sounds like an HLA would be the best solution.

Or, if 80 bits/frame is all you need, then it might be fairly straightforward to modify the Manchester source as well to include it.

We’ll look into some existing HLAs to see if any of them might do the job right out of the box. I’ll let you know if we find anything!

@Jaboop Unfortunately, I’m not having much success using some of the available HLAs, such as “Text Messages” and “Concatenator.” These look like they were designed to chunk multiple frames together via a time delimiter (i.e. it looks for time gaps between frames to know which ones to chunk).

Your data doesn’t seem to have any gaps, and therefore, it’s likely that modifying the Manchester analyzer itself to include support for 80 bits/frame might be the best approach, or perhaps a brand new HLA that combines frames based on bit count rather than time gaps between frames.

I’ll get some input from the software team here to see if they have additional thoughts or suggestion and will let you know if so.

@Jaboop do you know why there is a gap here? It’s fairly early in the capture, at about 479ms in.

image

I think it’s because this gap is either too long or too short. The pulses in this data should all be either 250 us or 500 us, and this one is 655 us, which is much too long. I’m pretty sure that’s why this is resetting here.

image

Writing a new HLA which joins 40 bit frames into 80 bit frames and then decodes the included fields should be pretty easy, as long as the Manchester decoder is aligned correctly and doesn’t have any errors like this one.

If the data isn’t perfect, or it does get misaligned, this can be corrected in the HLA by re-synchronizing to the sync word, by decoding one bit at a time instead of one 40 or 80 bit word at a time, but that makes the HLA more complicated.

A quick test suggests the data is OK though. I switched the data table to binary and searched for the sync word, and as you can see, it shows up quite well:

And at the end of the capture, you can see the data has changed:

There might be an offset by 1 in there though, the sync pattern is expected to be in bits [79:64], but instead they are 1 bit lower.

@markgarrison Yes I noticed that in my analysis too and seems to be consistent on power on. At about ~.45-.5 seconds the device resets creating a bit shift of 1. On the reset it also is resetting the Frames, Seconds, Minutes and Hours portions of the TimeCode. To account for this I have been searching for the sync word in binary and starting analysis after the reset.

@timreyes Thank you sounds good. And yeah as @markgarrison also noted not only is there no gaps in this protocol there is also a reset after power on that misaligns the data on the manchester analyzer when trying to group things in HEX. Looking at the binary bits you can see the reset happening at ~.45-.5s into the capture. Not sure the best approach on handling this in an analyzer but I would guess that some method of syncing on the sync word will be necessary since other TimeCode generator probably also have this reset (after power on) and/or assuming a capture is started after power on the sync word will need to be found to align the analyzer anyway.

[Sorry to bump an old conversation, but I came here looking for a solution, and found a good discussion. Others may be directed here looking for a solution as well.] I’ve coded an analyzer (not using HLA) which appears to work well and handles hiccups in the data. The output shows HH:MM:SS:FF for hours, minutes, seconds, frame number for each frame received. The trick was to write a two-step synchronization routine - bit sync and word sync. Bit sync is easy - find a ‘zero’ which is a period of non-transition that meets a timing spec. Following the zero, the clock edge time frames are well known. Then do a word synch based on the unique 16-bit pattern. Then, decode the 64 bits that are just prior to the 16-bit pattern.
Any hiccups are handled properly - a word may not be decoded, but that’s because it was corrupted. The next valid word is decoded properly.


This is my decode (in green) of the original .sal provided. I now use this to debug live SMPTE data generation.

2 Likes

@brianiic This is awesome, and I’m glad to hear you were able to get your analyzer to re-sync in case of prior issues with decoding!

Would you be interested in having us post your analyzer’s GitHub repository to our list of community shared analyzers below? In case we have your permission to do so, we would love to share it!