Amplifier for small voice recorder module

THE_RB

Joined Feb 11, 2008
5,438
It looks to me like your recorded amplitude is WAY too small!

Try recording and playing back sinewaves, and make the recorded sine louder and louder until it starts to clip obviously when seen on the 'scope.

Or if you don't have a sine generater then record other constant freq sounds like speech and find the amplitude where it starts to clip. You need a recorded amplitude just below that.
 

Thread Starter

jack33

Joined Dec 31, 2010
42
Can you easily change the resistor for the sample rate (sizes listed in similar datasheet) to see what effect that has?

The trace you show is a higher frequency than "buzzing", can you get the amplitude and duration between two spots where the output is flat for a bit? That would give a better idea of the noise, and if you can do an FFT on that sample, it may help ID the source better if there's an obvious spike at some fraction of sampling freq.
Fortunately there is a jumper on the board which allows me to change the resistor for the sample rate. I tried approximately the two extremes as given in the data sheet. That varies the oscillator frequency between about 4kHz and 8kHz. The default with the 100kΩ is 6.4kHz. The resistor value changes the maximum length of the recording. In either case the same buzzing was still there. The only change I noticed was in the recording time. I also tried changing the V+ for the recorder from 5V to 3.3V. That did not appear to make any difference. I left the 386 at 5V.

My scope does not have the ability to do any real analysis other than measure frequency and voltage levels. I attached two scope traces, one with the default 100kΩ oscillator resistor and another with 147kΩ. There doesn't appear to be any real difference. The longest flat cycles have a frequency around 500Hz. The total voltage of the signal is
~1.3V. The noise portion is ~0.25V.

Recorder 100kohm.jpg

Recorder 147kohm.jpg
 

thatoneguy

Joined Feb 19, 2009
6,359
Use the other speaker output to see how it compares.

Also, changing your volts/div down to 0.5 or 1V/div will give a better representation of the noise. You may need to adjust the vertical offset to center the signal, I don't know if that's an option or not.
 

Thread Starter

jack33

Joined Dec 31, 2010
42
Here are two scope traces with sound recordings. The previous traces were all with a blank recording (no specific sound input). The lower frequency trace (~400Hz) is a voice recording. The waves were clipped off at ~3.75V. The other trace is a small piezo buzzer (~2.5kHz). It was not clipped off. The total amplitude was 2.2V.

These were played using the other speaker output from the recorder (SP- instead of SP+). The buzzing sounds the same using that output.

Unfortunately, I can't change the vertical scale (volts/div). I can only choose between three ranges (1V, 10V, 100V). The vertical scale is set automatically.

IMG_1003.jpg

IMG_1004.jpg
 

thatoneguy

Joined Feb 19, 2009
6,359
You might be better off using your computer sound card as an oscilloscope with the SoundCard Scope Software

There isn't enough resolution to see audible noise on the signal in your last two images, especially if the noise is low frequency, and the two samples above are high frequency (>5x the frequency of noise you hear).
 

Thread Starter

jack33

Joined Dec 31, 2010
42
You might be better off using your computer sound card as an oscilloscope with the SoundCard Scope Software

There isn't enough resolution to see audible noise on the signal in your last two images, especially if the noise is low frequency, and the two samples above are high frequency (>5x the frequency of noise you hear).
I downloaded the Soundcard Scope software and manual. The website gives the following warning:
"For external sources care has to be taken, not to exceed the voltage range of the inputs. The range is usually only ±0.7V !! If higher voltage need to be analyzed, a voltage divider has to be used. Additional protection diodes are recommended in order to avoid any damage to the sound card and to the computer."
I know how to make a voltage divider, but I'm not sure how to connect the protection diodes.

Looking at the equivalent circuit of the LM386 it appears that the output voltage can't exceed the supply voltage. So, could I design the voltage divider based on that, to insure the input voltage to the sound card can't exceed its max rating?
 

thatoneguy

Joined Feb 19, 2009
6,359
Put a pair of diodes between signal and ground, pointing both ways. The voltage will never exceed 0.6V in either direction. Make two, you can have 2 channels with L and R on the input.

Use a roughly 10:1 voltage divider, say, 1 Meg in series with 100k, this will also have the side effect of increasing input impedance to >1MΩ, so that it won't disrupt the functioning of the circuit as much.

No Active components needed. Just 2 diodes and 2 resistors per channel. Plus a pointy thing to use as a probe, with insulation so your hand doesn't interfere with the reading.
 

Thread Starter

