question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add several sound sources, in a room with only one sound signal available

See original GitHub issue

I want to record sound in a room with multiple sound sources, but without attaching a specific signal from each source. Imagine if I were to place a microphone array into a room where I only know the locations of the sources, but not what sounds that individually emit. I only record all of the sounds combined.

From this, I want to generate a RIR. I want the final result to be a sound with no echo and no reverberant sounds before passing it on to the next algorithm.

Any advice?

Right now I am adding one source with one signal, then room.simulate() to get a better sound in return. `

room = pra.ShoeBox(room_dim, =fs, absorption=absorption, max_order=max_order)

# add source and set the signal to WAV file content. NB: SoundSource must ne np.array()
  room.add_source(soundSource3DLoc,
                signal=soundData_i)  # changed to Global var soundSource3DLoc

# add one-microphone 3D XYZ array add coordinates of every mic
room.add_microphone_array(pra.MicrophoneArray(room_mic_XYZ_locations,
                                              room.fs))
room.image_source_model(use_libroom=False)
"""gets the impulse response between mic and source"""
ir = room.compute_rir()
"""calculates the n samples before sound dissipates with 60 db"""
t60_samples = pra.experimental.measure_rt60(ir)
"""calculates the time in sec before sound dissipates with 60 db"""
t60_s = pra.experimental.measure_rt60(ir, fs=fs)
"""Then the target RT60 and the estimated RT60 match really well! Now I haven't made this change just yet because 
there are some caveats. First, I believe a in Sabine's formula relates to energy, while the reflection coefficient
 is in amplitude (hence the original computation for the reflection). This might mean that there is a problem with
  for example the estimation of the RT60 itself."""
# absorption, max_order = inv_sabine(t60=t60_s, room_dim=room_dim, c=speedOfSound) #

# visualize 3D polyhedron room and image sources
if visualizeRoom:
    fig, ax = room.plot(img_order=max_order)
    fig.set_size_inches(5, 2, forward=False)
    plt.show()
"""Moreover, we can plot the RIR for each microphone once the image sources have been computed."""
if visualizeRoom:
    plt.figure()
    room.plot_rir()
    fig = plt.gcf()
    fig.set_size_inches(5, 2, forward=False)
    plt.show()

"""Moreover, we can simulate our signal convolved with these impulse responses as such:"""
room.simulate(reference_mic=0)  # this method must be called to get access to filteredSound
"""returns the filtered sound"""
return room.mic_array.signals[0, 0:nFrames]  #`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
fakufakucommented, May 4, 2020

If you don’t know the reverb exactly, this is actually a fairly hard problem. You could try some blind dereverberation to reduce the length of the reverb. An implementation of a popular algorithm (WPE) is available here: https://github.com/fgnt/nara_wpe

If you have a multichannel recording (done with synced microphones), you can try using the bss package. This will not reduce the reverb but will separate different sources, assuming they do not move. If the sources are moving, this gets really hard.

1reaction
fakufakucommented, Apr 29, 2020

I think there is a misunderstanding. The ISM simulator does not remove echo or noise. Quite the opposite, it adds reverberation to a dry signal to simulate what happens in a real recording.

If you want to do some enhancement on recordings you have, you should look at the other modules in the package: denoise, bss, or beamforming. What example in the notebook are you referring to ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Combine Multiple Signals and Still maintain Total ...
Each sound source connects to the mixer by way of a plug (on the incoming wire) which fits into a jack on the...
Read more >
How to Power a Multi-room Music System - Crutchfield
The easiest way to get audio in three rooms with one receiver is to find a 9- or 11-channel receiver with powered speaker...
Read more >
BLEND together AUDIO Clips from Different Sources in ...
In a recent Edit, I had to blend together audio clips from two different sources so they sounded the same. After recording, I...
Read more >
Locating multiple sound sources from raw audio
Estimating the location of a sound source using only the audio captured by an array of microphones has been an active area of...
Read more >
Signals - Adding Decibels - The Engineering ToolBox
The logarithmic decibel scale is convenient when adding signal values like sound power, pressure and others from two or more sources.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found