generating inaudible freqs

How do I generate freqs at 40,000hz? And what format? MP3 is for audible tones.

Lots of really nasty things happen when you get beyond audible frequencies. For one thing, your soundcard stops working unless you bought a really fancy one or you’re outputting around the card.

All the analysis tools drop dead, so you’ll be inspecting your work with the magnifier and a calculator.

For 40000Hz, you’ll need a sampling rate of at least 104000. 2.6 times the highest frequency in the show. I just created a sine wave at 40000 using a sampling rate of 176400 and it didn’t get too badly banged up (Illustration).

What are you going to do with it? People who do scientific exercises with Audacity get burned all the time. Audacity is a sound production editor not a scientific generator or analysis tool.

Screen shot 2013-05-24 at 7.20.05 PM.png

One option is to connect a simple “frequency doubling” circuit to the sound card’s output. Since you specified a single frequency, I am assuming you want a continuous wave.

For a sine wave, you can generate 20KHz in Audacity, and then build this one transistor circuit to derive 40KHz.

If a square wave will suffice, clock a binary CMOS counter IC with an AF square wave from Audacity. This will output 2x, 3x, 4x, etc. simultaneously. The advantage here is that, unlike the previous tuned circuit, it will work over a wide range of input frequencies. A filter stage could be added to approximate a sinewave, if required.

But then, if you know a little electronics, it would perhaps be more straightforward to build a variable oscillator based on the LM555 or XR2206 IC, depending on what waveform is required. You could also buy a cheap, bare-board function generator from a Chinese supplier on eBay.