Close

KCS Audio generation

A project log for KCS tape viewer

Display the data from a Kansas City-encoded tape on a 7-segment display using only discrete transistors

matsengmatseng 07/13/2017 at 04:375 Comments

First things first.... If I'm going to make a circuit to decode a Kansas City tape I'd better have some audio to play around with.

So I wrote a small Python software (my first Python code ever) to create the sample tables for a single zero and one bits of audio. Then I put those into a bash script that pieces the samples together for a couple of bytes worth of data, writes that to a raw binary file and calls the sox utility to convert the raw sample into a proper .wav-file.

The full file looks like this:

Zooming in at around the start of data at 40 milliseconds into the file it looks like this - nice and clean sine waves.

Discussions

zpekic wrote 12/13/2020 at 20:24 point

Interesting project - I need to dig deeper and learn more about this area. I was toying with the idea of extending my cassette project to be able to read any format directly from the tape and dump it into binary and / or hex file.

  Are you sure? yes | no

matseng wrote 07/13/2017 at 16:40 point

True, but by some extremely lucky coincidence the 2400Hz & 1200Hz tones will end up at the correct number of full cycles in exactly 147 samples at 44100Hz which is a common samplerate for wav files. So they match up perfect without any discontinuities or glitches at all.

I had intended to use something lower to reduce the number of data points that the poor ltspice had to wade through, but it turns out that 200ms of data at 44100 Hz sample rate is not a problem for ltspice.

  Are you sure? yes | no

Ted Yapo wrote 07/13/2017 at 20:55 point

I've never tried using wav files with LTspice.  That's cool. Now I want to see how some simple 1-transistor amplifiers sound...

  Are you sure? yes | no

matseng wrote 07/14/2017 at 02:21 point

Ah yes.... ltspice can both use a wav as the input for a voltage source, and it can also generate a wav from a node in the circuit so you actually can listen to what spice is generating.

  Are you sure? yes | no

Ted Yapo wrote 07/13/2017 at 16:06 point

I would have assumed that splicing together samples would produce discontinuous phase, but I guess if your samples are just right, it works pretty well :-)

  Are you sure? yes | no