Thursday 29 August 2013

A question / Syria

I have just one question about getting involved in the internal war in Syria.

WHAT IS IN IT FOR US?

My conclusion is, nothing.

WE must stop being moralistic and tub thumping. Our job is not to rule the world (maybe it's a colonial hangover, but all the same…).

So lets stop being coerced by the USA into foolish military actions, we must insist on a political solution among the people of the Middle East themselves. It's called self-determination.

Leave them to it. If they want to shoot themselves, gas themselves or whatever. Just be smug and glad it doesn't happen here - any more. We have grown out of it.

Tim! Get a grip

The expected announcement of new iPhone models by Apple, has been completely ruined by leaks.

Many of which are probably true and show the exact models that will be announced.

We have seen both internal electronics, screen shots - probably inevitable since beta versions of iOS7 have been widely circulated to help iron out bugs by developers - and worst of all finished products that the public are supposed to be surprised by.

After all that is the centre of Apple marketing, is it not? To bring a new surprise to the market!

Screen Shot 2013 08 29 at 10 01 08

In past times Apple has always kept very tight secrets about new developments, but somehow Tim Cook seems to have lost control, or is not exerting enough control, over manufacturers and their employees who have photographed many of the secret developments, both internal circuits, cases and finished products.

Enough to completely ruin the anticipation of the event.

Come on Tim. Get a grip! Get cross!

This IS pollution!

Whatever people may say, the criss cross tracks of planes IS pollution. It pollutes my air space, prevents the sun shining and spoils my enjoyment of a summer's day.

Media Pollution

Sunday 25 August 2013

Why are we constructing a society like this?

A couple of issues are:

Housing in the UK

We are desperately short of houses, and a lot of the stock we have is poor, energy wasteful and decrepit.

But houses are not being built.

Current government proposes to increase house building by relaxing the rules, and at the same time as pushing a “localism” agenda for communities to manage their own environment, has legalised land grabs by speculating developers.

Two aspects of this which are the most damaging are

- Councils receive from central government money for every new house built, effectively this amount is a bonus of the council tax value of the next 6 years. This encourages them to freely give planning permissions t to the most housing they can get away with, with little or no consultation with communities that elect them.

- Planning policy says quite clearly that permission cannot be refused if the development is “sustainable”. The definition of sustainability is wide open to abuse, and developers are very good at filling gaps by “mitigation” arguments. Thus councils can not refuse approvals, or developers will go to law and sue them to reverse decisions - at tax payer’s cost.

The result of all this is that councils are giving more and more approvals, but houses are not being built, because land assets are inflated (as developers buy land cheap and get planning permissions which increases the value), This looks good on the developers balance sheet, but means that they cannot build houses at a cost (= land + house build cost + council costs for serves + profit) that people can afford.

Government initiatives to tempt people into taking unaffordable loans (75% from banks and 20% short term from government) are a false stimulus. They still cannot afford the repayments, even if the government part is interest free, and they will get into uncontrolled debt.

So planning approvals are given, without community support or consultation, land assets go up, and NO houses get built.

HS2

HS2 proposals beggar a big question about what kind of society we want to build. The sums are so great (£50bn / 25M tax payers = £2000 each) that one can truly question the advantages of transporting thousands of people at very high cost between city centres and gaining just 1/2 hour to do so.

The way our society is organised today is increasing and increasing “run about”, more and more people are travelling to work, traveling to meet each other, traveling... yet 90% of businesses in UK have less than 10 employees.

To serve communities and those 90% of small businesses we have to find a way to cut traveling and invest to grow locally.

That is what we need to spend £50bn on:

- Housing and business planning

- Business premises and tax reductions

- Local transport infrastructure

- Communications, or broadband to give “virtual office” capability across the UK.

- Electric, autonomous delivery vans, and other automated infrastructure

- More beautiful places to live

Politics and government

We have to accept the state of humanity. Just chose how do we want to live with it? Living in UK is very different to living in the Sahara or in Syria.

We have to accept that the a lot of humanity is, in western eyes, in-humane in many ways. Not to accept this, and leave people to evolve by themselves, has created social upheavals, law making, wars etc etc as those, you could almost call them “do gooders” push to construct a society in which ”decent” people can live.

And even here in UK we have inverted politics. Today politicians do not consult with the people they represent, then take these views to parliament, but conversely they make up policies, publish manifestos, ask for a vote then pass laws, dictating back to the public what should happen. And in many cases law making outside the very manifesto they were elected on, with no community input, except from lobby groups. And even these are coming under attack.

Friday 23 August 2013

Finding components for my SSTV receiver

I am building a simple SSTV receiver for reception on 14230 kHz, this is based on the RSGB Centenary Receiver for PSK31 published in Sept Radcom magazine. My circuit diagram is in a previous post.

I have managed to get most of the components - resistors, coils, capacitors, ICs - from Spectrum Communications. But had difficulty finding a source for the 14230kHz crystals. Now I have made a contact through ICM-Crystals with Chris Emmerson who is able to source them from China, at a cost of 20GBP for 6. Compare that to quotes in the EU & UK of 120-160GBP!!

Let's see how delivery goes...

In the mean time, here's the board with most components mounted:

2013 10 02 15 42 08

I have left off two resistors that were connected from the LM386 inputs to ground because this IC has internal bias resistors and they are unnecessary. I have also substituted the input MOSFET for a BF245A, and lowered the load resistor to 1K to maintain the drain at 4-4.5V with zero source resistor.

Monday 19 August 2013

Looking at the SA612

The SA612 is a wonderful circuit! It combines a balanced mixer with an oscillator. Its internal circuits is this:

Screen Shot 2013 08 19 at 11 05 09

Internally the circuit has three Bias circuits which set it up in the right conditions. It has an oscillator at pins 6 & 7, inputs at pins 1 & 2, and outputs at pins 4 & 5. The inputs are grounded through 1k5 resistors and the outputs are loaded by 1k5 resistors also. This makes the whole circuit extremely easy to use with minimal external components.

First the oscillator. This has two pins, 6 & 7. To use this as an oscillator external components have to be connected like this:

2013 08 19 11 32 14

The inputs are on pins 1 & 2, and are balanced, but can be used a single end inputs by connecting the unused one to ground via a small capacitor, like this:

2013 08 19 11 35 37

The outputs on pins 4 & 5 are also balanced, but may be used unbalanced like this:

2013 08 19 11 38 19

To complete the circuit just add power and ground, pins 8 & 3:

2013 08 19 12 47 11

Now to connect some external circuits, for example to make an RF mixer. Here the input comes from a crystal filter and the output is audio frequency, this would be suitable for a PSK32, SSTV or SSB detector.

2013 08 19 12 56 23

The crystals "X" have the same frequency, e.g. 14070 kHz for PSK31 or 14230 kHz for SSTV reception. The oscillator is pulled to the upper sideband by the 30pF trimmer. The RF input would typically come from a preamplifier which we will add next, and the Af output would go to an AF amplifier (see previous posting for an AGC controlled amplifier).

2013 08 19 13 01 48

CORRECTION: The 2K2 resistor in the collector of the BF245A should be 1K

The SA612 needs a 5V supply, so a 7805 regulator (TO92 size is OK) is used. So there we have it, correct use of the SA612 to make simple 14MHz, fixed frequency, receiver. Here's the complete circuit, now to get the veto board wired and try it...

2013 08 19 13 30 41

Note on the LM386

There are some common mistakes in circuits using the LM386

The amplifier internal circuit is:

Screen Shot 2013 08 19 at 10 16 18

Which shows several things:

1 The inputs have internal resistors to ground - so external resistors are NOT needed. The inputs are ground referenced. Inputs can be on either terminal, with the unused one grounded, or using a balanced input to both.

2 There is an internal feedback tapped at pins 1 & 8. Leaving these pins open give the smallest gain of about 20, while connecting a capacitor from 1 to 8 increases the gain to 200.

3 An output stabilising network of a series 47nF to 100nF capacitor and a 10 - 22R resistor is highly recommended.

4 To prevent supply line noise or hum reaching the input stages a decoupling capacitor can be connected from pin 7 to ground. 47-100uF would be suitable.

LM386 Amp with AGC

As part of a developing receiver for SSTV, based on the RSGB Centenary Receiver project in the September Radcom , I have developed an alternative AF amplifier for the set providing AGC to give a constant output for differing inputs from the RF stage.

The amplifier is the ubiquitous LM386, used by just about everybody - hell its a very good design, well done National Semiconductor! The amplifier is set to maximum gain by the 10uF capacitor across pin 1 and 8. The input goes to the -ve side at pin 2, the positive input at pin 3 is grounded. The input is via a series 6K8 resistor and a 10uF decoupling capacitor.

The AGC circuit uses a diode bridge. On +ve and -ve cycles the output charges the two 100uF capacitors until the top two diodes start to conduct, when they do they reduce the input so providing an AGC action.

Here's the circuit:

2013 08 19 09 57 24

The amplifier give a constant output tot around 0.7V rms, i.e. the forward conduction voltage of the two diode in the +/- control loop.

A bigger output can be obtained by using a potential divider at the output before driving the diode bridge, a potentiometer could be used (suggested value 1k log), to provide a volume control if directly driving a loudspeaker. The output of 0.7V is good for the line input of the USB DAC iMic connected to the iPad for SSTV decoding.
The front end is now in breadboard stage but I am waiting to find the 14230kHz crystals from somewhere...

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.