Thursday, 15 August 2013

Just an idea for SSTV

There was an interesting circuit in the latest Radcom from the RSGB for a receiver for 14MHz PSK31 digital signals. This got me thinking that something similar could be used for SSTV.

The receiver is an RF amplifier, followed by a crystal filter and balanced mixer, whose output goes directly to an AF amplifier.

The transmitter is a balanced mixer driving an output stage.

Here it is:

2013 08 15 18 05 39

The AF input and AF output are connected to an iPad using a Griffin iMic interface. The iPad is running Blackcat systems SSTV software which can both receive and transmit.

I have not yet worked out the RX/TX switching, and it occurs to me that I don't need two 14230kHz oscillators, one would do. So the TX oscillator could feed the RX mixer…

Tuesday, 6 August 2013

Digital Audio - Lossy compression

Lossy codecs save space on storage and speed download times, MP3 reduces files to 1/12th, WMA to 1/24th of their uncompressed size. Subjectively and very often, people say they cannot hear the difference between a CD, a 128kbps MP3 or a 64kbps WMA stream. But this is when they are listening on pitifully small speakers, for example on a laptop, or on poor earphones plugged into an MP3 player. But play the same tracks on a better hifi system and the differences are clear. Play the same track from a CD and the difference is very striking. Play the same tracks from an HD Audio download (24bit/96kHz) studio master and the differences are dazzling.

The problems with lossy compression are many, and mostly based on dubious psycho-acoustic assumptions:

1. The removal of all audio information above a certain frequency - “can’t hear it anyway”

2. Stereo to mono conversion completely or above a certain frequency - “stereo is only heard at mid frequencies”

3. Phase collapse, the elimination of phase differences between channels, completely or above a certain frequency - “blurred instrument positioning in the sound stage does not contribute to musical appreciation”

4. Frequency masking, loud tones masking lower volume information in nearby frequencies - “just lets the main music come through”

5. Temporal masking, loud tones that mask lower volume information that precedes or follows the masking content - “just lets the main music come through”

6. Echo, the insertion of unwanted information before and after sharps transients - “the ear doesn’t hear this small change”

Subjectively people find that WMA is better than MP3 is better than Real Audio lossy compression. But technically they are all bad. This can be seen by looking at the spectra of various test sounds before and after compression.

The first spectra show a sound clip original (in WAV uncompressed format) versus the same clip of pink noise in MP3, Real Audio and WMA reproductions.

Screen Shot 2013 08 06 at 13 51 06

Here's another example:
Screen Shot 2013 08 06 at 13 51 50

The MP3 output looks ugly, with low pass filtering above 10kHz, but look at the added noise round the low level tones! The Real Audio has better channel separation and frequency response up to above 13kHz, but the noise floor is up to just -60dB, close to the right channel levels. WMA compression delivers clean stereo separation and high frequencies above 18kHz, but a slightly increased noise floor.

Sorting out the bits

One of the ambitions I have had for a long time is to get all the binary bits from a musical recording through my chain to the loudspeakers. No matter what they make of them when they get there, which is another matter.

What do I mean? Well these days you can start with a CD, or a downloaded file which can be CD 16 bit/44.1kHz or upwards - my limit today is 24bit/96kHz as this the highest supported by my iMac and iTunes. A 24bit/96kHz file will carry a 120dB dynamic range and DC to 48kHz bandwidth. Not so good as an orchestra but a lot better than CDs.

But to throw in another difficulty in the way I insist on sending my music over my WiFi system, to avoid all those ugly wires and allow me to have the computer in one room and the system in another. So what I have is an iMac running iTunes, an Apple TV, and a spare Macbook also running iTunes. The Apple TV or the Macbook can be connected by an optical link to my DAC and the line out audio to my amplifiers.

A word about the DAC. I hate, if that is not too strong a word, all these DACs advertised as the best in sliced bread, but costing $1000s. This is ridiculous. The basic guts of a DAC are a couple of semiconductor chips, one to receive the SPDIF optical input and pass it to a decoder as a serial I2S signal. The decoder is the guts of the system and many semiconductor makers offer products for this function. However sorting the men from the boys there is only one company, English, that leads the field, this is Wolfson. The make both chips required, the WM8805 SPDIF and the WM8740 DAC. Together they cost $10! So why $1000? The problem is to find someone who makes a DAC with these chips. Fortunately a company in Hong Kong, HA INFO Audio Electronics, has seen the light and makes a rather neat DAC with these chips. It has digital SPDIF and Coax input up to 24bit/192kHz, and line and headphone output for under £100. Which is a great improvement over $1000-2000!!!

