Golborne Vintage Radio

Full Version: Simple pure sine-wave test source...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I needed a good, pure, 10kHz sine wave to test some stuff I'm playing with - most of my test kit here is digital thus not especially clean.

Came across an LTC design note (DN564) from July 2017 with an simple/obvious and neat approach - uses a very low power single-rail op-amp and a monolithic squarewave generator - the op-amp implements a very narrow BW bandpass filer to pick out  the fundamental from the square wave, resulting in a -100dBc (0.001% THD+N) sine wave.

The traditional way, is exemplified by Jim WIlliams' classic LTC AN43 (fig. 48) design back in 1990 to get THD+N down to -110dBc or 0.0003% (3ppm) - he published various updates - the last variant I found was an EDN article from August 2011 (Jim died in June 2011) which got the THD+N down to -112dBc, or 0.0002512% (2.5 ppm), very close to what can be measured with modern equipment. These use a Wein Bridge oscillator with an optically-coupled AGC servo to stabilise it.

I've built variants of the AN43 Jim WIlliams design and it's tricky to keep stable - like a Ferrari, it's a bit on the edge all the time. The DN564 idea, whilst "only" offering -100dBc, is far simpler and more stable.

The fundamental difference between the two approaches is that the traditional approach works very very hard to produce a clean sine wave and nothing else.

The slightly left-field approach of starting with a square wave is that you never have to explicitly produce a pure sine wave - it's inherently present as the fundamental of the square wave (part of the Fourier series). As it's easy to produce a decent square wave at a known frequency, you know that if it's a pretty clean square wave with a 50% duty cycle, then it'll consist of only odd harmonics with amplitudes of 2/(n*Pi) where "n" is the harmonic number. So starting with the fundamental (harmonic 1), with a 1V square wave, the fundamental would be 637mV, the 3rd would be 210mV and so on. Harmonic 0 is simply the DC component equal to the average value of the input - in the case of a 1V, 50% duty cycle square wave, this would be 0.5V.

With a 10kHz square wave, the 3rd harmonic is so far away (20kHz) we can afford to use a simple low Q band-pass filter to extract what, by definition, is a pure sine-wave at the fundamental.

Neat.

Tobacco/Altoids tin job... as always with this sort of stuff, construction technique has to be good to hit the low numbers...

EDIT: Should add that when I was first playing with the AN43 design many years ago, I was having problems keeping it stable - after a while, having run out of ideas, I emailed the Great Man. He replied with a charming email and told me how to fix the issue. Great guy, sad loss.
How good are modern audio DACs? This seems pretty good: http://www.ti.com/product/DAC1280
(01-03-2018, 09:16 AM)ppppenguin Wrote: [ -> ]How good are modern audio DACs? This seems pretty good: http://www.ti.com/product/DAC1280

Ummm. The subject line contains the word "simple" Smile

There are obviously ways to get a purer sine wave - the DAC1280 is a 24-bit device with THD+N down at -120dBc, which is stupidly low. It also costs USD 25 just for the chip, let alone all the stuff round it.

But you need astonishingly good design & layout to achieve those figures, plus a CPU and a bunch of other stuff, plus software to synthesise the sine wave too. All do-able, but none of it... simple... or cheap.
There are several free bits of software that have very good low THD sig gen's in them like Audacity, REW, Alta and Soundcard Scope. The latter is a easy to use and is very useful as it has a scope, FFT + THD measurement, etc. Some of these are quite complex and take a bit of sussing out, but you don't need to get your soldering iron out.

Andy.
(01-03-2018, 09:52 AM)Diabolical Artificer Wrote: [ -> ]There are several free bits of software that have very good low THD sig gen's in them like Audacity, REW, Alta and Soundcard Scope. The latter is a easy to use and is very useful as it has a scope, FFT + THD measurement, etc. Some of these are quite complex and take a bit of sussing out, but you don't need to get your soldering iron out.

Essentially, all of these are the software side of a signal generator with the sound card being the DAC, so the THD is little to do with the software and a LOT to do with the quality of your soundcard - genuine 24-bt sound cards giving you >= 100 dBc are VERY expensive. Most are now USB-based - more complexity.

Again though, these are not the point - for a clean sine wave you just don't need all the gupmp - the software may be free, but the PC, operating system & hi-res soundcard are definitely not.

PCs also generate a whole bunch of noise, none of which I want in a measuring system, though I do use PC/USB tools for some of my testing.

