If the Arduino is anything like a PIC µC then you have no hope of sampling at 44KHz. Most simple µC have quite a slow sampling rate (like 100's of samples per second).
If you want faster then you'd be looking at using something like a dsPIC which has an actual audio grade ADC in it, or use an audio ADC externally that can send I²S data to a µC that is fast enough to respond to it.
I have done some similar work recently while designing a digitally controlled amp.
I had the output of the first stage of the amp going into an analog input on the controlling PIC to then control a bargraph of LEDs for a simple VU meter.
For an output from a PC soundcard you're probably looking at around 1 to 2 volts voltage swing. For my system I wasn't too fussed about frequency and such - just pure peak amplitude - so I passed the signal through a small shottky diode first to trim off the negative voltages. This simplified my design a whole lot.
I am also designing a small frequency analyzer at the moment, and am looking at having selectable op-amp based band-pass filters based around this design: http://www.wa4dsy.net/robot/bandpass-filter-calc which so far has given quite good results. I am varying some of the resistor values by a combination of digital pots and analog multiplexers.
I would certainly recommend at least protecting your analog input(s) with op-amps to limit the maximum voltage they get - just in case. You don't want a voltage spike blowing up your Arduino now do you? Easier to replace a blown op-amp.
And as for a signal for testing? There are many free signal generators for the PC available for download if you do a little google for them. They will let you select waveform, frequency, amplitude, phase, etc. Even allow summing of waveforms to give new waveforms if you're lucky.
You can even use your PC soundcard as a rudimentary scope as well with the right software and a small home-made probe. There is software and designs around for this too on the net.
Oh, and remember to isolate different stages / voltage levels with capacitors in the audio signal. As a rule of thumb, if I am changing PSU voltage levels, I always introduce a capacitor to isolate the stages. So, I had one on the input signal, one on the stage 1 -> stage 2 (+/-5V to +/-12V power supply), one on the stage 1 -> analog input, and one again on the output. It pays to take no chances with stray DC offsets wandering into the wrong part of the circuit.
I don't think trying to get white noise out of a piezo is a good idea. Piezo transducers usually have far from flat frequency response, often with a major and a few minor resonance peaks. They can also be non-linear, meaning they can produce frequencies that they weren't driven with. Then what about the pickup? How do you know how flat that is?
I see two possibilities:
- Frequency sweep
Try to put a reasonable sine wave into the piezo and sweep it over the frequency range of interest. Of course you know the frequency at any point in time, so you filter the received signal for that frequency only. This eliminates harmonics and most other distortion the piezo can add.
- Impulses
Always drive the piezo with exactly the same short pulse waveform. Ideally this would be a impulse, but you'll have to compromise a bit on the infinite amplitude and infinitely short time. This can be as simple as a digital pulse of the highest amplitude the piezo can take, lasting maybe 20 µs or so. It doesn't have to be accuartely anything in particular, only highly repeatable. A full size 20 µs pulse is something the electronics can do easily and very repeatably.
One good thing about piezos is that they generally are fast. You should be able to produce a impulse that is good enough for detecting what happens to the audio range frequencies.
This is the method I'd probably try first.
In any case, you have to calibrate the system. Assume you don't know much about the piezo and can't rely on the pickup either. Calibrate it in open air with nothing around it, with the two transducers separated about as far as the input and output of the insturment you want to measure. For example, mount them about 2 feet apart if you want to test a clarinet.
Any one impulse will have a lot of noise on it. The advantage of this system is that you can repeat impulses at a decent rate and accrue signal to noise ratio by getting lots of samples. Ambient noise will also eventually cancel the same way, since presumably it is not synchronous to your impulses.
During calibration, you essentially measure the impulse response of free air and declare that to be a flat spectrum. It will actually be quite a mess, but as long as there is enough signal to noise ratio accross the full spectrum, you use that as a baseline to compare real measurements with later. When making real measurements, you divide the spectrum you get from the received impulses by the spectrum saved from calibration. That should yield the actual transfer function of the instrument.
Best Answer
Those ceramic piezo transducers have an equivalent circuit very much like a crystal. The "13nF" spec (at 120 Hz) is a measure of Co. The piezoelectric properties translate mechanical flexing of the ceramic into mostly voltage, and a little current. Also introduced is Lm, Cm, Rm which are electrical equivalents of the mechanical motion. Lm and Cm is resonant at 17 Khz. Not shown are all the other resonant modes - each will have its own Lm, Cm, and Rm. (all in parallel). Although these motional components can be measured, its not easy and requires a test jig with measurement tools like function generator, oscilloscope.
simulate this circuit – Schematic created using CircuitLab
Shown are some arbitrary component values for Lm,Cm,Rm. They are resonant at 17 Khz., but shouldn't be taken as accurate - many combinations of values are resonant at 17 Khz., one of which will model your transducer reasonably well.
This transducer will generate currents and voltages near 17 Khz. Source impedance varies over a huge range in a very narrow span of frequencies near 17 Khz. You could use almost any microphone preamp as a signal amplifier.
You can also use a high-impedance preamp to emphasize the parallel-resonance mode of the transducer. This preamp does two things: it amplifies voltage from a high-impedance source, and it presents to the Arduino a bias point about half-way between ground and Vref (assuming Vref=Vcc of 5v):
simulate this circuit This amplifier has a gain of almost 100 at 17 Khz., and gain can be reduced by replacing R1 with a smaller value. Be careful to choose a FET or CMOS op-amp for OA1 having a high gain-bandwidth product. It should also be a "rail-to-rail" op-amp having very low bias current. From Microchip, MCP631, MCP633 would work.