Coder Social home page Coder Social logo

Singular matrix error about pyroomacoustics HOT 15 CLOSED

lcav avatar lcav commented on August 23, 2024
Singular matrix error

from pyroomacoustics.

Comments (15)

fakufaku avatar fakufaku commented on August 23, 2024

Hi, it would be easier to help if you post the code that you are trying to run. I know that many of the algorithm require a small value of the noise variance to work, it acts as regularization and avoid the singular matrix problem. Without knowing what you are running, it is difficult to give better advice.

from pyroomacoustics.

pathasreedhar avatar pathasreedhar commented on August 23, 2024

Thanks for the prompt reply.. I am running doa_algorithms.py with PS3eye data. I recorded the signal in my office where there is a constant AC buzz and fellow colleagues were talking apart from 2 speakers who are intended. I think this acts fairly as noise, I also saw the wav files in audacity there is no absolute zero in it, and fair noise amount is present. It generally fails for FRIDA CSSM WAVES algo

from pyroomacoustics.

fakufaku avatar fakufaku commented on August 23, 2024

Hi, I see, so the error happens while running the doa ? I thought that happened during beamforming, hence my comment about the noise. Of course, noise will be present in natural signals, so that is normally not an issue.
Again, copy pasting the code would help a lot to debug. I know FRIDA sometimes pops some errors, but it normally does not affect the result too much. FRIDA can be sensitive to the choice of the subbands. You need to pick the subbands that match the inter-microphone spacing of your array. CSSM and WAVES are also not very robust in my experience and can be finicky to tune.

from pyroomacoustics.

fakufaku avatar fakufaku commented on August 23, 2024

With correct tuning, I'm pretty confident FRIDA should work as we have run it multiple time during live demoes and it was very robust, even in very noisy environment.

from pyroomacoustics.

pathasreedhar avatar pathasreedhar commented on August 23, 2024

Ok thank you can you point out me where to look for the parameters and what parameters for tuning FRIDA?

from pyroomacoustics.

fakufaku avatar fakufaku commented on August 23, 2024

Hi @pathasreedhar , here is the configuration I use in the example:
https://github.com/LCAV/pyroomacoustics/blob/master/examples/doa_algorithms.py#L63
in particular the fft_bins parameter should be set according to the array you are using.

from pyroomacoustics.

pathasreedhar avatar pathasreedhar commented on August 23, 2024

Thank you for pointing out. I would like to know whether this code works for any number of sources? because while i was trying for different number of sources many times it would give only 2 directions. i have sent the number of sources as parameter

from pyroomacoustics.

fakufaku avatar fakufaku commented on August 23, 2024

Hi @pathasreedhar , it is much easier to help if you paste the code that you are trying to run.
FRIDA might return less sources than desired if they can't be found reliably. How many sources are you looking for ?

from pyroomacoustics.

pathasreedhar avatar pathasreedhar commented on August 23, 2024

Hi, I am running doa_algorithms.py with few changes like

  1. my own wav files
  2. array R = np.array([[-0.03,0.0],[-0.01,0.0],[0.01,0.0],[0.03,0.0]]), R = R.T
  3. doa.locate_sources(X, num_src=num_src,freq_range=freq_range), where num_src = 3, freq_range = [2500.0,4500.0]
    I did only these changes and code gives singular matrix error for many algos and for MUSIC it gives only 2 sources. i tried many wav files but result is same like error and few sources.
    I would like to know why the output locations are symmetric in my condition?

from pyroomacoustics.

pathasreedhar avatar pathasreedhar commented on August 23, 2024

my wav files are sampled at 44100. Does it matter?

from pyroomacoustics.

jay-pee avatar jay-pee commented on August 23, 2024

I think the sample rate doesn't matter because with freq_range you later restrict the range which the DOA algorithm is working with.

I had also this issue quite often, when I tried it. I would suggest to introduce a diagonal loading before the inversion. You can find a little bit more to this topic here.

from pyroomacoustics.

pathasreedhar avatar pathasreedhar commented on August 23, 2024

ok thanks for input. I dont get 3 sources as output but when I give 4 sources as input the algo locates 4 sources. Why this weird thing happens despite of any other changes in code

from pyroomacoustics.

fakufaku avatar fakufaku commented on August 23, 2024

Hi @pathasreedhar ,

  1. You are using a linear array. At best you can locate the sources in a half-plane, that is you can find the azimuth up to a symmetry with respect to the axis of the array.
  2. You are operating in 3D space (by providing 3D coordinates).

I am not sure how FRIDA handles linear array. But MUSIC or SRP-PHAT should give you something at least. Both of them operate a grid search to find the most likely locations. You can solve the two above problems by:

  1. Reduce the dimensionality to 2D by providing 2D coordinates for your array
  2. You need to provide a list of candidate locations for the DOA. By default, the azimuth location are 0 to 359 in 1 degree increments. You should change this to 0 to 180 degrees. The relevant parameter is azimuth (see the doc here).
  3. You should try to plot the spatial spectrum to inspect it and check if you can see the three peaks corresponding to the sources.

Note that both SRP-PHAT and MUSIC work by estimating the spatial spectrum and then find num_src peaks in the estimated locations.

from pyroomacoustics.

pathasreedhar avatar pathasreedhar commented on August 23, 2024

Hi
sorry for delayed reply.. thanks for the help I was able to use this by tweaking azimuth parameter.

from pyroomacoustics.

fakufaku avatar fakufaku commented on August 23, 2024

Great!

from pyroomacoustics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.