Simple pure sinewave test source...

What people are working on at the moment
Post Reply
User avatar
jack
Thermionic Monk Status
Posts: 5493
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#1 Simple pure sinewave test source...

Post by jack »

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 21mV 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.
Vivitur ingenio, caetera mortis erunt
User avatar
ed
retired
Posts: 5384
Joined: Thu Jun 21, 2007 4:01 pm
Location: yorkshire
Contact:

#2 Re: Simple pure sinewave test source...

Post by ed »

Thanks Nick, I'm on it....

remember this?:

http://www.audio-talk.co.uk/phpBB3/view ... =11&t=5309

about this

http://vitalstates.org/diy/amplifiers/vsl-siggen.htm

About 18 months ago I started a project to update mine as the dds chips seem to have come along since I first looked, specifically AD9850. For some reason the project got shelved but I may resurrect it now that you've prompted me.
There's nowhere you can be that isn't where you're meant to be
User avatar
jack
Thermionic Monk Status
Posts: 5493
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#3 Re: Simple pure sinewave test source...

Post by jack »

ed wrote: Thu Mar 01, 2018 9:00 am Thanks Nick, I'm on it....

remember this?:

http://www.audio-talk.co.uk/phpBB3/view ... =11&t=5309

about this

http://vitalstates.org/diy/amplifiers/vsl-siggen.htm

About 18 months ago I started a project to update mine as the dds chips seem to have come along since I first looked, specifically AD9850. For some reason the project got shelved but I may resurrect it now that you've prompted me.
Ah! I remember that. However you wanted a variable frequency source and this technique is really only good for fixed tones.

Having said that, its so simple that building a few into a box at say 1kHz, 5kHz, 10kHz, 15kHz & 20kHz would not be either expensive or difficult.

You might have to make the 1kHz and 5kHz sections have a better band-pass filter though as the harmonics are that much closer - both these lower frequencies and the 10kHz can be derived by simple division from the 20kHz source maintaining the 50% duty cycle, 1.e. only 2, not 4, square wave sources are needed, though they are very cheap and small (about USD 2 and SOT-23-5).
Vivitur ingenio, caetera mortis erunt
User avatar
Nick
Site Admin
Posts: 15706
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#4 Re: Simple pure sinewave test source...

Post by Nick »

Good link, A UPL with the B1 option (not got that, its like rocking horse dung), can give you a extra 20dB on that, the standard source will take you down to 0.0003% which is where you are. In fact the source in a HP8903b will give you a variable sine down to those levels of distortion. The standard UPL will measure down to 0.00003% THD.

Image
With a 10kHz square wave, the 3rd harmonic is so far away (20kHz)
I would argue that 2kHz is exactly the same distance in filter terms from 1kHz that 20kHz is from 10kHz.
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
jack
Thermionic Monk Status
Posts: 5493
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#5 Re: Simple pure sinewave test source...

Post by jack »

Nick wrote: Thu Mar 01, 2018 10:32 am Good link, A UPL with the B1 option (not got that, its like rocking horse dung), can give you a extra 20dB on that, the standard source will take you down to 0.0003% which is where you are. In fact the source in a HP8903b will give you a variable sine down to those levels of distortion. The standard UPL will measure down to 0.00003% THD.

Image
With a 10kHz square wave, the 3rd harmonic is so far away (20kHz)
I would argue that 2kHz is exactly the same distance in filter terms from 1kHz that 20kHz is from 10kHz.
Not many people have R&S kit - as it happens, I do have an 8903B but it was a bit big for cabin luggage :)
Vivitur ingenio, caetera mortis erunt
User avatar
Nick
Site Admin
Posts: 15706
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#6 Re: Simple pure sinewave test source...

Post by Nick »

Yep, just saying (more for Ed's information), and in response to "very close to what can be measured with modern equipment."
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
Nick
Site Admin
Posts: 15706
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#7 Re: Simple pure sinewave test source...

Post by Nick »

I am snowed in, so a THD and FFT of the 8903b producing a 1kHz 1v sine
Attachments
8903b-thd.jpg
8903b-fft.jpg
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
jack
Thermionic Monk Status
Posts: 5493
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#8 Re: Simple pure sinewave test source...

Post by jack »

This circuit may not be all it's cracked up to be. As a result of discussions elsewhere:
Firstly, it actually doesn't promise -100dB performance:
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".
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.
Vivitur ingenio, caetera mortis erunt
User avatar
Nick
Site Admin
Posts: 15706
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#9 Re: Simple pure sinewave test source...

Post by Nick »

The chap in this thread has been making low cost low distortion sources.

http://www.diyaudio.com/forums/equipmen ... r-706.html
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
ed
retired
Posts: 5384
Joined: Thu Jun 21, 2007 4:01 pm
Location: yorkshire
Contact:

#10 Re: Simple pure sinewave test source...

Post by ed »

Nick wrote: Thu Mar 01, 2018 11:08 am Yep, just saying (more for Ed's information), and in response to "very close to what can be measured with modern equipment."
appreciated, thanks

but(in consideration that this is not my thread and I'm only just staying on topic) I have to apply some perspective. You use the R&S for specific purpose, slightly different from mine. Some of my amps have had 1% distortion(F2) and been positively received, my F4 and F6 have figures of 0.05. My wien bridge effort at 0.025%(maybe) is more than adequate for diy measurements, I was attempting a revisit to move to dds to add square and sawtooth.

My efforts to measure the generator have been rudimentary to say the least. Maybe when/if I get the next one built you can actually tell me what it's real THD is.

edit: posts overlapped...I'll have a read of that link, thanks.
There's nowhere you can be that isn't where you're meant to be
User avatar
Nick
Site Admin
Posts: 15706
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#11 Re: Simple pure sinewave test source...

Post by Nick »

My efforts to measure the generator have been rudimentary to say the least. Maybe when/if I get the next one built you can actually tell me what it's real THD is.
No problem, you know where I am.
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#12 Re: Simple pure sinewave test source...

Post by Mike H »

Me likes. :thumbleft:
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
Post Reply