i.e., none of this is simple.
Agreed that the analogue solution is simple and cheap. A USB audio DAC and an existing PC is more expensive but no hardware to build. Almost plug and play.
(01-03-2018, 08:00 AM)Nick Wrote: [ -> ]Came across an LTC design note (DN564) from July 2017 with an simple/obvious and neat approach - uses a very low power single-rail op-amp and a monolithic squarewave generator - the op-amp implements a very narrow BW bandpass filer to pick out  the fundamental from the square wave, resulting in a -100dBc (0.001% THD+N) sine wave.

Hmm...

Have you built and tested this?

Firstly, it actually doesn't promise -100dB performance:

Quote:One does not expect to generate a sine wave with –100dBc distortion using a 5V low power op amp. All the same, a bandpass filter using the LTC6258 can combine with an easy-to-use low power oscillator to create a sine wave at low cost, low voltage and extremely low dissipation.

I read that as "we're not aiming for anything like -100dBc, but it'll be a plausible sine wave nonetheless".


(01-03-2018, 08:00 AM)Nick Wrote: [ -> ]With a 10kHz square wave, the 3rd harmonic is so far away (20kHz) we can afford to use a simple low Q band-pass filter to extract what, by definition, is a pure sine-wave at the fundamental.

Well, 20kHz is only an octave away from 10kHz, but that aside, it's 30kHz that we need to attack. And 50kHz, 70kHz, 90kHz, etc.

The 30kHz harmonic will be a third of the amplitude of the fundamental, so ~10dB down. So our bandpass filter needs to be around 90dB down at 30kHz to get -100dB performance. But according to the graph on page 1 of that PDF, 30kHz is only ~30dB down relative to 10kHz. Which suggests that the distortion performance will be ~1% at best.

Quite apart from that, the LTC6258 has pretty mediocre distortion - the data sheet says 0.025% at 500Hz into 4k, and it will be higher at 10kHz and higher again into lower load impedances (see R5). BTW, "single-rail op-amp" is marketing-speak - just about any op-amp can work from a single supply. Op-amps that are marketed as "single rail" usually allow their inputs and outputs to get closer to the rails than a typical general-purpose op-amp, but naturally the data sheet should always be consulted to see if that's the case. Pay particular attention to the output loading conditions, as some are only "rail-to-rail" when very lightly loaded. And to achieve this, compromises have to be made, which is why I've yet to see a "rail-to-tail" op-amp get anywhere near the audio performance of the venerable 5532 (or even the TL072, frankly).

This sort of technique is commonly used for non-critical, fixed-frequency applications. But I've never seen it used in high-quality audio measurements - in the analogue domain, you need a Wien bridge oscillator at the very least, and preferably a state-variable filter oscillator.

Sorry to pour cold water on this, but hopefully it helps to put some perspective on it. It's still a useful circuit in its own right - but high performance it's not. Impressively low power consumption though - the NE5534 (single 5532) takes 4mA!
Well, there you go Smile

Nope - not built it yet - the low power aspect wasn't that important but I can see that a better rail-to-rail op-amp would help greatly.
Sorry again Wink

TBH, the filter is almost certainly the limiting factor here - I'm guessing that you'd need a fair bit more stop-band attenuation before the op-amp THD starts to dominate. Though it's impossible to quantify that without seeing a graph of THD vs frequency for the op-amp. It would be tempting to add a second filter, which should get to around 0.05% in theory (some tweaking or component selection might be needed).

I remembered that this technique is used in the Radiometer SMG40 that I repaired a while back. The 19kHz output on the rear panel is a bit "spiky triangle", but good enough for the purpose. The main output has a complex LC filter than removes harmonics from the complete composite signal (along with other "magic" - they had some clever folk working on that design).
Agreed you need something better than an average soundcard to get -100dB but some cheap cards like the Creative Soundblaster (horrible name) can do -96dB. I use a second hand AI, a Digidesign 002 THD + N 96dB - specs here - http://avid.force.com/pkb/articles/en_US...e/en365819  . It cost £50. I've only started mucking about with some of this software recently. So far I've had good results, there are also quite a few knowledgable folks out there who also use these to measure audio parameters. It's good enough I think for hobbyists and dabblers like myself who can't afford AP stuff or older HP audio analysers.

Nick doesn't say what level of THD he's after, but this simple Wein bridge oscillator is capable of about 0.03% THD. See attached. It's set for 1khz, to change frequency change R and associated caps. i have some bulbs Nick, if you want some to play with, drop us a line.

From the little I know designing and building a very low distortion analogue sig source is far from simple, even at just one frequency. i have the Elektor Spot frequency schematics and other very low THD designs and white papers if you want them Nick, but they're not simple.

Andy.
Pages: 1 2