Linkan
Posts: 30
Joined: Tue Feb 10, 2015 3:56 pm

Raspberry Pi USB microphone 1 Khz background noise interfere

Mon Aug 03, 2015 10:11 pm

Using this microphone I have some severe noise in the background. The more peripherals I plug in (camera, gertboard, wi-fi adapter) the worse the noise becomes. We've tried several different power supplies, however the problem still remains. The microphone seems to pick up some switching noise from the pi itself and from the peripherals connected to it. The most significant frequency one can hear sounds to be about 1 Khz.

The noise is not present if one plugs in the microphone into any other computer. So the problem clearly lies with the raspberry pi itself. Do you have any suggestions as to what to do about this problem?

I am using a Raspberry Pi Model B with old linear regulators. Perhaps the problem could be fixed by using a USB hub with an external power supply?

(EDIT: Also, the volume is always the same, I believe the amplitude is around 0.2 on a scale from 0 to 1. It's a constant tone which is very alike to a 1 Khz sawtooth/square tone. It does not help using a usb extension cable, still the same bad effect.)
Last edited by Linkan on Wed Aug 05, 2015 9:14 am, edited 1 time in total.


User avatar
RaTTuS
Posts: 10809
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Wed Aug 05, 2015 9:30 am

run the audio though a spectrum analyzer to see where you getting peaks - is it a ground loop ?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Linkan
Posts: 30
Joined: Tue Feb 10, 2015 3:56 pm

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Wed Aug 05, 2015 9:46 am

So, I took a new sample from a video today and one can hear a "click" sound every second which I find wouldn't sound too much alike ground loop noise. Anyway here's a image of the frequency analysis:
Image

Here is the spectrum.txt exported from audacity.


User avatar
cyrano
Posts: 718
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Thu Aug 06, 2015 9:21 pm

Looking at the graph it's almost certainly USB noise. Have you tried another, better PSU?

Alternatively, an extra ripple filter capacitor (2200 uF, 10 V) on the 5V rail could help too.

In general, these USB mics have very little power filtering which makes them extremely susceptible to noise on some computers.

Linkan
Posts: 30
Joined: Tue Feb 10, 2015 3:56 pm

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Thu Aug 06, 2015 10:28 pm

cyrano wrote:Looking at the graph it's almost certainly USB noise. Have you tried another, better PSU?

Alternatively, an extra ripple filter capacitor (2200 uF, 10 V) on the 5V rail could help too.

In general, these USB mics have very little power filtering which makes them extremely susceptible to noise on some computers.
Thanks for the answer cyrano :-D

Well I've tried many different power supplies at 5V which are able to give atleast 1.5 - 2 amps. The one I'm using now which seems to be the one that generates the least amount of noise is my Samsung Adaptive Fast Charger. Perhaps a PSU would yield completely different results?

I might give the ripple filter capacitor a try, how would I mount that?

User avatar
cyrano
Posts: 718
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Mon Aug 10, 2015 11:16 am

The filter capacitor should go in parallel to the 5V line. + side to 5V, - to the 5V ground...

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 14296
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Mon Aug 10, 2015 11:45 am

as close as possible to the USB connector, that is, mount it over the USB connector pins.
Use something like 1000uF 16V

User avatar
davidcoton
Posts: 6636
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Mon Aug 10, 2015 5:44 pm

mahjongg wrote:as close as possible to the USB connector, that is, mount it over the USB connector pins.
Use something like 1000uF 16V
Right on the position, but a capacitor as large as 1000uF may not be good at suppressing audio frequency ripple. It's not a case of "bigger is better". Without a lot of reading of specs for particular makes, I would use a 0.1uF ceramic cap, and possibly a 4.7uF tantalum in parallel if the first one didn't solve it.
Location: 345th cell on the right of the 210th row of L2 cache

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 14296
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Tue Aug 11, 2015 11:20 am

I agree better isn't necessarily bigger, 1000uF is more for repressing 50Hz noise than for 1KHz noise, although 330uF would probably be enough.
As for your recommendation, I agree, up to a point, as a B already has a 47uF tantalium, and 100nF ceramic decoupling near the USB ports, I think just adding a tenth of that capacitance won't do much.

note that the B+ has both a 47uF AND a 10uF ceramic cap TWICE (one for each double decker connector).

Specifically for 1KHz repression, my revised recommendation would be to use a 100uF tantalium capacitor.

Linkan
Posts: 30
Joined: Tue Feb 10, 2015 3:56 pm

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Fri Aug 14, 2015 9:46 pm

mahjongg wrote:I agree better isn't necessarily bigger, 1000uF is more for repressing 50Hz noise than for 1KHz noise, although 330uF would probably be enough.
As for your recommendation, I agree, up to a point, as a B already has a 47uF tantalium, and 100nF ceramic decoupling near the USB ports, I think just adding a tenth of that capacitance won't do much.

note that the B+ has both a 47uF AND a 10uF ceramic cap TWICE (one for each double decker connector).

Specifically for 1KHz repression, my revised recommendation would be to use a 100uF tantalium capacitor.
Hi mahjongg, thanks for the reply. I tried with a few different capacitors over the usb connectors and I had some fascinating results. First of I tried a 100 µF / 16 v capacitor connected like the picture below shows. The noise was not as bad compared to without using a capacitor, however it seems to generate some sort of pulse where the same 1 Khz noise could be heard.
Image

I wasn't happy with the result so I tried with a 1000 µF / 10 v capacitor, however it gave me a very clean 1 Khz noise. Certainly different from the first result but it didn't work very good at all.
Image

Finally I tried this bad boy (2200 µF / 35 v) below which was enough to kill the raspberry pi. However when I booted it back up, surprisingly it gave me a very good result compared to the others.
Image

Any suggestions to make it completely silent? Perhaps I am using the wrong type of capacitors.

(EDIT: The operations on the pi are quite CPU and GPU intensive because I am both live streaming to ustream and recording to disk if a PIR sensor goes active. Without streaming video and just audio through ssh, the capacitors generated different results.)

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 14296
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Fri Aug 14, 2015 10:47 pm

well you are using aluminium foil capacitors, which for higher frequencies are not the best, as they have a high parasitic inductance. That why I advised a tantalium capacitor, although they do not tend to come in quite as large capacities.

something like this perhaps: http://uk.farnell.com/multicomp/mccb1a2 ... st=1869986

Linkan
Posts: 30
Joined: Tue Feb 10, 2015 3:56 pm

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Tue Aug 18, 2015 3:26 pm

mahjongg wrote:well you are using aluminium foil capacitors, which for higher frequencies are not the best, as they have a high parasitic inductance. That why I advised a tantalium capacitor, although they do not tend to come in quite as large capacities.

something like this perhaps: http://uk.farnell.com/multicomp/mccb1a2 ... st=1869986
Okay, I have done some more testing and I am starting to believe that capacitors won't work particularly good in my situation. I used a 150 µF / 6.3 v tantalium capacitor and did some testing with different peripherals in use.
Image

The result using TP-Link TL-WN722N USB Wireless Adapter, Microphone and without camera (streaming over WLAN via SSH).
The result using TP-Link TL-WN722N USB Wireless Adapter, Microphone and with camera (streaming over TCP via ustream).

The result using Ethernet, Microphone and without camera (streaming over LAN via SSH).
The result using Ethernet, Microphone and with camera (streaming over TCP via ustream).

I don't believe using a 220 µF / 10 v tantalium capacitor would yield any better results. How about adding a external power supply to the same USB pins? Perhaps I can directly power feed the raspberry pi USB ports like discussed in this blog.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 14296
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Tue Aug 18, 2015 4:56 pm

Yes, that could make a big difference. Your experiment with 2200uF more or less proved it was power interference anyway.

Linkan
Posts: 30
Joined: Tue Feb 10, 2015 3:56 pm

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Tue Aug 18, 2015 6:54 pm

mahjongg wrote:Yes, that could make a big difference. Your experiment with 2200uF more or less proved it was power interference anyway.
Okay, but before I buy that one, I did run the same test with the 2200 uF capacitor but this time with the wireless adapter I mentioned above. It ought to work with the wireless adapter if it works using ethernet (the sample above was run with ethernet). However unfortunately it did not make any difference running with wireless adapter and a 2200 uF / 35 v capacitor compared to without the capacitor.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 14296
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Raspberry Pi USB microphone 1 Khz background noise inter

Wed Aug 19, 2015 12:22 pm

A wireless adapter transmits an electromagnetic field, which can interfere with unshielded sensitive analog inputs, like microphone inputs on a sound card. Try to physically move the two apart.

Return to “General discussion”