Removing background noise from ADC mic input.
Kye
Posts: 2,200
I just finished working on·some really nice audio input and output drivers for the prop chip that both simplify playing and recording audio.
Attached are both the drivers in pretty muh their final form. I have the·audio output driver (DAC Engine) working very nicely and when playing back high quality·wave files on the prop no one has been able to tell the difference between it and·a regular computer.
I also have the audio input driver attached (ADC Engine) which uses the sigma delta ADC on the prop chip's pin inputs to sample audio. The quality at high sample rates for it is also very good. At·16000 - 88200 Hz your voice comes through clearly without any distortion.
---
I'm posting this here because I would like feedback on the·quality of the audio transfer and I would like to see if anyone has any ideas on how to make the audio input driver cut out all the low level noise static produced when a microphone is hooked up.
Right now my audio input driver does no averaging or any other·special tricks. I was quite pleased to find that the algorithm used by it to scale·samples from the sigma delta ADC·into bit into 16 bit or 8 bit chunks gets rid of alot of noise from the sigma delta ADC.
I'm looking·for something·SIMPLE I can do to remove background noise etc.
Thanks,
---
You will need to open the ADC and DAC engine and make sure you have the hardware attached to the pins specified in the files attached to the propeller chip so that you can test out this driver.
I have it setup to run on the demoboard configuration right now.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Attached are both the drivers in pretty muh their final form. I have the·audio output driver (DAC Engine) working very nicely and when playing back high quality·wave files on the prop no one has been able to tell the difference between it and·a regular computer.
I also have the audio input driver attached (ADC Engine) which uses the sigma delta ADC on the prop chip's pin inputs to sample audio. The quality at high sample rates for it is also very good. At·16000 - 88200 Hz your voice comes through clearly without any distortion.
---
I'm posting this here because I would like feedback on the·quality of the audio transfer and I would like to see if anyone has any ideas on how to make the audio input driver cut out all the low level noise static produced when a microphone is hooked up.
Right now my audio input driver does no averaging or any other·special tricks. I was quite pleased to find that the algorithm used by it to scale·samples from the sigma delta ADC·into bit into 16 bit or 8 bit chunks gets rid of alot of noise from the sigma delta ADC.
I'm looking·for something·SIMPLE I can do to remove background noise etc.
Thanks,
---
You will need to open the ADC and DAC engine and make sure you have the hardware attached to the pins specified in the files attached to the propeller chip so that you can test out this driver.
I have it setup to run on the demoboard configuration right now.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Comments
Do you have a problem with...
--RFI, radio static noise from Propeller or other nearby sources?
(Would be helped by averaging or lowpass filter or RF shield or choke)
--Quantization error noise?
(The microphone and preamp needs clean power
and ADC needs as many bits as possible, 12 should be good at high sample rates.
Serial or SAR ADCs might tend to have intrinsic quantization noise for audio. Do you have a "flash type ADC"?
I've been considering designing and using a Graycode flash ADC, may have minimum possible Quant noise)
I don't know how to help improve the simplified mic-headphones obex sigma delta adc on the demoboard;
averaging is included I think.
Quant noise can be visualized by plotting the lower 7 or 8 bits after clipping the waveform to that range,
and it is maximally reduced if the plot is a straight line with the microphone off.
--Real background sounds, like people in the room, vehicles outside?
(Would be helped by a special microphone that is desensitized to low sounds, OR
by techniques that separate sound from stereo or multiple microphones based on their relative location,
similar to those which separate vocals from music, plus delays, dsp techniques.)
A simple example: (rough pseudo code) for stereo sound separations without dsp filters
L=left channel
R=right channel
novocals=L-R
That is only a little oversimplified, some adjustment of volume is needed, and it does not take too many
more similar steps to get back stereo novocals or stereo onlyvocals tracks.
To eliminate or enhance sound from a particular location is possible especially with more mics,
using delays and volume adjustments (maybe called weights, volume is adjusted by multiplying and
then perhaps a right shift to rescale it to the normalization (normal "dynamic" range of volume).
Someone recently asked about stereo delay processing and I forgot to mention the obex stereospatializer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I should be typing in Spin now.
I actually have something here that's alot better than what the parallax library currently offers. I was·doing the same microphone to headphones demo but on my setup at least the sound is alot cleaner and richer compared to Chip's microphone to headphones demo.
When you can download the file you'll see I have alot of new features implemented.
I'm just posting this to see if anyone (who can test out my posted demo code) has any ideas on how to remove SLIGHT background noise. The noise is not really bad but I want to see if I can get rid of it all. Most of the noise however I would say comes from background noise in the enviorment. But background noise isn't really wanted so I want to see if I can tune that out.
So, I need a purely software ASM approach to remove the noise.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Also there is noise directly injected from the supply through the top capacitor as this ironically acts as a high-pass letting all the noise through to the input pin as well as being the filter cap for the feedback loop. A very tight design with good decoupling on all the pins and a solid ground plane along with regulators mounted as close to the chip as possible would help a lot. Of course, the input buffer is not designed to hover around this point with any guaranteed mode of operation anyway.
If we had a comparator fast enough we could feed the input into that and then the comparator to the Prop's input pin and because the comparator would obviously have a stable reference voltage then the input would be relatively stable. There would always be the minor "hunting" noise as the feedback tries to balance the pin around the threshold as there is no way this type of circuit could operate otherwise. It's a bit like a switch-mode regulator's ripple which can be removed with a post-filter but not at the feedback point.
But this is just my opinion, I'm interested in some input from the many experienced and knowledgeable forum members as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
Other than digital filtering in software I'm not sure how to reduce the Sigma-conversion noise. If you know the specific frequency you want to reduce you can compare the data buffer against a previous data location of itself in time that correlates to half the period of the frequency you want to 'notch'. This works best at high frequencies and can cause unwanted effects with lower frequencies. If you simply want a low-pass filter then averaging can be done to effectively remove high frequency components. high-pass filtering is a little tricky because it's derived from subtracting the low-pass filter result from the original sample.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
At 16 bits the noise is low valued and does not make up a significant portition of the audio stream. However at 8 bits the noise overpowers the signal and everything becomes sorrounded in a layer of static.
It seems I need a high pass filter to remove it at 16 bits and a low pass filter to remove it at 8 bits.
So, how would I do this in ASM?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 2/7/2010 4:12:40 PM GMT
RE:background noise
Let us see what it looks like on your PropScope
Sorry.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Chip Gracey
Parallax, Inc.
Chip, do you have any thoughts on the capacitor dielectric's effect on noise. Could hysteresis be a factor? How will the Prop II improve on the input circuit?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
Ahhh, good. I hadn't investigated it but I do know that in analog circuits this happens. However, hearing the difference is not totally conclusive either. I do believe that it is canceling one type of noise, and "possibly" injecting another. Believing though is one thing and I wanted some "feedback" on this, thanks, although I will probably check it out for my peace of mind (and curiosity).
That top cap injects the same VDD noise that exists on the input decider right onto the input signal, itself,·making them more common-mode. It makes a big net improvement. You need to inject both VSS and VDD (bottom and top caps) to get lower noise.
Chip, do you have any thoughts on the capacitor dielectric's effect on noise. Could hysteresis be a factor? How will the Prop II improve on the input circuit?
Different caps might make somewhat of a difference, but I·believe that active noise sources play a much higher role. I remember hearing an audio guy say once that metallized polystyrene caps were some of the best to use, but I don't know.·Anything with low ESR and short leads (low L) should be pretty good.The next Propeller will have an internal integrator on each pin, along with local reclocking, for much better performance (better than 13-bit, according to SPICE simulation).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.