IC sine generator for 10-120khz? (re: bat detector)

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

dfuruta

Well-known member
Joined
Apr 8, 2010
Messages
237
Hello,

Sorry if this is a little off topic.  Does anyone know of an in-production, not horribly expensive IC sine generator?  I need 10kHz-120kHz, preferably programmable with an external voltage (but an external resistance would be ok as well).  Distortion performance is not particularly important, but it needs to be a sine and not a triangle.

I am working on a simple heterodyne bat detector kit, and want it to be as cheap and easy as possible.  The XR2206 would be perfect, were it still made - as much as I can, I'd like to use parts that won't be too hard to find, and so something still active would be best.

In the interest of making this accessible to kids and people without programming ability, I'd like to keep it looking analog (of course, I don't care what's actually going on inside the chip).  If worse comes to worst, my plan is to use a microcontroller as the function generator - it would be cheap, but would add significantly to the complexity of the thing, and I don't really want to spend my time loading code onto uCs.

Any suggestions for simple, low-parts count discrete solutions will be appreciated also.

I've searched around and can't find anything, so I thought I'd ask here.

Thanks in advance for any suggestions, and my apologies if I've overlooked something in searching!
 
For an only 12:1 range you can roll your own from common electronics.

Sine wave ? How much distortion is acceptable... 2206 was not that clean IIRC.

By external resistor  a single or dual pot would be relatively simple, voltage control is harder.

I made a voltage (current) controlled sine wave generator using a dual OTA back in the '80s
that worker over a 1000:1  range with less than .3% THD. It should be possible to scale up to higher
frequency and smaller range.  120kHz may be pushing the power bandwidth for typical opamps but
you can run the sine wave generator at lower voltage then step it up if needed.

Loftec_TS1.jpg


The sine wave generator is in bottom left corner, for only 12:1 range you can simplify the control current.
Scaling the two 1000pf caps to 200pf or so  should get you up in the ball park of your target frequency.

JR
 
Thanks for the schematic, John!

A couple-few percent distortion will be fine, and resistor control will be ok as well.  My main priority is keeping the parts count low, so a single chip solution would be preferable if there's one out there.

The idea is that this will be a simple, educational bat detector kit for younger people & kids.  I'd been discussing doing this with an acquaintance of mine, the main bat rehabilitation & education person in the area.  She died recently, and so I want to  finish the project as a sort of memorial.
 
Research basic sine wave oscillators.. with a dual pot, or maybe a single you can probably make a simple sine wave source from a single (fast) op amp. For clean sine wave amplitude stabilization is hard part but simple light bulb circuits can work for distortion levels you want.

Easier to make a triangle wave, perhaps with a tracking LPF .

Have fun..

JR
 
ICL8038? I don't know if it is current production or not, but that and the XR2206 are still fairly easy to come by.
 
merlin said:
ICL8038? I don't know if it is current production or not, but that and the XR2206 are still fairly easy to come by.

FWIW those are basically diode break circuits that first make a triangle wave then distort it into a quasi-sine wave. That would be a learning experience too.

JR
 
ICL8038 and the MAX038 are no longer made either, unfortunately.

Might have to follow JR's advice and roll my own.  Lamps/thermistors/through-hole jfets aren't always easy to find now, either!
 
Through holes j-fete aren't easy to find? where do you live? thermistors should be easy to find, but maybe not exactly what you are looking, about lamps, a not so specific lamp could work, should get a few and test them.

JS
 
WHY do you think you need a Sine?

I'm not getting it.

Take the example from the Wiki page you linked: bat at 45KHz, LO at 43KHz.

When I use a Square wave to make the 43KHz, I get one spike at 2KHz and nothing else until 43KHz. Simple low-pass (even people-ears) will give the bat-tone without any infinite haze of cross-products.

