Page 1 of 1

Datasette data as compressed mp3?

Posted: Mon Sep 08, 2014 8:23 am
by ral-clan
Hi, not sure where to post this on the internet, but it tangetially relates to the VIC-20 so I'll post it here.

I have been playing around with old Roland MIDI (music) sequencers. I own an MSQ-100, which is a very early sequencer.

http://retrosynthads.blogspot.ca/2012/0 ... board.html

Because this is a one-track sequencer, it's very useful to be able to back up the memory before you overdub (and potentially make a mistake you need to undo). The sequencer was originally made to back up to an external cassette deck (like early 8-bit computers) via 1/8" headphone style connectors for "tape out" and "tape in". These are essentially D/A convertors that save the sequencer's memory as a screechy audio sound (like a telephone modem, or if you've ever played a VIC-20 datasette cassette in an audio player).

Since I don't have any portable tape decks any more I thought it would be a snap to just substitute a portable minidisc recorder walkman. I did wonder if the audio lossy compression (ATRAC) would cause me any problems. However, I supposed that since a minidisc, even thought it uses such compression, still has much better quality than even some of the best cassette decks of the 1980s (plus less wobble and flutter, and lower noise flow)....I supposed that it should therefore be able to record a simple low-baud backup easily. I even used the highest quality (lowest compression) mode of SP (Standard Play) on the minidisc recorder (this is a 256Kbps ATRAC mode).

Verifying the saved data, however, always returned a verify error.

I then got out my excellent quality SONY flash-media mp3 recorder. This is a really nice sounding device (ICD-SX712) that is capable of recording musical performances. I recorded the sequencer memory data in the highest MP3 bitrate (320kbps or something like that) to it. Again, even though it was a very high quality audio file, every attempt to verify the data returned an error.

I then set the same Sony IC flash recorder to "PCM" mode (uncompressed 44.1Khz audio - essentially .wav). This time it worked. The verify was successful. I also attempted to save to my DAT (digital audio tape uncompressed audio) recorder, and it worked again.

So, obviously, even at the highest quality, any sort of lossy audio compression (ATRAC or MP3) is destroying the integrity of the signal. Only fully uncompressed PCM audio works. I was a little surprised at this, because surely in the 1980s people were backing-up data to less than pefect cassette devices: i.e. normal Ferrous Oxide cassettes using fairly run-of-the-mill recorders that are easily matched in sound quality by today's 320Khz MP3s. I mean, even though on paper an analogue cassette is a non-lossy medium, in real practice, the high-frequency drop-off of most home consumer cassette recorders, coupled with the run-of-the-mill performance of common Fe02 (type I) cassettes was probably the same or worse than an SP minidisc or high quality MP3. Plus the noise, flutter, etc. must be worse on the cassette, whereas these artifacts are virtually absent from either minidisc or mp3.

Also, I've heard of people saving TAP and PRG files from Commodore machines as mp3 files, and hooking mp3 or CD players to the datasette port (or using a car mp3 to cassette adapter inserted into the datasette) and being successful using this method. Surely the Commodore datasette signal is more complex than the data signal from this early model sequencer, yet the audio compression doesn't seem to be destroying the signal in the case of the Commodore MP3s.

Just putting this out there for any thoughts or feedback.

Re: Datasette data as compressed mp3?

Posted: Mon Sep 08, 2014 1:12 pm
by Mike
Below a certain bit rate (around ~256 kbit/s), most mp3 encoders don't retain phase information, but just the amplitude information of the 'audible' and 'important' (<- i.e., the most prominent) frequencies. That alone is already sufficient to prevent correct recognition of most digital formats, also CBM tape.

For me, using *.mp3 on digital data streams is like using *.jpg on cartoony or B/W pictures - in both cases the wrong tool for the job.

Re: Datasette data as compressed mp3?

Posted: Mon Sep 08, 2014 4:03 pm
by ral-clan
Interesting, thanks for the information. I understand phase as it relates to stereo signals - i.e. speakers being out of phase can dampen or accentuate frequencies. But how does phase play into a mono signal like a datasette signal?

Re: Datasette data as compressed mp3?

Posted: Mon Sep 08, 2014 4:58 pm
by Mike
You need both amplitude and phase information to reconstruct a signal faithfully, regardless of mono (single channel) or stereo. This is not just a matter of wrong polarity of one of the speakers (I suppose you meant that scenario). Rather, for a certain frequency, the phase pin-points the zero-crossings of the signal. As an example, SIN(x) and COS(x) both have the same frequency and amplitude, but have a phase difference of pi/2 (thus, SIN(x+pi/2) = COS(x)).

If you just keep amplitude information of all those frequencies present in the signal, but don't retain their phase information, the human ear won't hear much difference. However, in (most) digital signals, the exact timing of low <-> high transients is dependent on the phase of their carrier frequency - and when that information is missing, the transients are washed out, appear at the wrong place, and the whole waveform is distorted.

For compressed audio recordings, these effects are mostly audible in percussion as pre-echoes on snare drums or 'muffled' hi-hats, where the general low-pass behaviour of the compression is not the most relevant contribution to quality loss. With stereo, the position of the instruments along the left-right axis becomes diffuse.

Conversely, for most digital signal transmissions, the amplitude information is less important. Your cell phone works the same way (within limits) whether it is 100 m or 1 km away from the base station, even though in the latter case the signal arriving at the phone has just 1% of the amplitude (inverse-square law!)

Re: Datasette data as compressed mp3?

Posted: Tue Sep 09, 2014 1:50 am
by orion70
Is there something you don't know?
Contest for all the forum members: rich prizes for the first who finds something Mike doesn't know :).

Re: Datasette data as compressed mp3?

Posted: Tue Sep 09, 2014 5:44 am
by ral-clan
Yes, thanks Mike. That answers it just about as well as I could have asked for (and will even force me to learn a few new things with the help of Google in order to fully understand your answer)!

Re: Datasette data as compressed mp3?

Posted: Tue Sep 09, 2014 5:55 am
by Vic20-Ian
Without looking at the reconstructed waveform it is difficult to know the exact cause of bit loss or other errors but consider the analogue tape may have ability to store a higher frequency component above the range of the A/D converter.

Good LP record sounds better / brighter than CD / Digital.

I listened to my favourite album on a friends hifi setup with a Linn Sonndeck? (excuse the spelling) top end preamp and high quality amplifier and speakers and I heard things I had never heard before.

However, like most I still use MP3 and CD as my ears are probably no longer up to finding the difference ;-)

