-
Notifications
You must be signed in to change notification settings - Fork 349
Audio: TDFB: Track sound direction of arrival #4826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
First draft, needs a lot of cleanup and testing and optimization. It tracked in simulated 2mic acoustics in testbench quite well a 360 degree rotating sound source within -90 .. +90 deg that the 2D array can handle. |
87bbba2 to
5c0285a
Compare
5c0285a to
5d03612
Compare
|
I just pushed a version that "worked" correctly in a notebook device. I will next tune it to be more responsive, now only fairly loud sounds trigger angle update. Also I should change the enum scale for line array topologies for better precision. Alsatplg allows 16 different values and now 12 is used to cover 0-330 degrees. I could use 15 steps for -90..0..+90 with ~13 degrees precision. Or 13 steps with exactly 15 degrees step. |
Best to use integer step size for alsamixer rendering. |
Yep, my working version is using exact 15 degree step for line arrays now. I will share soon a testbench PR to enable testing of different input and output channels count in pipeline and improved TDFB test scripts. Then share the update to this PR. |
|
This PR needs #4941. I will meanwhile share related parts to this work (TDFB comp bug fixes, TDFB tool improvement, testbench improvement, TDFB test improvement). Also avoids huge single PR since I had to change plenty of things to be able to test this. This version with internal math functions remains [WIP]. |
|
@singalsu ok pls work with @ShriramShastry for #4941. Changes are localized so can be included for rc2 |
5d03612 to
4ca2747
Compare
|
@singalsu ready for review now ? |
tools/topology/topology1/m4/tdfb/coef_circular8_100mm_az0el0deg_16khz.m4
Outdated
Show resolved
Hide resolved
|
@lgirdwood I'm now testing this with PR #5034 . |
4ca2747 to
0f71036
Compare
|
New WIP draft with Sriram's sqrt() lib patch temporarily included. |
0f71036 to
f8dba81
Compare
src/audio/tdfb/tdfb.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the same as ((a + 180) % 360) - 180? Maybe the below can be similarly simplified too, but be careful with division remainder of negative numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that worked, and slightly different version for negative angles.
src/audio/tdfb/tdfb_direction.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpicking: how about
cd->direction.rp = cd->direction.d;
cd->direction.wp = cd->direction.d + ch_count * (cd->direction.max_lag + 1);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, this was a quick bug fix test that I forgot to clean up.
src/audio/tdfb/tdfb_direction.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could use goto for clean up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/audio/tdfb/tdfb_direction.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd->direction.trigger <<= 1;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
src/audio/tdfb/tdfb_direction.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something above makes me suspicious. If the first test ds2 < ds1 was true, 360 was subtracted from az. And now you add 360 back to az for another test? An else missing somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could be an else. The second squared error eval is unnecessary if the first 360 deg addition was done. The second test is false if first was true. One multiplication saved in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsigned int?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, changed!
cbf96c8 to
98a604f
Compare
310d25b to
aa32c9f
Compare
|
@cujomalainey good for you ? |
aa32c9f to
8c2432f
Compare
|
I just updated the emphasis IIR response from 2nd order 2 kHz high-pass to 1 - 4 kHz 4th order band-pass. It prevents highest frequencies to alias spatially and add error to angle. The lower high-pass picks up a bit more voice signal while still attenuates lowest frequencies those are usually noise. No other changes. |
|
@singalsu any updates ? |
8c2432f to
4851a52
Compare
The DF2T IIR core has been moved earlier to library but the helper functions for configuring it were left to EQ component. This patch eases use of IIR core from other components. The file src/audio/eq_iir/iir.c is moved to src/math. There are no changes except of remove iir.h since the contents specific for DF2T type were merged to iir_df2t.h Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds function cross_product_s16(). Cross product is commonly used function in computational geometry. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds sound direction estimation. TDFB component updates the sound direction control to user space. User space may control the beam direction towards the source with help of the reported angle. Sound direction estimation is based on cross correlation maximums pattern and match of theoretical propagation delays to measured pattern. Cross correlation search is triggered by short term level when it exceeds the estimated background noise level. An emphasis filter is used to filter out typical low frequency noise. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Comment text is added to tdfb.c to help find the settings generator shell script. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
4851a52 to
a6f06d0
Compare
|
I just added a commit that adds to tdfb.c a comment about settings generator script to help find it. No other changes done. |
|
@cujomalainey good for you ? |
This patch adds sound direction tracking. TDFB component updates
the sound direction control to user space. User space may control
the beam direction with help of this.
Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com