Recording digital data to analog tape... revisited

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi all,

I'm trying to debug a problem - or even decide if I have a problem - in
a system that records data to tape. (This is my camcorder-telemetry
device, in a slightly different incarnation). This thing works very
nicely on my digital camcorder. However I want to use the same circuit
to lay down a data track on an audio cassette, and I'm encountering odd
bit errors.

To describe the format very briefly: The system has a 6.250kHz interrupt
handler which toggles a digital output, resulting in a nominal 3.125kHz
square wave going out to the recorder. Every odd interrupt, a bit is
taken off the head of the Tx queue. If that bit is '0', the toggle
operation is skipped for this interrupt. IOW, the bit cell is bracketed
by edges, and if there's an edge in the middle it's a '1' and if there
is no edge in the middle, it's a '0'.

For those who want gory details, the actual format has another layer on
top of this. The outbound data is divided into packets comprised of:

48 bits '1' - timing header
1 bit   '0' - sync bit
48 x        - 9-bit bytes (data byte followed by a '0' spacer)
2  x        - 9-bit CRC bytes (data byte followed by '0' spacer)

The decoder listens for a burst of at least 10 consecutive "1" bits
(which can't occur in the middle of a data stream). While acquiring
this, it measures the bit cell timing. Once it has acquired enough "1"s,
it keeps sampling until either an excessively out-of-time edge occurs
(>25% of nominal bit cell deviation), or the sync bit is found. In the
latter case, it gathers the incoming data, checks the CRC, and decides
whether to pass the data on to the host.

Now the part where I'd like suggestions. When I record the above signal
on my digital camcorder, the output waveform on playback looks almost
exactly like the input waveform, except that it's understandably
centered around the 0V line. When I record on a simple cheap cassette
player, however, I get a very spiky waveform, which I guess (thinking
about the physics of it) makes sense. Traces are at
<
http://www.larwe.com/camctrl.jpg, sorry for the fuzzy photo.


This spiky waveform actually works quite well with the decoder, because
the decoder only looks for edges, and misses the trailing edge of each
spike due to interrupt latency. The higher BER I'm finding *could* be
attributable entirely to the much lower quality tape and transport in
the cassette unit.

But I am wondering what I can do to make the signal look more like what
I expect. I'm wondering in particular if I should be doing something to
the signal before sending it on to the recorder, or if the
processing/interface circuit I need should be on the playback side. For
instance, should I be trying to match the speaker impedance the recorder
expects to see, probably 8 or 16 ohms? My input is very high-impedance.

Any comments/suggestions?


Re: Recording digital data to analog tape... revisited
I read in sci.electronics.design that Lewin A.R.W. Edwards
ink.net>) about 'Recording digital data to analog tape... revisited', on
Sat, 2 Oct 2004:

Quoted text here. Click to load it

Does it make sense? It looks as if the cassette recorder can't even
handle the fundamental and low-order harmonics in your 3.125 kHz square
wave. Can you try recording a 3 kHz sine wave?

You don't need to simulate the loudspeaker impedance at the output.
--
Regards, John Woodgate, OOO - Own Opinions Only.
The good news is that nothing is compulsory.
We've slightly trimmed the long signature. Click to see the full one.
Re: Recording digital data to analog tape... revisited
Use a current to voltage converter on the head to receive.
You'll be surprised at the difference.

--
KC6ETE  Dave's Engineering Page, www.dvanhorn.org
Microcontroller Consultant, specializing in Atmel AVR



Re: Recording digital data to analog tape... revisited
to analog tape... revisited', on Sat, 2 Oct 2004:

Quoted text here. Click to load it

Sorry, that's not even wrong. You can certainly record 3 kHz without
bias. The sensitivity is low and the waveform is noisy and distorted,
but not that much. In fact, a low(ish)-frequency square wave comes out
not too badly, because the higher harmonics actually act as bias.

Put your scope input on'AC' and see if you can see a 3 kHz square wave.
How does the 'DC' in the horizontal parts get through the AC coupling?
If you need to, think 'Fourier'; the fundamental and all (well, some) of
those odd-order harmonics are all *sine waves* and induce currents in
the playback head quite well.


--
Regards, John Woodgate, OOO - Own Opinions Only.
The good news is that nothing is compulsory.
We've slightly trimmed the long signature. Click to see the full one.
Re: Recording digital data to analog tape... revisited



Quoted text here. Click to load it

Consider remedial electronic training at the local community college.


Re: Recording digital data to analog tape... revisited
An I-V amplifier for the read side will work wonders.

--
KC6ETE  Dave's Engineering Page, www.dvanhorn.org
Microcontroller Consultant, specializing in Atmel AVR