Re: Datasette data as compressed mp3?

Posted: Tue Sep 09, 2014 11:42 am
by Mike
Vic20-Ian wrote:[...] but consider the analogue tape may have ability to store a higher frequency component above the range of the A/D converter.
Sorry, but no. Even very good audio tapes barely go over 16 kHz bandwidth, which at the most would require a sample rate of 32 kHz so the signal can be fully reconstructed (see Nyquist-Theorem). CD Audio easily surpasses that with ADCs and DACs operating at least at 44.1 kHz.

And, as I wrote above, just having a high bandwidth alone isn't sufficient. If the transmission system (i.e. everything between 'record' and 'play') doesn't honor the phase information, you can have as high as frequency bandwidth as you wish, still the signals ultimately will get so heavily distorted that a decoder relying on the exact timing of transients fails.

I'll look into this and should be able to show an illustrated example later this evening.
Good LP record sounds better / brighter than CD / Digital.
Different, yes. But better? Well - this here is not an audiophile forum, I guess. ;)
However, like most I still use MP3 and CD as my ears are probably no longer up to finding the difference ;-)
Even worse, most of the cheap mp3-Players squeeze the audio through a 1 bit digital-analog converter (yes: ONE bit), so what you get to hear is really just that: on and off. Do it just often enough, and low-pass filter it, and the ear can't hear any difference to the original. :twisted:

Re: Datasette data as compressed mp3?

Posted: Tue Sep 09, 2014 3:02 pm
by Mike
Mike wrote:I'll look into this and should be able to show an illustrated example later this evening.
Here we go: FOURIER DEMO. You'll need at least a +8K RAM expansion to run the demo.

The demo takes some time while it:

- calculates a spectrum of an example signal (periodic %10110110, four times oversampled),
- recreates the original signal from the spectrum,
- plots the original signal from the spectrum as graphics in the top half of the screen (incidentally, it's also interpolated),
- and then eliminates the phase information, and plots the processed signal in the bottom half.

Between these steps, the program waits for a key press.

Besides the disk image, I also included the source code in text form with a few comments. For the moment, I'll put it here as is; if there are further questions, don't hesitate to ask.

Greetings,

Michael

Re: Datasette data as compressed mp3?

Posted: Tue Sep 09, 2014 5:51 pm
by ral-clan
Thanks very much for your input on this very informative thread. I'm only understanding about half of it on first read, and will have to investigate.

For instance, I really don't know what oversampling does. I've head the term many times in regard to A/D audio converters and CD players. I assumed it mean the laser (or whatever) was re-reading the same spot over and over again to avoid read-write errors. I suppose I should just Google it.

GOOGLED...

Ah, a cursory Google search reveals it's sampling at a higher rate than necessary to avoid problems with the Nyquist rate.

Re: Datasette data as compressed mp3?

Posted: Fri Sep 12, 2014 12:58 am
by Bacon
Strange. I've backed up the data from my Akai AX60 analog synth using its tape interface and saved the audio as an mp3 file several times, and I've never had any problems loading the patches back into the synth (the synth is from fairly early on in the MIDI era when when MIDI SysEx backup wasn't very common, although the contemporary Roland Juno 106 had this ability).

Could it be that, although the technology is basically the same in all the products from this era (Roland sequencer, Akai synth, Commodore computers), some manufacturers managed to make their decoding circuits more forgiving?

Re: Datasette data as compressed mp3?

Posted: Fri Sep 12, 2014 5:56 am
by ral-clan
Hi Bacon,

I remember the Akai (it's a very nice looking synth - the dark look of the DX7 but with the nice physical controls of the Junos) - and you've tempted me to try the mp3 backup with my Juno-106 to see if it works.