Distorted waveform from PC microphone
Hello, I am using Visual Analyser with a mic as input. When picking up a 7kHz sine wave from a nearby speaker the following is observed:
Lower frequencies, 500-1000 are not as distorted.
On the frequency response graph, there is also a lower frequency spike that sort of follows the higher one, and is of considerable amplitude:
I was wondering if anyone could suggest any causes.
The soundcard is not of a high quality, and the processor is a single core, 1.8 GHz. The speakers are a 3" and a 1" tweeter for the higher frequencies, which sound very clear and undistorted.
The mic is homemade, but the same results are obtained with a known-good,commercial desktop mic.
Also, the testing is done in a highly reflective room, in a part of it that is less than 17 feet at the longest, if these are any help.
Looks like a problem with the software, maybe sample rate not set high enough.
What happens when you click on the D/A button? This should turn on the reconstruction filter feature of the Visual Analyser oscilloscope.
Is the 40960 Hz sample rate supported by your sound card? You could try a more usual value, like 44100 Hz or 48000 Hz.
Thanks guys. That is the spot. The FFT Size also plays a part as well, having tried a few combinations. D/A does nothing.
The extra, lower spikes are still there for most frequencies, however, especially the one that divides by around 4.7. I was hoping to only see the fundamental and a few harmonics afterward.
Does anyone have a "best bet" on improving from here?
The sound card is rubbish, the preamp circuit is unshielded, and lacks any filtering, except for bypass caps on the amp rails.
The power supply is Ni-Cd with a laptop charger keeping the voltage constant. In fact, a slight amount of noise increase is noticed when the charger is removed.
Looks like its drawing straight lines between sample points. Which is what its supposed to do. (unless you want the software to fill in the gaps with guesses, which it should be able to do accurately for a sine wave, but if you start using it for music, not so good.) You need a sample rate 10x the highest freq. to be accurate. or 70k in your case.
ITPhoenix, how far are the remaining spikes below the desired signal? In your original plot, the f/4.7 component is some 66 dB below the desired. That could be due to interference from the computer on your preamplifier, or from soft background sounds, although one would not expect any relation with the frequency of the desired signal then. What does the spectrum look like when you replace the microphone with a resistor having roughly the same impedance, or when you insert the 7 kHz electrically into your preamp using a resistive voltage divider?
I never tried Visual Analyzer but that display in post one is totally useless and gives no hint as to what may be really happening.
The gradual ramp from 0 to 20Hz, with the big dive thereafter, is the DC component of the sound card, around 2.8mV (the level of "no input" noise), or it is in the software, the 5% accuracy of the calibration voltage, or some combo of all three.
Here is what log looks like with nothing plugged into the input:
Now with a clean input at what could be called a crossover point:
The following is 1980 Hz clean:
And finally, 6656 Hz clean:
At an earlier point, I had long wires (antennas) connecting many of the components and noticed it was picking up 60Hz from a nearby incandescent lamp. Switching the lamp off made some changes so it was obviously picking it up.
Soldering everything to a board practically eliminated it. However, there will always be some 60Hz from the PC power supply plus noise from the switchers, which I presume is what is seen in the "no input" screenshot.
The opamp is a self-contained audio preamplifier by ADI, #SSM2019 and beats making your own by a longshot. However, they insist tying across the +/- inputs with a "RF capacitor for stability.
The only RF source around is the router 10 feet away and the USB adapter in the back of the PC.
The ripple in the waveform graph at the top is actually moving backwards slowly, riding the sine. It is there for most frequencies of interest.
Ok, so there is noise entering the circuit. It must be gotten rid of, since it is only the first stage. There will probably be two more opamps, with a total maximum gain of 200 or more, depending on human speaker distance. This noise and the distortion it causes cannot be multiplied!
There is also the question of background noise or reflections of the speaker tone off the walls. I cannot see how reflections (reverberation) can produce significant lower frequencies, but this should be looked into. There is also the problem of the mic itself. It is picking up sound from the sides which it should not. Even though the elements were matched, I believe the differences in dropping resistors (1%) and the DC blocking caps (5%) are contributing.
A anechoic chamber might come in handy....
Thank you everyone for your input. Any further comments are welcomed.
Looking at it a bit more theoretically: under steady-state conditions, the response of a stable linear time-invariant system excited by a sine wave with frequency f will also be a sine wave with frequency f, but usually with different amplitude and phase. So if you find that some other frequency is produced, one of these conditions must be violated.
1. Maybe steady state has not been reached. Do you wait a few seconds between switching on the sine wave and determining the spectrum, to give your room time to settle?
I've never heard of self-oscillating rooms, so the stability will be OK.
2. Non-linearity: you have already considered background noises (which would make the room affine rather than linear). Vibrations of whatever supports the microphone maybe? The loudspeaker will generate some distortion, but normally only harmonic and no subharmonic distortion. Is there anything in your room that vibrates so strongly due to the test tone that it starts rattling?
3. About time variance: are there any moving parts that affect the room acoustics? Maybe a big fan? In any case, I would expect that to produce sidebands around the desired and not peaks at much lower frequencies.
MarcelvdG: Thank you for your reply. All those have been definitively ruled out. It is time to acquire a better audio card, at least one that has an ADC external to the DSP chip. It will not be a shielded card so I may make one for it.
I started to make a fully shielded enclosure for the circuitry, but ran out of copper foil. More will be here in two days.
Then, whatever is left will be my minimum, since I do not see myself trying to eliminate the power supply noise.
I tried to video the scope, but the processor would not handle both programs. I will switch to a faster machine, and install the new card in there.
I have come a long way. I found using a PC power supply on the bench produced too much noise. A screw-in florescent bulb on the bench also ruined everything. So now I have a Ni-Cd battery pack, and the bulb is gone. There is still a little 60Hz but it's hard to tell now if it is coming from the incandescent lamp or the PC power supply.
And perhaps I am expecting too much from a PC based scope...
|All times are GMT. The time now is 02:14 PM.|
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright ©1999-2014 diyAudio