Re: Recording digital data to analog tape... revisited




Lewin A.R.W. Edwards wrote:
Quoted text here. Click to load it

You should attenuate the digital signal into the cassette- you want
5Vpp->1Vpp or 1/5- so something like a 10k->2.2k ohms divider and the
input should already have a DC block. Your waveform looks like what you
see when you overdrive the cassette input amplifier through a capacitor-
which then clamps to the rails, lowers the input impedance, and causes
the input capacitor to charge especially fast. The preamp signal drops
to zero when the capacitor is peak charge and this causes the spike in
the opposite direction immediately after the leading edge spike. Your
main problem is too much amplitude, attenuate it.


Re: Recording digital data to analog tape... revisited

Trying to do digital data on magtape, using an audio path, is fighting a
loosing battle.
Yes, it can be done, but at the expense of complexity and bandwidth.

You'll have a much easier time recording the data directly as manchester
encoded (F/2F) flux reversals, and recovering them with an I-V amplifier
directly from the head. The I-V amp pretty much squashes the head's
self-resonances, and it's actually the right way to treat the transducer.
The head's output current is proportional to the rate of change of the flux
on the tape.

For recording, a V-I converter is best, but you can just feed the voltage to
the head, and let the resistance do the rest..  You DO need a bipolar supply
though. You'll have to experiment for how much current to use, it won't be
much. Think uA rather than mA. When you have the receive circuit working,
adjust the send current so that the amplitude of the recovered data begins
to drop off (tape < saturation), then take it back just into saturation.

The great news is, you don't have to hack up the recorder much to do this,
leave everything else alone, and just wire directly to the head.

You'll have to experiment to see what your best data rate works out to be,
due to gap length, tape speed, and head inductance.

Although it's tough to get ahold of, Finn Jorgensen's "Handbook of Magnetic
Recording" is a good reference.

--
KC6ETE  Dave's Engineering Page, www.dvanhorn.org
Microcontroller Consultant, specializing in Atmel AVR



Re: Recording digital data to analog tape... revisited


Quoted text here. Click to load it

Do you think this is necessary for a kHz data stream? It's analog right-
so a simple lowpass schmitt should recover it nicely.


Re: Recording digital data to analog tape... revisited



Quoted text here. Click to load it
                                      ^^^^
                                      3kHz


Quoted text here. Click to load it


Re: Recording digital data to analog tape... revisited
Depends greatly on the tape recorder.
Try recording white noise, then on playback, see what the response curve
looks like.
In order to get clean edges at 3kHz, you'll need at least 6kHz bandwidth.
Otherwise, the output will be a triangle wave, at best.

What I'm proposing is really pretty simple, other than the manchester
encode/decode.


--
KC6ETE  Dave's Engineering Page, www.dvanhorn.org
Microcontroller Consultant, specializing in Atmel AVR



Re: Recording digital data to analog tape... revisited
to analog tape... revisited', on Sun, 3 Oct 2004:

Quoted text here. Click to load it

Everyone knows that they use magic.

You can get analogue 625/50 video down 5 km of it. You need an equalizer
at each end. Been there, done that, but as assistant consultant I didn't
get to wear the T-shirt.
--
Regards, John Woodgate, OOO - Own Opinions Only.
The good news is that nothing is compulsory.
We've slightly trimmed the long signature. Click to see the full one.
Re: Recording digital data to analog tape... revisited
On Sun, 3 Oct 2004 19:35:49 +0100, John Woodgate

Quoted text here. Click to load it

Has anybody actually seen a "56 kbit/s" modem download at 56 kbit/s ?
It appears that most you can get out of these is about 53 kbit/s, even
when the modem is a few meters away from the telephone exchange codec
in the same room. Apparently the A-law compression makes it
practically impossible to get the full 7 bit/symbol, when the lowest
segment drops into noise.

Quoted text here. Click to load it

Removing any FDM or TDM equipment and loading coils helps a lot :-).

Did you actually get the full 5 MHz bandwidth out of it ? Did you
start from scratch or did you have the BBC 405/50 telephone line
equalisers from 1937-39 as a reference ?

Paul


Re: Recording digital data to analog tape... revisited

Quoted text here. Click to load it

I remember reading an article some years ago talking about the fact that the
56kbit modems (V.90?) had to be throttled down a little due to FCC regs, in the
US.  Here's one saying about the same thing as I recall reading:

  http://www.doorpi.com/support/ynot56k.htm

In Australia, I found this, which suggests and even slightly lower rate as
maximum, there:

  http://www.alphalink.com.au/onlinehelp/lowv90.html

