I wonder if this could be auto-calibrated, like prompt the user with "sit in a quiet place and say '1,2,3'" then brute-force the audio offsets to get the highest peak signal; and from then on you could have the mic focus follow the user's head as they move it by constantly trying slightly different offsets and jumping to a new offset if one sounds stronger?
Beamforming in PulseAudio
21–30 of 36 posts
Re: Beamforming in PulseAudio
#22Repost as a semi-useful thread below didn't meet humor standards and people who aren't logged into HN should see it, too. If you need an FIR filter, click here and push the button. Generates the code too. http://t-filter.engineerjs.com/ Also if you don't know what you're talking about, kindly refrain from wandering into it in the middle of an article that might otherwise be useful. "An Intro To Beamforming" is a hell…
> There is a fair amount of academic work describing methods to perform filtering on a sample to provide a fractional delay. One common way is to apply an FIR filter. However, to keep things simple, the method I chose was the Thiran approximation — the literature suggests that it performs the task reasonably well, and has the advantage of not having to spend a whole lot of CPU cycles first transforming to the frequency domain (which an FIR filter requires).
I'm not a real DSP expert by any stretch of the imagination, but applying an FIR filter does not require transforming to the frequency domain. To the contrary: a basic FIR filter just means that the ith output sample is a[0]x[i] + a[1]x[i-1] + a[2]x[i-2] + ... + a[N-1]x[i-N+1] where x is the input, a is the filter coefficients, and N+1 is the (finite) length of the filter. (If the input is all zeros except that x[0]=1, then the input is an impulse and a is the output, i.e. the impulse response. Hence the name: Finite Impulse Response.)
Some very long FIR filters are more efficient to apply by Fourier transforming the input, but that's almost certainly not the case here. It's worth noting that FIR filters vectorize very nicely.
(My FIR description isn't quite 100% accurate. I described only the discrete-time causal case. If you drop the causality requirement (which is fine but can be awkward in real-time processing) then you add negative indices to a. If you switch to continuous time, you end up with a convolution instead of a sum of products.)
Re: Beamforming in PulseAudio
#23Version 9.0 of the product and the guy has time to draw pictures but can't be bothered to implement an FIR filter. (Bonus: incorrectly defines an FIR filter.) Admits his solution is bad, might be buggy. Finds a better replacement, then ships his anyway . What is it about audio that attracts this curious level of "engineering"?
My dang-compliant version of the same sentiment would go something like, "If you're going to write posts for public consumption, please consider limiting the topic to things you actually know about. You never know who might read and/or learn from what you write."
Re: Beamforming in PulseAudio
#24Repost as a semi-useful thread below didn't meet humor standards and people who aren't logged into HN should see it, too. If you need an FIR filter, click here and push the button. Generates the code too. http://t-filter.engineerjs.com/ Also if you don't know what you're talking about, kindly refrain from wandering into it in the middle of an article that might otherwise be useful. "An Intro To Beamforming" is a hell…
Sad that the thread got flagged into oblivion. > There is a fair amount of academic work describing methods to perform filtering on a sample to provide a fractional delay. One common way is to apply an FIR filter. However, to keep things simple, the method I chose was the Thiran approximation — the literature suggests that it performs the task reasonably well, and has the advantage of not having to spend a whole lot…
Re: Beamforming in PulseAudio
#25That's why commercially available phased array microphone systems that actually work are typically one to several meters wide.
Re: Beamforming in PulseAudio
#26Still nothing that isn't already possible in JACK. over ethernet or Wifi.
How do you mean?
Jack is intended as a low-latency audio and midi router for audio production. It routes audio data between applications and whatever analog/digital/midi I/O you have plugged into it that Linux supports reasonably well. In other words it's for build a audio workstation.
So you could, provided you had the skills, quite easily create a audio processing pipeline that will do any type of 'beamforming' you want and more.
Pulseaudio on the other hand is designed as a general purpose desktop and mobile audio daemon that is designed to make it simple to manage typical hardware you find in a typical PC. This sort of stuff is designed to make it nice to have a webcam for simple blog or talking to your mom, not necessarily the best choice if you want to run a music studio from your laptop.
Re: Beamforming in PulseAudio
#27Great to see this work being talked about. I work on the media signal processing team at Google. My team built this beamformer before I started, but I'm happy to see it being used in PulseAudio. The paper hasn't been released, but the nonlinear beamformer code is open source. You can find it in WebRTC. https://chromium.googlesource.com/external/webrtc/+/master/w...
Re: Beamforming in PulseAudio
#28Repost as a semi-useful thread below didn't meet humor standards and people who aren't logged into HN should see it, too. If you need an FIR filter, click here and push the button. Generates the code too. http://t-filter.engineerjs.com/ Also if you don't know what you're talking about, kindly refrain from wandering into it in the middle of an article that might otherwise be useful. "An Intro To Beamforming" is a hell…
Sad that the thread got flagged into oblivion. > There is a fair amount of academic work describing methods to perform filtering on a sample to provide a fractional delay. One common way is to apply an FIR filter. However, to keep things simple, the method I chose was the Thiran approximation — the literature suggests that it performs the task reasonably well, and has the advantage of not having to spend a whole lot…
I sometimes feel the PC threshold is a bit high in some threads. In this case however even I felt the snark level was painful.
As a productive engineer I often put out internal tools or POCs that would be possible to snark at in this way.
I do however expect that people improve them or explain the better way instead of posting dismissive comments on what this guy has done on top of his open source contributions.
That said: I'm happy to see it reposted although I would prefer if he removed the defence for his previous post as it did add confusion to the new post as well.
Re: Beamforming in PulseAudio
#29The reason the author's beamformer doesn't work very well may have nothing whatsoever to do with his implementation. A short-baseline microphone array won't be able to have good selectivity in the human hearing range no matter what you do. All synthetic aperture systems are fundamentally limited by the wavelength of the thing being sampled. You need an aperture many wavelengths wide in order to get a significant effe…
I'm actually very surprised that it works as well as it does, based on the sample recordings.
Re: Beamforming in PulseAudio
#30I wonder if this could be auto-calibrated, like prompt the user with "sit in a quiet place and say '1,2,3'" then brute-force the audio offsets to get the highest peak signal; and from then on you could have the mic focus follow the user's head as they move it by constantly trying slightly different offsets and jumping to a new offset if one sounds stronger?
Of course, we'll have the same problems as all the other information in there, that some cheap equipment will have bogus values as someone just copied the ACPI tables from the previous hardware without verifying the information...