Signal Generator for Free; Notch Filter Progress

So I’m trying to put together an analog filter to cut the mains hum from a ELF/VLF radio receiver.
The sig gen built into the BitScope DSO is very limited, only offering certain fixed frequencies. This isn’t a huge amount of use for evaluating a notch filter circuit. Neither was the use of a white noise source as input to the circuit with a freq domain trace at the output, the notch wasn’t visible (had a bit more smoothing been available in BitScope DSO, this should have worked).


I thought my easiest next step would be to put together an analog sweepable oscillator on the breadboard. But then, while falling asleep, I had a Eureka moment: the laptop I’m using for the DSO display has a soundcard! I’m running Ubuntu on the lappie, and the Audacity audio recording/processing tool has the facility for generating swept-frequency signals. So I attached jumper leads to a mini jack plug and stuck that in the headphone socket, bingo!

By generating a 1 second sweep, 20Hz-200Hz, in Audacity and loop-playing it, I got a reasonably respectable view of the filter response in the freq domain display of the DSO.


Next up I just need to tweak the resistor values to focus the notch bang on 50Hz. Putting pots in parallel with the current values will allow me to find these values. However, silly me, I don’t have a multimeter to check the pot values. I did see one in a hardware shop for AUS$11 the other day, and given that’s about the price of a pint of beer here, I guess I have no excuses.


Seeing the Signals (& BitScope BS10, first impressions)


The BitScope BS10 and associated software makes a useable but basic scope, but its real potential is probably in its other facilities: simple data acquisition across various platforms (including Raspberry Pi) and the ability to monitor logic levels alongside analog signals.


Trying to do any signal-oriented electronics without an oscilloscope is like trying to drive blindfolded. OK, it is possible to develop audio systems with just a multimeter and an amplifier, but you are literally missing a sense. I did have an old analogue, CRT scope years ago, but gave it away when I moved to Italy. I’ve only done a tiny bit of electronics dev since then (simple guitar effects) and have got away with ears, just.
But my latest project will involve a lot of unknown signals, there’s no way I can make progress without a scope.
Standard scopes nowadays are Digital Storage Oscilloscopes (DSOs). The storage side is sweet, it’s possible to save snapshots of traces and often capture the raw data contained in them. But with Digital comes a caveat. Analog scopes tend to give a fairly true representation of the signal, in the given context (bandwidth, levels etc). Anything spurious, such as over-level clipping is immediately visible. Digital scopes rely on analog to digital conversion (A/D), which introduces factors such as the sample rate, filtering and resolution. Out-of -range signals presented here can produce misleading displays.


Most of what I want to look at is in the audio frequency range, which is well covered by pretty much any scope worth its salt. For example, my old analog one went up to a 1MHz timebase, comfortably encompassing the nominal 20Hz-20kHz of audio. But because I’m going to be looking at circuits that may pick up radio frequency signals, a higher bandwidth could be useful. Being able to go down to DC will be useful too, for lower frequency signals and detecting unwanted offsets etc.
The signal levels I’m interested in are relatively low voltage, so there are no special requirements here (at circuit input some signals will be very low amplitude, but as the target systems will need to amplify these anyway, this shouldn’t be an issue).
For convenience, I want at least two simultaneous traces to be available – most circuits I’m likely to be looking at will feature an input and output.
Additional it will be pretty essential to examine signals in the frequency domain.
Finally, the scope has to be affordable.


Benchtop DSO

This is the most obvious solution. These are available starting at around $500 – not a trivial amount, but definitely worth considering for such a vital piece of kit.

Computer Soundcard

Right at the low budget end is the use of a computer sound card and appropriate software. Remembering now, I realise I fibbed about developing guitar effects without a scope, I did actually use a soundcard and various (free) VST plugins to look at the signals.
But this approach is quite limited, and, well, clunky. It isn’t really viable to make accurate measurements, there’s no range changing switches built in, bandwidth and resolution can be overly limited (e.g. few sound cards go down to DC).


This is an A/D converter which attaches to a USB port and has dedicated DSO software. The BS10 has excellent specs on paper, though they are dependent on host computer performance. The software will run on MS Windows or Linux and notably a Raspberry Pi. An Android version appears to be in the pipeline. Physically the BS10 is a small box which comes with a bunch of clip leads. It has two analog inputs, an analog output and and 8 logic inputs. A variety of applications were downloadable from the site, the key one being BitScope DSO. Once I’d realised this had to be run with sudo (to give access to /dev/ttyUSB0) it worked a treat.
The controls in the application aren’t entirely intuitive, after a couple of days getting used to them I’m still unsure e.g. how to adjust offset. For equipment like this, I’m afraid an on-screen user interface will never be as convenient as hardware knobs you can twiddle.
The DSO application also offers a frequency domain display (for one or both channels) as well as a basic signal generator. The freq display is very nice to have, though control of parameters is rather limited. For example, an arbitrary zoom would have been good, as would a variety of smoothing/averaging options.
Similarly the built-in signal generator is nice to have, but even more limited. It offers a range of fixed frequencies, producing a sine or square wave. This is OK for quick checks, but that’s about it.

Fortunately there’s a fairly trivial way of providing a versatile sig gen in the same setup at virtually zero cost. Whatever the host machine for the BitScope, chances are it has a soundcard. Hook a couple of jumpers leads to a jack plug, pop it in the headphone out socket, fire up Audacity and bingo!

