• Welcome to the Speedsolving.com, home of the web's largest puzzle community!
    You are currently viewing our forum as a guest which gives you limited access to join discussions and access our other features.

    Registration is fast, simple and absolutely free so please, join our community of 35,000+ people from around the world today!

    If you are already a member, simply login to hide this message and begin participating in the community!

StackMat G4 signal glitch?

Joined
May 12, 2018
Messages
12
Likes
9
WCA
2018SKAL02
Thread starter #1
I purchased a StackMat G4 timer to experiment writing software to interface it with my computer. While doing that, I encountered a semi-frequent glitch in the output signal that causes single-bit errors in the data.

Here's what the glitch looks like:

What happens is sometimes when the signal is supposed to invert (low->high or high->low), it instead inverts twice: low->high->low or high->low->high. This may not be completely obvious from the images because it's being smoothed into a shallow dip either by capacitance or the sampling rate of the sound card; I have not yet hooked it up to an oscilloscope.

I'm already detecting and correcting for this in software, but I'm curious to know whether anybody else has encountered this, or if it's just a defect in my particular timer?
 
Joined
Aug 23, 2008
Messages
226
Likes
14
Location
California
WCA
2005FLEI01
YouTube
jflysohigh
#3
I can't say I've seen this exact abberation before, but as you said, it doesn't look like a big issue, so long as you have nicely tuned high and low water marks for declaring that the signal has changed from high to low.

This is not super relevant to you, but I started a page here: https://www.jflei.com/stackmat-phones/ documenting what various phones see when they attempt to record a stackmat signal. I didn't keep track of which stackmats were used for which experiments, however.
 
Joined
May 12, 2018
Messages
12
Likes
9
WCA
2018SKAL02
Thread starter #5
Thanks for the replies. I will experiment more with the hardware when I get an opportunity to borrow a scope (though the one likely available to me is not a storage scope, so it may be of limited use.) Another idea might be to connect it to an Arduino board and have it time the pin change interrupts.

By the way, I found the collection of phone recordings to be very informative. I wonder if the distortion is completely due to voice band pass filtering, or if there are other contributing factors. I tried a couple of different sound card inputs at home (laptop, desktop, external USB audio.) The laptop was fine, but the sample rate on the desktop dropped as soon as I turned on the stackmat (but returned to normal after I shut it off) - my guess is it didn't like the input voltage. The USB device (M-Audio Fast Track Pro) has a "pad" button which you can use to attenuate inputs that are too hot. With the "pad" disabled, the waveform was heavily distorted - and in places it almost looked like the ADC counter overflowed from positive to negative in some spots. Enabling the "pad" helped a lot, though it was still far from perfect.

I have a Moto X Gen 2 (one of the phones for which you have a recording), so I could try duplicating the distortion with mine, then try attenuating the signal to see if it helps. I'll have to look around to see if I have a spare TRSS plug.

Another source of distortion, which you can see pretty clearly in the "nexus" track of https://www.jflei.com/public/img/dialup-stackmat/stackmat-fsk-gerty-nexus5-iphone3gs.png is the DC offset removal at the audio input. That's what is causing the flat tops of the square wave to ramp toward zero. It's happening in the "iphone" track too, but it's harder to see.
 
Joined
May 12, 2018
Messages
12
Likes
9
WCA
2018SKAL02
Thread starter #6
This is not super relevant to you, but I started a page here: https://www.jflei.com/stackmat-phones/ documenting what various phones see when they attempt to record a stackmat signal. I didn't keep track of which stackmats were used for which experiments, however.
I got a couple of parts in the mail today, so I'm back experimenting with the G4's signal. My Moto X Gen 2's captured signal looks basically identical to the one you documented: a high-pass filtered square wave. Since I was curious about the iPhone signal which looked particularly bad, I searched and came across https://blog.faberacoustical.com/2009/ios/iphone/iphone-dock-and-headset-io-frequency-response/ which shows a steep rolloff below 200 Hz. A later post on the same blog points out that iOS 6 fixes this behavior: https://blog.faberacoustical.com/20...6-kills-the-filter-on-headset-and-mic-inputs/ I wonder if you saw any improvement after the upgrade to iOS 6?

My current prototype is using on-off keying of a 2200 Hz square wave carrier with good success. It's based on Arduino which is way overkill... I'm thinking the same basic concept could also be implemented very inexpensively with a 555 timer output through a tri-state buffer pulled to half Vcc - the stackmat signal controls the Output Enable pin of the tri-state. However, one advantage of using a microcontroller is it can be programmed to correct the glitch I described in the original post.

By the way, I was able to confirm the issue with a short Arduino program that uses a pin change interrupt and logs the timing of the pin changes via serial output. One thing I noticed is it only seems to glitch when the timer is idle - so maybe the stackmat enters a power-saving mode when the timer's not running, and that's causing occasional problems with the signal?
 
Joined
May 12, 2018
Messages
12
Likes
9
WCA
2018SKAL02
Thread starter #7
To follow up on my previous post, the 555-based circuit worked just fine, but I came up with an even simpler way to modulate the Stackmat signal. This new version is passively powered - no batteries needed.

Other than the TRRS jacks/plugs, all it requires are:

2 1k resistors
1 1.6k resistor (I used two 3.3k in parallel)
1 10k resistor
2 100nF ceramic capacitors
1 N-Channel MOSFET (I used a ZVN4206AV which I had left over from a previous project)

I created a model of the modulator on the falstad.com circuit simulator: http://tinyurl.com/ybgz4for

A sine-wave carrier, supplied by the computer/smartphone through the left audio output, is OOK modulated by the Stackmat data signal, and the result is fed back into the computer/smartphone microphone input.

I used an 18 kHz tone in my testing, which is nearly inaudible when I accidentally play it at full volume while wearing headphones. Lower frequencies such as 4 kHz work too, however the lower the frequency, the less sharp the on/off transitions will be in the modulated signal.
 
Top