Two spectra. Top is log-freq to 250KHz, so you see the odd-order hash in the LO, and know I used a (near) square-wave. Bottom is lin-freq, showing Bat, LO, the even-order hash, and the Human-Ear range. There's only the one bump down there. (It is wide and lumpy because digital is approximation, , I sampled at bat-rate so the LO never syncs in the FFT, and I didn't want to run the poor Pentium all night; I'm 99% sure it is ONE spike.)

Unless my simulator is lying to me. It does, but usually in more nonsensical ways.

Anyway, knob-tuned square generators are cheaper than bat-food (bugs). An R, a C, and some gain. CMOS has been popular. There are many split-offs of the '555 timer which easily do bat-speed squares.
 

Attachments

  • BatDetect-Square.gif
    BatDetect-Square.gif
    23.7 KB · Views: 31
What is the CMOS PLL? Yup, CD4046. Mouser.com has thousands in stock at 66 cents a pop.

It is a fast VCO plus several "phase comparators". These *may* serve as your "mixer", though I'd want someone else's opinion on that guess. And you'd need mike-gain to get decent level into the mixer (but you need that anyway).
 
My concern was:  bat at 30khz, another bat at 90khz, triangle wave around 30khz will "audibilize" both, no?  Maybe it doesn't matter;  it would certainly be much easier to use a square or triangle.

Mic will be a cellphone mems element (the only relatively cheap element I could find where the bandwidth looks sufficient).  Should be easy enough to work with electronically, although not too friendly physically.

Thanks much for the tips!


Just an aside:  the ideal bat detector would take the whole 20kHz-120kHz and shift and compact it into 100Hz-10kHz (or whatever) in one piece.  Don't think I want to try to learn DSP chips for this project, though, and I can't think of another way to do it.  Frequency divider bat detectors don't sound very good, and so I thought the tunable heterodyne one would be the place to start.  Tried but couldn't think of any clever other ways to go about it.
 
I am repeating myself but a cheap approach with a dual pot is to use the second pot section to make a tracking one pole LPF.  A triangle wave will has less energy in the overtones than a square wave so will be easier to filter out, and is not that difficult to make.

Yes a low pass filtered triangle wave will still have some HF spurs but they will be reduced in level getting us back to the how low distortion does this need to be question?

With a microprocessor this could be pretty easy to do, but too complicated for a simple application. There are probably inexpensive function generator kits that could be modified to cover your frequency range (just guessing).

JR
 
Thanks, JR!  I think that'll be the first thing I try.  Seems like it might be the most straight-forward option.
 
> bat at 30khz, another bat at 90khz

How frequently do you have two bats in the same place and time?

With WNS, you are lucky to have ANY bats at all.

> take the whole 20kHz-120kHz and shift and compact it into 100Hz-10kHz

Quite non-trivial. I'm gonna say very unlikely for a "kids and people" DIY thing.
 
PRR said:
> bat at 30khz, another bat at 90khz

How frequently do you have two bats in the same place and time?

Depends where you are - even here in the urban, frozen north (St Paul) there are some parks with multiple species and colonies.
Of course, the same thing could apply with a single bat - one might be uncertain whether it's calling around 30khz or 90.  Apparently one can differentiate between species by their frequency range, and so selectivity seems pretty important.

With WNS, you are lucky to have ANY bats at all.

> take the whole 20kHz-120kHz and shift and compact it into 100Hz-10kHz

Quite non-trivial. I'm gonna say very unlikely for a "kids and people" DIY thing.

Unfortunately so.
 
With a triangle wave at 30kHz the 90kHz power will start out at a fraction of the 30kHz power. Adding another LPF pole could knock it down a few dB more.

The 30Khz and 90kHz will not be similar loudness.

JR
 
It's not nice to fool Father Time.

And certainly not easy.

I see all the obvious classic ways to shift bat to human have been tried and are available.

The game-changer is DSP, but for "kids and people without programming ability" this means supplying pre-programmed DSP chips. And that programming may be non-trivial.

Someone at another forum posted some odd chips.