So as a substitute for a benchtop DSO, the BS10 is adequate but not outstanding. Call it 7/10. Given the price compared to dedicated hardware this seems reasonable.
However, chances are anyone working with analog signals in this day and age are likely to have digital aspects to their circuits. I haven’t tried this yet but from the docs the 8 channel logic monitor capability of the BS10 looks like it should be very useful in future.
For my current project, while I need the DSO facilities for circuit development, the BS10 should offer a very good foothold into another part. Again though I haven’t yet tried this, it also appears to be a very versatile data acquision system for recording signals. This can be done from within the DSO app or programmatically (with hooks from Python, I believe). The latter part I’m rather looking forward to, a hackable signal capture unit is very nice to have. I don’t yet know how sophisticated I need this side of my project to be, but the BS10 certainly is an option. Alternately I may develop with this interface, then flip to the cheaper BitScope Micro for production.
All in all then, the BitScope BS10 scratches a lot of itches.

Notch Filter Issues

The natural ELF/VLF radio signals I want to receive are essentially those of the audio frequency range (perhaps going a little lower, so call it 1-20kHz). If you act as an antenna yourself and plug yourself into an audio amplifier by putting your thumb on the input lead, the signal you will hear above anything else is mains hum (50Hz Europe & Australia, 60Hz US). The natural signals are way weaker than this, so if I want to use the receiver even remotely near power lines, I need to get rid of that hum.

While it would be straightforward to cut 50Hz using a digital filter, the level is so relatively high that it will swamp the desired signal going through an A/D filter leaving little useful resolution. There’s also a good chance of it saturating any analog pre-amplification.

It’s worth noting here that the mains hum tends to be pretty dirty, with lots of harmonics (2x50Hz, 3x50Hz etc.). According to Radio Nature the big ones are the odd harmonics. But for now I’ll just try cutting the fundamental, see if that’s enough.

A related issue is that the natural radio signals are of such a low amplitude that noise generated by the receiver circuit components may also be an issue.

So I’m thinking, whether I use a coil (for the magnetic component of the natural signals) or a free antenna (electrical component), I should first have a little fairly wideband but low noise pre-amp, maybe x10 or x100 to minimise noise addition later. Have this followed by a notch filter and then further amplification to get the signal up to line levels.

The standard simple filter is the twin-t notch, more or less a low pass and a high pass filter bang up against each other. But the notch with this isn’t very sharp. This can be improved by throwing in a couple of op-amps, as in this circuit :


So I tried this on the breadboard, only with approximate values (33k rather than 31.8, 5% capacitors).

img_20161231_105543This didn’t appear to be working, with white noise as input, the scope showing freq domain trace (top, marker line is 50Hz) :


So then I just tried the passive twin-t, and got a similar result 😦 I guess the noise input/freq domain on scope is a losing combination.

The BitScope has a basic signal genenerator built in, so I tried that on the passive circuit:


Here there is a distinct difference between the input (green) and output (yellow) at 50Hz compared to other peaks.

Reassembling, I tried the active circuit with the sig gen :


Boo, no significant difference. But I strongly suspect this is down to measurement fail again. The sig gen is very limited, only offers 50Hz, 100Hz etc, and even if the components in the filter were perfect, the notch would be at 48Hz. Allowing for tolerances, it could be way out. But assuming the active circuit is working, there could be a sharp notch at say 45Hz, relatively flat at 50Hz.

So next step, I reckon I’ll knock together an analog sig gen, hopefully get a clearer view.

Getting Started

Hello World from new blog; dipping my thongs into analog water

I have been thinking about and casually researching for this project a few months now. But today I started fiddling with some hardware, so it seemed a good point to start a blog on it.

I’m currently in St.Arnaud near Melbourne, a long way from my base in Italy. A couple of months ago I ordered a bunch of electronic components to get started playing with the analog parts of the system, starting with an ELF/VLF receiver. Of those the only thing that arrived before I set off over here was a Bitscope gadget to allow a computer to be used as an oscilloscope and/or data capture. Coincidentally that shipped from Australia, arrived in good time, unlike the stuff from Farnell in Europe.

I didn’t bring any other kit with me, but my darling Raven took me to a component shop the other day (Jaycar) where I picked up some bits & pieces.

I had planned to try some of the VLF receiver circuits in Radio Nature, which seems like the bible on this stuff. The ones I was looking at have a 2N3819 FET at the front end (the circuits can be found around, the site of the book’s author). Unfortunately Jaycar didn’t have these, but gave me what they said was an equivalent. It wasn’t – just a regular bipolar. But I’d also bought a few TL084 quad jfet op-amps, so I should be able to get something together that’s functionally equivalent, if perhaps a bit noisier.

Here’s my prototyping setup:


Bottom right is a bit of scrap wood with hot-glued to it: 2xPP3 batteries; a speaker; breadboard; Bitscope.

The Bitscope’s hooked up to an old laptop of Raven, running Ubuntu. My first try with this, doesn’t seem like the signal’s getting through and their site just happens to be down today. Grr!

Still got things to play with though. I want to get the sound of VLF coming out of the speaker, and I want it to be portable to get away from power lines at first. So I got an LM386 250mW amp chip, as used in some Radio Nature circuits. Haven’t played with one of these before – I’d have remembered, it’s atrociously unstable. The basic (inverting) configuration from the data sheet oscillates happily. But I was able to get something more stable by tweaking the non-inverting config (in data sheet as “AM Radio Amplifier”).

Hopping ahead a little on the breadboard I’ve also got a white noise generator. I’m going to make a 50 Hz active (bootstrapped) notch filter to rid the signal of the worst of mains hum, hopefully allowing the receiver to be used in (or near) the house. I should be able to tweak the notch when the Bitscope’s working, with noise as input.


PS. Not long after posting this I remembered and found the BitScope troubleshooting tips. My problem was just permissions on /dev/tt1USB (?). So I had a crack at the notch filter. No joy with that yet, but my problem could well be inexperience with the ‘scope, there are a lot of controls.