?? Mon, 10 Jan 2011 11:44:36 +0100 Maarten Bosmans <mkbosmans at gmail.com> ????????: > 2011/1/10 IL'dar AKHmetgaleev <akhilman at gmail.com>: > > I have a cheap USB headset which records audio with the little > > DC-Offset and noise at 50Hz. > > > > As I know it's very usual problem of cheap audio devices and > > integrated audio cards. > > > > So I'm requesting a module which will filter input stream. > > This pseudo code was suggested in alsa ML: > > > >> xs=0 > >> while (input){ > >> xs=.01 xinput +.99 xs > >> xoutput=xinput-xs > >> } > >> (This averages over roughly the last 100 inputs and subtracts the > >> offset). If you want a longer averaging, change the coefficients. > > It is wrong to say that the averaging is done over the last 100 > inputs. What you are proposing is averaging with exponential > weighting. This means the averaging window is infinately long. > > The concept can be useful, but you need a much smaller factor if by > inputs you mean samples. 0.00001 for example would be better, because > then the last period of a 20Hz wave in a 48000Hz signal only > contributes 2.4% to the average (1-.99999^2400), which seems much more > reasonable. > > > Will be nice to have such module with sampling period as attribute. > > Is there any reason this kind of signal processing wouldn't be more > appropriate in an alsa driver? I had tested ladspa filtering and sound becomes very nice. I did it with alsa ladspa plugin and with this chain: source->Eq(cutting off all behind 100 Hz)-> se4(to decrease dynamic range)->amp_mono-> dysonCompress->recorder But this alsa plugin makes pulseaudio hangs with some applications (skype and teamspeak3). I had tried same using PA chain: source->loopback->multiple ladspa-sinks->null-sink|monitor->recorder. But because of Eq has different channel naming I had to use another equalizer. With this chain delay was much bigger then with alsa approach. Will be nice to have ladspa-source and null-source modules also.