http://mix-sig.com/index.php/msscsa-single-chip-spectrum-analyzer
http://mix-sig.com/images/datasheets/MSSCSA.pdf

It is six 1/6-Oct filters/detectors on a chip. Digital; the center freqs are set by the clock you feed it. I *think* it will run far above the (human) audio range. (Some of their notes are cryptic.)

Three chips and two FF dividers should cover the range 12KHz-100KHz or 20KHz-160KHz.

The output is serial, apparently analog, and you clock the samples out at a rate you choose different from the freq clock. The other interaction is that outputs decay about 1dB each time you read them.

So 18 channels, read 100 times a second, gives you a 1,800Hz stream and a 100dB/sec decay. Which is 20dB in 0.2 seconds, which is fast for human music but may be fine for bat sounds?

You could throw this stream on a 'scope and get a spectrograph display. But who has a 'scope they can carry in the park in the dark?

I'm wondering if this data-stream is slow enuff to go into an i-Droid mike input. Re-plotting to a spectrograph display is programming on a rich machine with ample libraries. Upgrades are smartphone downloads, not DSP or ROM chips.

The 1/6-Oct resolution is fat. You could not tell 45KHz from 47KHz. You could not be sure of semi-tone pitch-shifts. You could run a second filter chain at 1.059X clock and get "1/12-Oct" spacing. The filter peaks will overlap quite a bit, but a sharp eye might say "more 47 than 45". OTOH to get good fast decay (bats live and sing on a faster time-scale than we do) this may drive the sample rate too high for most mike inputs.

A possible objection is that this chip is utterly single-source from a fab-less company without much distribution. If you plan to make a million on this thing, you want to get some agreement about the masks if Msi quits business. For hobby work, after prototype, you probably want to do your LifeTime Buy (all you could ever need).

Something to ponder on cold lonely nights.
 
If the OP doesn't even want to use a micro we don't need to leap to DSP, but since you bring up the subject I have actually coded a FFT (fast Fourier analysis) which converts a series of input voltage samples and extracts frequency and amplitude information from the sampled sound. 

The cheap (<$5) DSP chip I used for my prototype is probably capable of the range you need, while I was dealing with much lower (drum tuning) frequencies. To detect 100kHz you need to sample at least 200kHz while I would suggest 3-400kHz for less errors.  The cheap internal A/D may be struggling to deliver full 12b that fast but you can probably parse out your bats from 8 bit data samples.

This was not trivial for even a somewhat experienced coder. but maybe I'm slow.  8)

JR
 
 
Really interesting posts.  I think this is probably more complex/difficult than needed at the moment, but I'm interested in looking at digital solutions more down the road...here in MN there are plenty of cold, lonely nights for pondering  :).
 
> here in the urban, frozen north (St Paul) there are some parks with multiple species

I was thinking locally, sorry.

But IMHO: just you wait.

http://www.whitenosesyndrome.org/resources/map

2006, mid New York, one colony dead.

In a few more years: all up and down the mountains (less human habitat-destrution, thus more bat-bat interaction).

In a few more more years: Tennessee and Missouri well infested.

Cold is no defense-- note splotches in Maine and Maritimes Canada. (The apparent density in Canada may be better monitoring not more WNS.)

BTW, AFAIK-- the 2012 blot in coastal Maine is mis-drawn. The sure observation is less than half of a small island (a National Park). The big grey finger is the whole *county*, much of it somewhat different habitat than the island (though probably just under-studied). It is a natural problem being reported on political boundaries.

On these maps, New Jersey does not show WNS over most of the state; however I personally observed a severe decline 2006-2009. In Maine, I saw bats 2009 2010 and *none* since (I am not far from that island).

I think in our lifetimes we will lose nearly all our historic bats. Bats will come back from the few with resistant genes; also from stowaways and maybe transplants from other lands where WNS exists as a minor disease not a fatal killer. But bat population re-growth will start *very* slow.
 

Latest posts

Back
Top