introlab / odas

ODAS: Open embeddeD Audition System
MIT License
777 stars 247 forks source link

How to configure gain properly for working in long distance? #103

Open jamesshao8 opened 6 years ago

jamesshao8 commented 6 years ago

We are trying to receive signals from a longer distance, like 10 meters.

We experimented with audacity and found that a single channel can hear normal speech at around 4 meters. But with odas we can only hear at around 2~3 meters. I think with beamforming, odas should be able to provide longer distance of receiving than single channel microphone. So we wonder if it's a setting problem.

We saw in the cfg file there are various gain, like gain_sep gain_pf and another gain in postfiltered section. Which gain matters the most and what is the largest value can we put in there?

Thanks!

taospartan commented 6 years ago

Which mic array are you using?

Sent from my iPhone

On 8 Aug 2018, at 08:50, jamesshao8 notifications@github.com wrote:

We are trying to receive signals from a longer distance, like 10 meters.

We experimented with audacity and found that a single channel can hear normal speech at around 4 meters. But with odas we can only hear at around 2~3 meters. I think with beamforming, odas should be able to provide longer distance of receiving than single channel microphone. So we wonder if it's a setting problem.

We saw in the cfg file there are various gain, like gain_sep gain_pf and another gain in postfiltered section. Which gain matters the most and what is the largest value can we put in there?

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

jamesshao8 commented 6 years ago

@taospartan I am using 16SoundsUSB and the electret version of microphone board. I made them locally according to the design file from introlab. The sensitivity of the electret microphone board is -44dB. And first stage of amplification is around 20 times, which is strange for me because according to the datasheet it should be 40dB (100 times).

taospartan commented 6 years ago

I’d be looking at the dynamic range of the microphones. With dss beamforming I think I’ve gone up to around sep_gain 50. I’d experiment with static beamforming, giving odas your own targets. Also I’ve found having the array in a horizontal orientation makes a difference.

jamesshao8 commented 6 years ago

@taospartan I am using post-filtered instead of separate. But once increased to 10, there is obvious distortion. We have already tried static beamforming, by setting the cfg file. But I do notice there is a phoenix branch, is it optimized for this kind of work?

taospartan commented 6 years ago

The Phoenix branch’s main difference is it uses sockets interact with odas, as far as I’ve looked the beamforming seems to be identical from audio tests (spectrograms look the same). However there doesn’t seem to be settings to adjust the gain side of things. I’m trying, but with not much luck, to see differences at 24k 32k and 44.1k with Phoenix branch. I have a feeling that in order to amplify distant sounds maybe the bit rate has a role to play too. But I maybe as usual on the wrong path completely!! @FrancoisGrondin is probably the best person to answer definitively:)

jamesshao8 commented 6 years ago

24k 32k 44.1k is the sampling rate right? Are you sure that sampling rate would affect the distance? The ADC bit size has something to do with the dynamic range. I am using the 16SoundsUSB with 32bit, and trying to increase the signal in the analog part. @taospartan

taospartan commented 6 years ago

I’ll be honest I’m not sure about anything but trying different ideas and seeing what works!:)

Sent from my iPhone

On 14 Aug 2018, at 09:23, jamesshao8 notifications@github.com wrote:

24k 32k 44.1k is the sampling rate right? Are you sure that sampling rate would affect the distance? The ADC bit size has something to do with the dynamic range. I am using the 16SoundsUSB with 32bit, and trying to increase the signal in the analog part. @taospartan

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jamesshao8 commented 6 years ago

In RF world, oversampling is used to solve aliasing. This indeed reminds me of a problem that I am using a sample rate of 16kHz to sample from my electret mic with a maximum frequency of 20kHz. I will try to setup the cfg file to sample at higher frequency or choosing a microphone with lower frequency.

taospartan commented 6 years ago

@jamesshao8 have you had any success?

jamesshao8 commented 6 years ago

Hello taospartan,

We have used electret mic in other projects before. And the recording distance should be way larger than what we are doing with odas and 16soundsusb. We are suspecting that this is not a hardware problem. Either the problem is with odas, or we are just not tuning to a enough volume.

We are developing our own software to do beamforming and real-time listening to the audio. And we found maybe it's not the problem of pf_gain. Because if we increase pf_gain, distortion is created. So instead, it's a problem when converting float to short, like multiplying 0x7FFF for 16 bit samples. But when we multiply this constant, or any constant like a volume, there is another kind of distortion. However, when we put the recorded output to gnuradio, there is no distortion when changing volume. We are still looking if it's a coding problem.

taospartan commented 6 years ago