jack33

Joined Dec 31, 2010
42
I haven't gotten my probes made up yet for the sound card oscilloscope, but I thought I would try to input the buzzing sound with a microphone. I used a computer mic connected to the mic input on the sound card. The first image shows the scope output with only the buzzing sound. The second image shows a voice recording. I will test it again directly as soon as I get the probes done.

Recorder Buzz Mic.png.

Recorder Voice Mic.png
 

THE_RB

Joined Feb 11, 2008
5,438
It's pretty obvious the "buzzing" is a digital modulation frequency of about 0.5mS period (ie 2kHz).

That's a nasty freq to try to filter but one good step (as I suggested earlier) would be to maximise the recorded sound volume, so it is louder compared to the noise volume which is normally a fixed amplitude.

You need to find the max volume you can record at where there is no clipping, or minimal clipping. Also using "dynamic compression" on your audio wave before recording will help maximise the signal volume without clipping.
 

thatoneguy

Joined Feb 19, 2009
6,359
I haven't gotten my probes made up yet for the sound card oscilloscope, but I thought I would try to input the buzzing sound with a microphone. I used a computer mic connected to the mic input on the sound card. The first image shows the scope output with only the buzzing sound. The second image shows a voice recording. I will test it again directly as soon as I get the probes done.

View attachment 52617.

View attachment 52618
Can you whistle and get a somewhat clean sinewave to show up on your soundcard scope? (serious question)

two steps, similar to what you did above with recording:
record only buzzing noise, ,perform FFT on capture.

record a clean whistle at whatever frequency you can whistle, post whistle pic, waveform out of recorder of your whistle playing, and FFT of same.

This is assuming you don't have much in the way of background noise your mic is picking up.

Getting the frequency of the added noise will help filter it out. If it is at the 5kHz sample freq, a 300 Ωresistor with the 0.1uF cap may cut it down some.
 

Thread Starter

jack33

Joined Dec 31, 2010
42
It's pretty obvious the "buzzing" is a digital modulation frequency of about 0.5mS period (ie 2kHz).

That's a nasty freq to try to filter but one good step (as I suggested earlier) would be to maximise the recorded sound volume, so it is louder compared to the noise volume which is normally a fixed amplitude.

You need to find the max volume you can record at where there is no clipping, or minimal clipping. Also using "dynamic compression" on your audio wave before recording will help maximise the signal volume without clipping.
Thanks, RB. The buzzing is definitely less noticeable when I increase the sound volume. I'm not sure how to implement the "dynamic compression".
 

Thread Starter

jack33

Joined Dec 31, 2010
42
Can you whistle and get a somewhat clean sinewave to show up on your soundcard scope? (serious question)

two steps, similar to what you did above with recording:
record only buzzing noise, ,perform FFT on capture.

record a clean whistle at whatever frequency you can whistle, post whistle pic, waveform out of recorder of your whistle playing, and FFT of same.

This is assuming you don't have much in the way of background noise your mic is picking up.

Getting the frequency of the added noise will help filter it out. If it is at the 5kHz sample freq, a 300 Ωresistor with the 0.1uF cap may cut it down some.
I'm not very good at whistling, but here are the various scope pics. All these were done with the microphone input.

Recorded buzzing:
Recorder Buzz Mic.png

FFT of recorded buzzing:
Buzz FFT.png

Whistle:
Whistle.png

FFT of whistle:
Whistle FFT.png

Recorded whistle:
Recorded Whistle.png

FFT of recorded whistle:
Recorded Whistle FFT.png
 

thatoneguy

Joined Feb 19, 2009
6,359
I'm not very good at whistling, but here are the various scope pics. All these were done with the microphone input.
Good. :)

Seems the buzzing is between 200 and 400Hz, is that about right? (can you play those frequencies on a windows tone generator?)

That's in the lower register of voice, so attempting to filter it would be a task without distorting the playback.

What The RB was stating was to find out what level the recording IC will clip at, where your whistle will not be a sine wave, but have flat top/bottom or both (like a square wave). The idea is to make the recorded signal so much louder than the internal noise that on playback, the signal will also swamp the internal noise.

That would be option A

Option B is pre-emphasis/de-emphasis, where only the frequencies 150-500Hz are boosted 6dB on recording with a bandpass amp. Then, on playback, reduce that same frequency range (150-500Hz) by 6dB with a bandpass filter prior to amplification. Think of it as "Selectively swamping the noise".