Jon

Re: Recording digital data to analog tape... revisited
Quoted text here. Click to load it
... snip ...
Quoted text here. Click to load it

They don't.  They get it down a 64 Kbps digital link.  They get it
into that link with a combination of carefully compensated limited
length twisted pair link and complex modulation schemes.

--
Chuck F ( snipped-for-privacy@yahoo.com) ( snipped-for-privacy@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
We've slightly trimmed the long signature. Click to see the full one.
Re: Recording digital data to analog tape... revisited

Quoted text here. Click to load it

It's not even a 3kHz channel, if memory serves.  I think the US tarifing
requires only 300Hz to 3000Hz bandpass, with some modest specifications on
"group delay" and roll-off near the edges.  I seem to recall that the phone
companies provide a pretty decent cutoff on the 3000Hz edge, but a lousy gradual
edge on the 300Hz side, so the usable width is actually closer to 600Hz to
3000Hz.

You can get an approximate idea of the cutoff if you have a piano and play the
keys to someone at the other end.  At some point, they will just here "click,
click, click" instead of a tone.

Unlike V.32, which I believe is symmetric, V.90 is an asymmetric protocol
supporting a lower rate up (33.6k, I think, relying on quadrature amplitude
modulation, QAM, as does V.32 and V.34) and a higher rate down (the 56k) from
the central office line card.  That's in part because the phone company has can
control things using their 8-bit DAC for better SNR on the downlink side to your
modem by using pulse amplitude modulation (PAM.)  However, apparently the FCC
(in the US) further limits this to a little less, by rule or regulation.

Look up the words "constellation" and "baud" on google.  Or "constellation
diagram" or "network diagram" or "decision region" or just see:

   http://support.hemscott.net/connect/k56flex/white-paper.shtml

Jon

Re: Recording digital data to analog tape... revisited

Quoted text here. Click to load it

One of the things that enabled the use of > 33kbit modems was the noise
reduction offered by one end of the system being totally digital, so there's
only a single DAC -> ADC stage.

--
Burn the land and boil the sea,
 You can't take the sky from me.

Re: Recording digital data to analog tape... revisited
Quoted text here. Click to load it

Another factor is that the communication is actually synchronous,
thus eliminating start and stop bits and giving a 20% speedup.

--
Chuck F ( snipped-for-privacy@yahoo.com) ( snipped-for-privacy@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
We've slightly trimmed the long signature. Click to see the full one.
Re: Recording digital data to analog tape... revisited
In newsgroup: comp.arch.embedded
Quoted text here. Click to load it

Well, it's sort of.

A very good format for recording to magnetic tape in the low kbps
range is MFM; it's simple, quite robust w.r.t. speed differentials,
and polarity-independent (unlike Manchester coding.)

MFM works like this:

For each bit time, at t = 0 there is an edge (toggle whatever level
the output is at the time.)  If the bit value at 1, at t = 0.5 there
is another edge; otherwise the level stays the same.

During decode, use the first edge for synchronization; if there is
another edge between t = 0.25 and t = 0.75 or so per your own clock,
then record a 1 otherwise a 0.  For higher bit rates you may want to
try to produce a clock from the synchronization pulses instead of
using your own "nominal" clock, but the error window is huge so it
works well.

This was used by the ABC series computers used in Sweden 1978-1986; a
full schematic of the ABC80 machine is at:

http://www.abc80.net/Datorerna/Luxor/Luxor_HW_Info/abc80schema.zip

The ABC80 used 700 bps; the later 800 machine used 2400 bps but the
same modulation technique.

If you want higher bit rates you should start to consider some of the
techniques used by modems, like quadrature decode and multilevel.  The
biggest issue about using those on a cassette tape is that you have
nonlinear distortion due to speed differences; those are hard to
analyze in the context of especially quadrature decode.  An
alternative is to use digital techniques which put in synchronization
pulses in fewer places (if you remember RLL hard drives, that was one
such technique.)

    -hpa

Re: Recording digital data to analog tape... revisited
Quoted text here. Click to load it

Is this not _exactly_ what I described? :) (Serious question. I can't
see the difference between what you just wrote and what I described as
being the actual encoding system in use).

Quoted text here. Click to load it

That's exactly what I do. I calculate the average bit cell during the
sync acquisition phase. There are several sources of clock instability -
tape fluctuation is one, but also both the encoder and decoder are
implemented on AVR micros using the internal RC oscillator, and the
encoder at least can be subjected to temperature extremes. So I thought
it best to adapt the decoder dynamically, since the signal clock rate
will be drifting around more or less constantly.



Site Timeline