What kind of distances are you working at? I’ve been using sox in the last few days to increase the gain of the pf output but my hunch is to try and increase the gain on the input before odas and see if that can effect the distance, but this requires more resources than a humble raspberry pi 3b with 16 mics! Also I’m looking at the noise floor of the mics to make sure signals aren’t being masked

jamesshao8 commented 6 years ago

I am now able to receive voice signal from 3 meters. My goal is 10 meters. What is sox? I am also making mems microphones for 16SoundsUSB, but I will get those boards at the end of this week. Could you explain why computing power effects the receiving distance? I am using a laptop to run odas, so computing power isn't a problem. Once I have confirmed that mems version is better than electret mics, I will use my own mics with even higher sensitivity and SNR.

jamesshao8 commented 6 years ago

@taospartan I have tried the mems mic design for the 16SoundUSB. They can provide me with higher gain indeed. And my own modification of the amplification loop increase the distance further. But it's still not enough for me. Other than that, I found when in a close distance, the beamforming effect is obvious, in the sense that, the sound level in wanted direction is much higher than from other direction. But when the distance go up, the sound level becomes similar in all directions.

taospartan commented 6 years ago

What distances does it drop off ? And what’s the noise from of the mics?

Sent from my iPad

On 25 Aug 2018, at 13:39, jamesshao8 notifications@github.com wrote:

@taospartan I have tried the mems mic design for the 16SoundUSB. They can provide me with higher gain indeed. And my own modification of the amplification loop increase the distance further. But it's still not enough for me. Other than that, I found when in a close distance, the beamforming effect is obvious, in the sense that, the sound level in wanted direction is much higher than from other direction. But when the distance go up, the sound level becomes similar in all directions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jamesshao8 commented 6 years ago

I can hear voice from around 7 meters. But there is no difference whether I hit right on the beamforming spot. I think to have obvious beamforming effect, I should come near to around 3 meters. I am suspecting if there is a threshold for the beamforming module in odas to take effect?

taospartan commented 6 years ago

Or the noise floor of the mics is affecting it, just out of interest what is the layout of your mics?

Sent from my iPhone

On 25 Aug 2018, at 14:15, jamesshao8 notifications@github.com wrote:

I can hear voice from around 7 meters. But there is no difference whether I hit right on the beamforming spot. I think to have obvious beamforming effect, I should come near to around 3 meters. I am suspecting that if there is a threshold for the beamforming module in odas to take effect?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jamesshao8 commented 6 years ago

Yes maybe it's caused by the noise floor, which cannot be distinguished by direction anymore.

The mic I am using is designed by introlab. You can find them here: https://github.com/introlab/xSoundsMicrophones

taospartan commented 6 years ago

Are your mics in a horizontal or vertical plane?

I did have a thought the increasing the bit rate may have an effect but would probably need lots more resources. The theory being the dynamic range would be increased, what do you think?

Sent from my iPhone

On 25 Aug 2018, at 16:07, jamesshao8 notifications@github.com wrote:

Yes maybe it's caused by the noise floor, which cannot be distinguished by direction anymore.

The mic I am using is designed by introlab. You can find them here: https://github.com/introlab/xSoundsMicrophones

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jamesshao8 commented 6 years ago

The mics are facing towards the target, so most of the time we put it vertically. We use 32bit in the hardware configuration but then decreased to 16 bit in pf data. We did that because it's easier to process the output by webrtc noise suppression algorithm.

taospartan commented 6 years ago

I know this will sound odd but try it horizontally, that’s what I do with the uma16. I have also used sox to increase the gain before the audio reaches odas. I can hear voices clearly just using odas pf doing this. Also see if the beamforming works in the sep stream, I use the spectrograph view in audacity to check

Sent from my iPad

On 25 Aug 2018, at 22:30, jamesshao8 notifications@github.com wrote:

The mics are facing towards the target, so most of the time we put it vertically. We use 32bit in the hardware configuration but then decreased to 16 bit in pf data. We did that because it's easier to process the output by webrtc noise suppression algorithm.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jamesshao8 commented 6 years ago

@taospartan I tried to place the mics horizontally, but unfortunately it's not getting better. However, that does reminds me of trying different shapes of mic array. I will try UCA with different diameters, or even a plane matrix.

taospartan commented 6 years ago

Good luck, the spacing may be a factor too

Sent from my iPhone

On 27 Aug 2018, at 14:39, jamesshao8 notifications@github.com wrote:

@taospartan I tried to place the mics horizontally, but unfortunately it's not getting better. However, that does reminds me of trying different shapes of mic array. I will try UCA with different diameters, or even a plane matrix.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.