Option C: Compression/Expansion is a process where the dynamic range of the recorded signal (quiet to loud span) of what you want is compressed together to only a few mV difference, then on playback, an expansion is performed so the recorded signal has the full amplitude span again. This is how Dolby B/C tape hiss correction is done (if you are old enough to remember cassette tapes and tape hiss...)

If you can verify the frequency, it would help, it does seem to be more wideband than I'd thought, e.g. sampling frequency would look more like the single "spike" of your whistle than a "fuzz" in the bottom octave with the highest peaks around 250-400Hz near as I can read your output.

Just to double check, you have both a 22uF-ish Electrolytic and a 0.1uF non-electrolytic capacitor physically very close to the supply pins on the recording IC? If so, what does the noise FFT look like without them?
 
Last edited:

Thread Starter

jack33

Joined Dec 31, 2010
42
Good. :)

Seems the buzzing is between 200 and 400Hz, is that about right? (can you play those frequencies on a windows tone generator?)

That's in the lower register of voice, so attempting to filter it would be a task without distorting the playback.

What The RB was stating was to find out what level the recording IC will clip at, where your whistle will not be a sine wave, but have flat top/bottom or both (like a square wave). The idea is to make the recorded signal so much louder than the internal noise that on playback, the signal will also swamp the internal noise.

That would be option A

Option B is pre-emphasis/de-emphasis, where only the frequencies 150-500Hz are boosted 6dB on recording with a bandpass amp. Then, on playback, reduce that same frequency range (150-500Hz) by 6dB with a bandpass filter prior to amplification. Think of it as "Selectively swamping the noise".

Option C: Compression/Expansion is a process where the dynamic range of the recorded signal (quiet to loud span) of what you want is compressed together to only a few mV difference, then on playback, an expansion is performed so the recorded signal has the full amplitude span again. This is how Dolby B/C tape hiss correction is done (if you are old enough to remember cassette tapes and tape hiss...)

If you can verify the frequency, it would help, it does seem to be more wideband than I'd thought, e.g. sampling frequency would look more like the single "spike" of your whistle than a "fuzz" in the bottom octave with the highest peaks around 250-400Hz near as I can read your output.

Just to double check, you have both a 22uF-ish Electrolytic and a 0.1uF non-electrolytic capacitor physically very close to the supply pins on the recording IC? If so, what does the noise FFT look like without them?
Thanks, thatoneguy.

From the scope trace and the FFT, the noise seems to have a main frequency around 250Hz with 1 - 2kHz signals overlayed on the main signal. The noise is actually somewhat more of a whooshing sound like air flowing than a clear single frequency buzz.

I played frequencies in the 100 - 500Hz range using the signal generator in the soundcard scope. What sounded the closest to the noise to me was a triangle wave around 150Hz. This gives more of a buzzing sound than the sine waves which give nice smooth tones. I tried playing both channels, one with 150Hz and the other with 1.5kHz at a lower amplitude. I don't think that made the sound any better as I can hear the separate frequencies.

I do have both a 22uF electrolytic and a 0.1uF ceramic capacitor physically very close to the supply pins on the recording IC. The noise FFT looks about the same without them.

I guess the simplest thing for me is to try to optimize option A.
 

thatoneguy

Joined Feb 19, 2009
6,359
The noise is actually somewhat more of a whooshing sound like air flowing than a clear single frequency buzz.
Have you tried a couple of different microphones, or attempting to record directly from your sound card output with line out, rather than having the microphone involved?

It may be that the microphone has a high noise, or the gain of the input to the recording IC is set dynamically so that air movements and other air "whooshing" sounds that are normally inaudible are suddenly clear to hear.

