jejt / jmons

Engineering Tommorrow

Category Archives: Audio

Hissing Noise from Speakers Fixed


So recently a friend at work (the esteemed DJ Hedflux) had a problem with his speakers – he has a pair of powered speakers, and he outputs sound down a normal stereo cable into the speakers. Being a professional DJ, nothing in his system is particually cheap (he’s not spending £100 on cables, but he’s not buying £1.50 speaker modules from the market) so we can quickly rule out shoddy work and bad connections inside of the devices.

Anyways, he worked out that it was a combination of his computer and his touch lamp causing it – doing things on his computer that required lots of processing, and having the dimmer lamp “dimmed” caused the noise to appear and dissapear.

This is very common, and also, very easy to fix.

How to fix:

Ferrite ring filter

The solution is very simple, and very cheap. You’ll need a ferrite ring, which you wind the audio cable in just a couple of times, like in the above picture.

Maplins sell these for a couple of pounds, usually find them in the Radio section:

http://www.maplin.co.uk/Module.aspx?ModuleNo=29788

Image stolen from http://www.gbrcaa.org/ntoa/Filters,%20Chokes%20and%20OIs.htm on which site you can also find more information about other kinds of chokes.

The science:

In Hedflux’s case, its possible that his computer internals arn’t all grounded to the case correctly, or the case to the power supply, so its generating more electrical noise then ideal. The dimmer lamp however is a common source of Electromagnetic Interferance (EMI).

Because he’s using a set of powered speakers, the loudspeaker cable is acting as an antenna, and the amplification circuit is having a side effect of acting as a little radio, which is picking up the EMI from the computer and the lamp, and turning it into the annoying hissing noise.

The ferrite bands that he added to the audio cable basically change the frequencies of that cable, effectivly filtering the annoying frequencies out.

Why don’t these cables come with the bands installed? Well, the point is that it dosn’t STOP the frequencies, it shifts the resonance frequency of the cable. The cable and speakers will still produce noise if the EMI comes in on a different frequency, so it was just bad luck that the EMI in his room was the same frequency as the cable / speaker setup.

EAGLE CAD and Valves


Uhh.. ok. The biggest problem I have with EAGLE Cad (and I only have the freeware version here – my job lets me use design tools at work, but most of the stuff I talk about on here is actually for home, and I’m trying to finally get some of it online as part of my “open source” roots.) is…

the lack of parts. Too often I come across a custom part that I want to incorperate in my circuit. When I draw my circuits by hand, thats not a problem, but to get these things online, I need to digitise them, and scan’s of my lab book just really arn’t suitable.

This time, I found the need for a particular Triode – the 6S7L – now, before people start asking me questions about Triodes and Valves in general, I don’t know, this is the first time I’ve ever used them and I’m getting quite excited over the prospect. But, Eagle Cad just dosn’t contain the parts for some of these devices, so more and more I’ve been building my own versions.

Because EagleCad is designed to go from a schematic straight to a board layout, I’ve found that I’ve been using the schematics as close as possible, but I really have been just throwing pins at the package file, meaning that if anyone where to convert my schamtics to boards then they will certainly a) be wrong and b) could be quite ammusing.

Anyways, this:

6sl7dual-triode

is the current working diagram. Yes I stole it. The book in question actually, “22 Radio and Receiver Projects for the Evil Genius” was a Christmas present, and I’m getting quite annoyed with the number of typing mistakes I’m finding in it. I wouldn’t say its the best book – you have to be a genius (or be good at pretending to be one) to understand some of the bits in it, but forging onwards … high voltage valve radio soon.

Arduino as Digital Filter… Hopes downed, and then Revived


I had hoped in my previous post to sample the audio through the use of an analogue input pin on the Arduino, then do some bit manipulation in the form of a Digital filter before playing back. However, my hopes have been crushed with this system:

To test the feasability of this, the code was simple – define an int to store a sample in, call analogRead() to read a byte in, convert this value into a value suitable for the number of output pins, then pass it out.

AnalogRead reads in a value between 0 and 1024, which is a 10 bit number. Because I’ve only got a 6bit DAC, I decided to just take the top 6 bits (I should really try this again with scaling as opposed to just taking MSB).

Now, since starting to write this and battling with lots of media upload tools AND wordpress.com etc, I’ve realised two things. 1) I’m not actually taking the top 6 bits, I’m using the top 2 bits because of a stupidity. and 2) I should use Scaling instead of just using the top 6 bits. I have just tried it again using 6 bits and there is a large improvement, as for scaling, that will have to wait.

My code (which is BAD and WRONG):
void loop() {
  buffer = analogRead(analogPin);
  PORTD = (byte) buffer >> 4 ; // only use MSB 6 bits
}

The following is an MP3 hosted on SplashCast Here. The first sample is the sample I’m inputting into the arduino, the second and third is the output.

[splashcast UQVA8175RX]

Arduino Audio Filter


Whats the difference between Noise Makers and Audio Filters – well, I would expect a level of control. A Noise Maker implies a lack of control – the difference between “din” and “music”. I’ll start this post off with this image, which is a Waterfall image. Waterfalls are spectrum over time – In this case, the frequency is up the side, and the time is across the bottom. The intensity of the colour indicates a voltage at that particular frequency.

Waterfall of Arduino Noise Maker

Waterfall of Arduino Noise Maker

What we are seeing is how the frequencies are changing over time when the dials on the board are swizzled, and by comparing this with other audio projects, we are able to see how various features and code changes change the output.

The next stage of the project is Filters – Filters are basically devices which limit frequencies that go through them – there are essentially two types of filters, High pass (which allow high frequencies to go through) and Low Pass (which allow low frequencies through). By combining these together, you can generate Band Pass filters and Notch Filters (although you might make notch filters in a different way).

By adding filters together, you can make filters which let multiple bands (a comb shape) or ban multiple bands. If you have control of your filters, you can change them and manipulate them over time, and apparently, if you generate white noise on one side, and use two bandpass filters, you can make sounds which sound like words – by moving the two filters in and out and widen and narrow.

Anyways, when I was at Uni, I learnt how to build Digital Filters, that is I learnt the electronics behind the DSP, and its quite simple – well, its a little tricky to get them efficient, but a problem that’s been solved time and time again. The system works by multiplying a set of samples in a fashion. Unfortuantly, my choice of modules (50% electronics or low level computing, 25% maths, and about 20% computing theory) means that… I didn’t do the Signals and Systems module because my Maths skills are troubled. I loose the decimal place ok?

So I’ve had a crash course in Fourier Transforms, which are the very basics behind working out the numbers that you need in the sample multipliers… Which is what I’m about to build on this new circuit. So far, I have an analog input (which is my sampling system) and an 6 Bit R2R DAC shield. The first test will be to act as a buffer. The second will to act as an Echo Box, and the third, to Filter.