Then the amplifiers. Here again prices of equipment are ridiculous at anything up to the $5000 range. I am a great fan of class D amplifiers as I believe they can give excellent quality and performance, including transient rise times, and have high efficiency so they run cool. However looking again round the industry there are few amplifiers that quote a DC to 50kHz bandwidth. I believe we have to maintain the bandwidth all the way from the computer file to the loudspeaker terminals. And this means DC to 50kHz for a 24bit/96kHz source file. One company that makes such amplifiers is Hypex with modules up to quite high powers - 400W or so. I use their 180W models in a small case with a conventional power supply, the only requirement being to use massive capacitors of 10,000uF for both positive and negative rails. The result is a low cost amplifier (total about £200) which has excellent performance and DC - 50kHz bandwidth.

Getting the audio from the computer to the DAC SPDIF optical input can be done in three ways:

1. iMac > Apple Airplay > Apple TV > DAC. But this compromises the bandwidth as Airplay down-samples files to 16bit/44.1kHz. And this is what comes out of the Apple TV. So that is no good.

2. iMac > file copy > MacBook > DAC. Copy the 24bit/96kHz files to the MacBook and output SPDIF optical from there to the DAC, in this case the system does support DC-50kHz bandwidth all the way though. But files have to be copied.

3. Register both iMac and Macbook with Apple for “Home Sharing”. This allows the MacBook to see and retrieve the music from the remote iMac. And, wonder of wonders, it can retrieve 24bit/96kHz files over WiFi with NO down-sampling. This means that in this way high quality music files can be played over my WiFi system. (I Wonder why Airplay and the Apple TV down-samples? WiFi can easily carry the bit rates of the 24bit/96kHz music (2Mbps or so). Its probably because the Apple TV has a rather slow processor built-in??? Anyway Apple’s iTunes preferred music delivery system is sadly only 16bit/44.1kHz AAC compressed music...).

So now the problem is solved. If you are a newbie then I strongly suggest to use a setup of:

- Music Centre, either remote iMac or local Mac Mini - or both

- Itunes with Home Sharing enabled, HD tracks downloaded from the many on-line stores (Linn, 2L etc)

- The DAC and Amplifiers I mentioned above (Google them).

- Finally an iPhone or iPad with Apple Remote to control iTunes running on one or both of the Macs.

Don’t forget to enable 24bit/96kHz sound output using the utility Audio MIDI Setup on both Macs. And restart iTunes after you have done it.

A headless system can be created by using a Mac Mini as your music centre and controlling it by Screen Sharing / VNC Viewer from a remote iMac or iPad. In this way you can configure iTunes, buy HD track music and have a totally integrated low cost HiFi system.

Now about those loudspeakers which I want to drive from DC to 50kHz, what about those? Suggestions welcome.

Tuesday, 30 July 2013

Multiple audio outputs on iMac

I have been using my iPad with the Blackcat Systems SSTV program to view SSTV pictures. The output of the iMac was connected to a A/D converter, the Griffin iMic, which was then plugged into the iPad. [I have used the same I/O device to listen to an SDR radio…]

This all ran well but the problem was that when I plugged the iMic in to the iMac headphone jack, I lost the audio output from the internal loudspeakers, and so could not monitor the audio signals or tune around the band without unplugging the iMic…

So how to output audio to multiple devices? Well there is a way. Open the utility Audio MIDI Setup, and chose to add a device (+ sign). Then chose Multiple Output Device, now select the outputs you want to receive the signals. Here's a screen shot:

Screen Shot 2013 07 30 at 11 53 48

In my case I was outputting the signals from Web based SDR radio at http://websdr.ewi.utwente.nl:8901.

Screen Shot 2013 07 30 at 12 00 00

and tuning to the SSTV frequency of 14230kHz - you can see a signal coming in.

I can now drive the iMic/iPad and listen via an Firewire audio interface, the FCA202, with a small battery powered loudspeaker plugged into the headphone jack. Or I can plug the iMic into the FCA202 headphone output to pick up the audio at the same time as it plays through the internal iMac loudspeaker.

LATER