If you've been using the same microphone, I'd suggest trying a different one, perhaps a different brand, even, and ensure that the bias signal to it (I'm assuming it is a condenser mic) is noise-free as well.

The output sound will be at best, only as good as the input signal, and stability of it's power supply.
 

Thread Starter

jack33

Joined Dec 31, 2010
42
Have you tried a couple of different microphones, or attempting to record directly from your sound card output with line out, rather than having the microphone involved?

It may be that the microphone has a high noise, or the gain of the input to the recording IC is set dynamically so that air movements and other air "whooshing" sounds that are normally inaudible are suddenly clear to hear.

If you've been using the same microphone, I'd suggest trying a different one, perhaps a different brand, even, and ensure that the bias signal to it (I'm assuming it is a condenser mic) is noise-free as well.

The output sound will be at best, only as good as the input signal, and stability of it's power supply.
I'll try different microphones. The one on the board is a small electret, which is what the IC data sheet shows in the application circuit. I'll remove it and replace it with some pins so I can try different mics.

Can the line out from the sound card be put directly into the microphone inputs without modifying the circuit?
 

thatoneguy

Joined Feb 19, 2009
6,359
I'll try different microphones. The one on the board is a small electret, which is what the IC data sheet shows in the application circuit. I'll remove it and replace it with some pins so I can try different mics.

Can the line out from the sound card be put directly into the microphone inputs without modifying the circuit?
From reading the Datasheet for IDS1810 (10 second version of same IC), the typical input is 15mV Pk-Pk, with the Maximum at 300mV Pk-Pk (differential input), suggested 100mV for a single ended input. I avoid the maximum voltages, I'm unsure if that is the clipping level or damage level.

You can use a standard line in signal, greatly attenuated /very low volume (I'd suggest maybe 0.05V to 0.1V pk-pk). The range is 15mV to 100mV Pk-Pk, or 0.015Vp-p to 0.1Vp-p max. Impedance is 10k, so a 0.1uF input coupling capacitor would give a cutoff around 200Hz, while a 1uF cap would go down to about 20Hz.

The IC DOES have an Automatic Gain Control that could be helping a microphone pick up noise if no other significant signal is present, though the gain should lower to only allow a louder signal to pass. The AGC would explain why the noise has a different profile/amplitude with the mic alone and no signal.

I also noticed that many of the diagrams in that datasheet refer to a 3V supply rather than a 5V supply, I'm unsure what your supply voltage is, but maybe try 2AA cells to power it and see if the results differ?
 

Thread Starter

jack33

Joined Dec 31, 2010
42
From reading the Datasheet for IDS1810 (10 second version of same IC), the typical input is 15mV Pk-Pk, with the Maximum at 300mV Pk-Pk (differential input), suggested 100mV for a single ended input. I avoid the maximum voltages, I'm unsure if that is the clipping level or damage level.

You can use a standard line in signal, greatly attenuated /very low volume (I'd suggest maybe 0.05V to 0.1V pk-pk). The range is 15mV to 100mV Pk-Pk, or 0.015Vp-p to 0.1Vp-p max. Impedance is 10k, so a 0.1uF input coupling capacitor would give a cutoff around 200Hz, while a 1uF cap would go down to about 20Hz.

The IC DOES have an Automatic Gain Control that could be helping a microphone pick up noise if no other significant signal is present, though the gain should lower to only allow a louder signal to pass. The AGC would explain why the noise has a different profile/amplitude with the mic alone and no signal.

I also noticed that many of the diagrams in that datasheet refer to a 3V supply rather than a 5V supply, I'm unsure what your supply voltage is, but maybe try 2AA cells to power it and see if the results differ?
I tried 2 AA cells and got the same noise. I had previously tried a 3.3V power supply and still got the noise. However, I think the recorded sound seems better with 3.3V than with 5V supply, so I have been using 3.3V. Some of the info on the recorder module says specifies 3 - 5V, another said 3.3V max.

I removed the microphone and tried recording with no microphone connected. I still get the same noise, so it seems to be independent of the mic.

I tried another mic and got the same noise with a blank recording, but the quality was slightly better with a voice recording.

I also tried adding some wires to the mic connections and recording without a mic to see if more noise was picked up. I didn't notice any difference. It seems the noise is generated somewhere within the circuit.

I examined the circuit after I removed the mic and it appeared that the microphone polarity was the reverse of what it should be. Neither the circuit diagram for the record module nor the IC data sheet show the mic polarity, but it seemed that it should be connected in the normal way (+ toward Vcc, - toward ground). I couldn't tell which way the mic was connected until I removed it. I tried reversing the mic connections and now the sound quality is much better. The noise is still there, but now I can record at higher volume without distortion, which minimizes the effect of the noise. Also, now the sound volume is higher when driving the speaker directly from the record module, without the additional amplifier. I may still want to use the 386 amplifier to increase the volume further as the sound quality is also better now with the 386 amplifier.

I haven't tried recording from the computer sound card yet, but I would like to be able to do that. If I record from the sound card line out, should I use a voltage divider to reduce the voltage or just use the sound card volume control?
 

thatoneguy

Joined Feb 19, 2009
6,359
If the noise was the same level recording without a microphone, I am out of ideas.

You can try the line in, as long as the level isn't greater than 0.1v p-p in, a divider and/or low volume should give you a signal for that.
 
Top