I have had two or three crashes of Safari when listening to the radio I mentioned above, I have no idea why. To cure the problem I was forced to remake and select (Alt-Speaker Icon) the Multiple Output device and then restart Safari. Bug reports sent to Apple.

Friday, 26 July 2013

Putting a bigger HDD in Maggie's computer

My wife, Maggie, has run out of disk space - mainly from having over 12,000 picture in iPhoto!

So I plan to install a spare 500GB HDD that I have lying around. The problem is that I don't have the original OS X installation disk that came with the computer. But Apple to the rescue, as the computer, an old 13" white Macbook, has been upgraded to OS X Lion (10.7) and this can be installed over the internet from Apple.

How?

IMPORTANT!!!

BACK UP TO TIME MACHINE EXTERNAL DRIVE!!!

Then first you need a copy of a program called Recovery Data Assistant. This has to be down-loaded from the Apple web site.

You then need a USB stick which has to be (*) formatted using Disk Utility, as Mac OS Extended (Journaled) and selected and partitioned as one partition with the Option of GUID. This makes it suitable for a bootable drive. The Recovery Data Assistant app is copied onto this USB drive - needs above 1GB, I have an 8GB drive so that's OK.

HARDWARE

Next you replace the physical HDD in the computer - this is fairly easy and there are instructions on the Apple web site.

INSTALL

Now restart the computer an hold down the Alt key.This will bring up a picture of all the drives on the machine, one of which will be the USB "Recovery" stick. Chose it.

Now you must erase the new HDD and format it correctly, from the Recovery Data Assistant chose the menu option of Disk Utility. Then, as above for the USB stick (*), format and partition the drive as bootable.

Nearly there.

Now quit Disk Utility and still in the Recovery Assistant select to Install OS X from the internet. Join your local WiFi network and follow the on screen instructions - you will need the Apple ID you used to purchase the original OS X Lion and the password.

After about an hour you will have a brand new computer, running OS X Lion. You can transfer the old HDD files back from the External Backup Drive using the Utility Migration Assistant.

Tuesday, 9 July 2013

Graduation

Charlie graduated today from Stafford Uni with a BEng (Hons) degree. Well done!!!

Charlie Graduation Stafford UK

Monday, 1 July 2013

New DAC

For some time I have been mightily disappointed in the DAC that I had in my music system. I built an amplifier using the excellent Hypex modules; chosen for two reasons, bandwidth (up to 50kHz) and low distortion. But I couldn't find a low cost DAC and had to fall back on what I thought was the best from HK, since I object to paying the ridiculous prices asked for by most audio companies. (I should explain. Wolfson in UK make the best ICs for building a DAC, there WM8805 SPDIF interface and WM8740 DAC are by far the best in the industry. And they cost less than 10$, so why should I pay 1000$ for a DAC?).

But then I found that some sensible HK supplier had taken the application note for the Wolfson chips and made a DAC, for £80! Complete in a nice box, with headphone amplifier also, and with an AC power supply. This DAC covers all bit depths (16 & 24) and all sample rates from 44.1 to 96kHz. So I bought one.

I coupled this DAC up in one of two ways:

1 Optical input from my Apple TV, and streaming music over from my iMac by WiFi. This was the response:

Screen Shot 2013 06 30 at 09 53 06

As you can see it cuts off sharply at 19kHz, this is due to the way Apple's Airplay handles the transfer, any file in iTunes is down sampled to 44.1kHz before being sent over the WiFi, and at the Apple TV end there is a low pass filter at around 20kHz. The idea being that music only needs a 20Hz - 20kHz bandwidth, an idea which I find ridiculous - for a violin to sound like a violin you have to pass all the frequencies it generates, and these stretch up beyond 50kHz.

2 Optical input from my MacBook with Audio MIDI setting to output 96kHz. This was the DACs response:

Screen Shot 2013 06 30 at 09 51 06

Well now isn't that better? A response out to nearly 45kHz - against the maximum you could expect from a 96kHz rate of half that or 48kHz. And note that the response goes down to DC, as do my amplifiers.

What is very exciting is that with "Home Sharing" turned on, so that I can access music on my iMac (some of which is 24/96) then playing a track through the MacBook gives the wide bandwidth, the same as playing directly from the MacBook!

Now I am sure that I am sending all the possible frequencies from the music files to my speakers. What they do with it is another question… but it sound much better.