Recording Impulse Responses for Speaker Virtualization
Aug 1, 2020 at 8:45 AM Post #376 of 1,817
I want to apply 'room correction'. but it happens error.
Code:
Traceback (most recent call last):
  File "impulcifer.py", line 513, in <module>
    main(**create_cli())
  File "impulcifer.py", line 59, in main
    plot=plot
  File "C:\Users\JHJ\Impulcifer\room_correction.py", line 83, in room_correction
    fr = ir.frequency_response()
  File "C:\Users\JHJ\Impulcifer\impulse_response.py", line 190, in frequency_response
    fr = FrequencyResponse(name='Frequency response', frequency=f[1::step], raw=m[1::step])
ValueError: slice step cannot be zero

in frequency_response() function, 'step' value has 0.
because, len(f) = 4800, n = 6000 (aka self.fs = 48000)
and len(self.data) is 9600.

which part is problem??
 
Aug 1, 2020 at 11:07 AM Post #377 of 1,817
Lo and behold, the decay time management is here!

Impulcifer has a new parameter called --decay which gives you the power of adjusting the decay time of the binaural room impulse responses. This new method works on the basis of target levels, instead of the adjustment magnitude, so you should be able to achieve consistent decay times for all of your BRIRs without knowing the natural decay times in advance. Proper decay time detection algorithms needed to be implemented for this and it was a quite a bit of more work than I anticipated. But now the added benefit is that the RT20, RT30 or RT60 time in the README is the correct one as is the peak to noise ratio. The largest decay time available is used.

Use the new tool with eg. --decay=300 and the result BRIR will have a RT60 time of 300 ms. Or actually it might not be the real RT60 time if the impulse response doesn't have good enough signal to noise ratio but in these cases the 60 dB decay time is calculted with RT20 or RT30. Separate values for individual speakers are also possible, like previously: --decay=FL:400,FC:200,FR:400,SL:300,BL:300,BR:300,SR:300. Decay time cannot be adjusted upwards with this tool since I thought it wouldn't make any sense.

The new feature is not in master branch yet so if you'd like to try it out, switch to reverb-management branch:
Code:
git checkout reverb-management

Any feedback is most welcome!

Here's a debug graph from the decay tail. It's not possible to generate these yourself.
Fm0BBfb.png
 
Aug 1, 2020 at 11:13 AM Post #378 of 1,817
I want to apply 'room correction'. but it happens error.
Code:
Traceback (most recent call last):
  File "impulcifer.py", line 513, in <module>
    main(**create_cli())
  File "impulcifer.py", line 59, in main
    plot=plot
  File "C:\Users\JHJ\Impulcifer\room_correction.py", line 83, in room_correction
    fr = ir.frequency_response()
  File "C:\Users\JHJ\Impulcifer\impulse_response.py", line 190, in frequency_response
    fr = FrequencyResponse(name='Frequency response', frequency=f[1::step], raw=m[1::step])
ValueError: slice step cannot be zero

in frequency_response() function, 'step' value has 0.
because, len(f) = 4800, n = 6000 (aka self.fs = 48000)
and len(self.data) is 9600.

which part is problem??
That would sound like your room impulse response is only 4800 samples long ie. 100 ms. How did you manage this? Are you recording in an anechoic chamber perhaps? That or your room measurement might be corrupted somehow. I would need to have your measurement files to say more. Could you share them with me?
 
Aug 1, 2020 at 11:56 AM Post #379 of 1,817
That would sound like your room impulse response is only 4800 samples long ie. 100 ms. How did you manage this? Are you recording in an anechoic chamber perhaps? That or your room measurement might be corrupted somehow. I would need to have your measurement files to say more. Could you share them with me?

https://drive.google.com/file/d/1AHp6Kh9nwnN7nGvBzDRNCnqYrSDnbIeX/view?usp=sharing
(It will not share after 3 days...)

I made room-FL,FR-left,right.wave file from Audacity using 1 channel export. Should I use another method?
 
Aug 2, 2020 at 12:20 AM Post #380 of 1,817
Amazing! Going to test/play now.

You need to run

Code:
git fetch

To get the reverb branch before you can switch.

Just tried it and went back and forth with my BRIR's. Corrects the bass ringing I have with my real room which is in my BRIR's and unlike the flat --reverb flag I used before the BRIR still feels natural and not more in your head.

I suspect for those situations I used to get when recording only one speaker where you could actually hear (virtual) channel bleed on channel ID checks, it'll completely fix those.

As usual man, amazing work.
 
Last edited:
Aug 2, 2020 at 4:05 AM Post #381 of 1,817
https://drive.google.com/file/d/1AHp6Kh9nwnN7nGvBzDRNCnqYrSDnbIeX/view?usp=sharing
(It will not share after 3 days...)

I made room-FL,FR-left,right.wave file from Audacity using 1 channel export. Should I use another method?
Thanks. I debugged this a bit but actually got some other errros than what you reported, at first. My problems was caused by a bug which I found and fixed. I'm using branch reverb-management which is going to be merged to the master branch soonish so I'm not eager to spend a lot of time debugging and fixing the master branch at this point.

Your measurements are looking quite odd. There is a massive amount of harmonic distortion in all of your measurements. Impulcifer's algorithms aren't necessarily robust with this level of THD. What kind of speakers are you using for the purpose? How about microphones and other components of the recording chain?

Here are the plots: https://imgur.com/a/smhBuTv

For an example FL-left measurement graphs look like this:
svnx44E.png


While my own measurements look like this:
qwIYCV4.png


For some reason your decay graph shows 10 dB bump after the initial (fundamental) impulse has already decayed. Also the third harmonic impulse is just under -10 dB while my own has the highest harmonic at under -50 dB. Also the spectrogram graph for you measurements looks like nothing I've seen before. Your room measurement graphs actually looked a lot better although they do have the crazy spectrogram behaviour.

Another problem is that in this case the decay time detection algorithm fails with one of the impulse responses resulting in a very long BRIR file. My demo hesuvi.wav is less than 2 MB while the hesuvi.wav generated from your measurements is over 13 MB. This doesn't mean it wouldn't work but will introduce unnecessary CPU load, which might or might not be noticeable on your machine. The noise tail can always be cropped out in Audacity if that seems necessary.

All this doesn't necessarily mean that you wouldn't get results out of it that don't sound good or at least create the illusion of speakers. Especially the harmonic distortion is (in theory) negated entirely by Impulcifer as long as it doesn't mess up too badly with the different heuristic algorithms I'm using there.

Try out the reverb-management branch:
Code:
git fetch
git checkout reverb-management
git pull
 
Aug 2, 2020 at 5:28 AM Post #382 of 1,817
Thanks. I debugged this a bit but actually got some other errros than what you reported, at first. My problems was caused by a bug which I found and fixed. I'm using branch reverb-management which is going to be merged to the master branch soonish so I'm not eager to spend a lot of time debugging and fixing the master branch at this point.

Your measurements are looking quite odd. There is a massive amount of harmonic distortion in all of your measurements. Impulcifer's algorithms aren't necessarily robust with this level of THD. What kind of speakers are you using for the purpose? How about microphones and other components of the recording chain?

Here are the plots: https://imgur.com/a/smhBuTv

For an example FL-left measurement graphs look like this:
svnx44E.png


While my own measurements look like this:
qwIYCV4.png


For some reason your decay graph shows 10 dB bump after the initial (fundamental) impulse has already decayed. Also the third harmonic impulse is just under -10 dB while my own has the highest harmonic at under -50 dB. Also the spectrogram graph for you measurements looks like nothing I've seen before. Your room measurement graphs actually looked a lot better although they do have the crazy spectrogram behaviour.

Another problem is that in this case the decay time detection algorithm fails with one of the impulse responses resulting in a very long BRIR file. My demo hesuvi.wav is less than 2 MB while the hesuvi.wav generated from your measurements is over 13 MB. This doesn't mean it wouldn't work but will introduce unnecessary CPU load, which might or might not be noticeable on your machine. The noise tail can always be cropped out in Audacity if that seems necessary.

All this doesn't necessarily mean that you wouldn't get results out of it that don't sound good or at least create the illusion of speakers. Especially the harmonic distortion is (in theory) negated entirely by Impulcifer as long as it doesn't mess up too badly with the different heuristic algorithms I'm using there.

Try out the reverb-management branch:
Code:
git fetch
git checkout reverb-management
git pull

Thanks for your replay.
How did you make plot? I cannot check the plot.
I already reported https://github.com/jaakkopasanen/Impulcifer/issues/51.

I used parametes like this.
"python impulcifer.py --test_signal="data/sweep-6.15s-48000Hz-32bit-2.93Hz-24000Hz.pkl" --dir_path="data/my_hrir" --no_room_correction --channel_balance=mids --plot"
Without '--plot' option, impulcifer.py is working good.

Here is My sound environment :
Speaker : creative sxfi (2 speaker mode) - Bose C20
Headphone : Topping D50s - JDS atom amp - Audeze LCD-gx
Mic : SP-TFB-2 with XLR, umik-1

and I measureed my speakers with REW (usind umik-1)
bose_c20.png

decay.png

There are some booming at 200hz in SPL, but It doesn't bother me much. so I didn`t EQ.
Is there something odd?

And I have a question about measurement for room correction.
When I measure with umik-1, am I sitting on chair or is there only mic?
I am a little confused.
 
Last edited:
Aug 2, 2020 at 6:31 AM Post #384 of 1,817
Thanks for your replay.
How did you make plot? I cannot check the plot.
I already reported https://github.com/jaakkopasanen/Impulcifer/issues/51.

I used parametes like this.
"python impulcifer.py --test_signal="data/sweep-6.15s-48000Hz-32bit-2.93Hz-24000Hz.pkl" --dir_path="data/my_hrir" --no_room_correction --channel_balance=mids --plot"
Without '--plot' option, impulcifer.py is working good.

Here is My sound environment :
Speaker : creative sxfi (2 speaker mode) - Bose C20
Headphone : Topping D50s - JDS atom amp - Audeze LCD-gx
Mic : SP-TFB-2 with XLR, umik-1

and I measureed my speakers with REW (usind umik-1)


There are some booming at 200hz in SPL, but It doesn't bother me much. so I didn`t EQ.
Is there something odd?

And I have a question about measurement for room correction.
When I measure with umik-1, am I sitting on chair or is there only mic?
I am a little confused.
Is it the Creative SXFI carrier sound bar that you're using?

When you do room measurements, there should only be the microphone in the listening position and you should be somewhere else yourself. --plot is the parameter which makes Impulcifer generate the graphs but since that's not working for you at the moment, you cannot obviously use it.

Try out the reverb-management branch if you didn't already and tell me if the problem persists.
 
Last edited:
Aug 2, 2020 at 7:25 AM Post #385 of 1,817
Is it the Creative SXFI carrier sound bar that you're using?

When you do room measurements, there should only be the microphone in the listening position and you should be somewhere else yourself. --plot is the parameter which makes Impulcifer generate the graphs but since that's not working for you at the moment, you cannot obviously use it.

Try out the reverb-management branch if you didn't already and tell me if the problem persists.

I am using 'sxfi amp'. I use only bose speaker.
 
Aug 2, 2020 at 11:00 AM Post #386 of 1,817
Is it the Creative SXFI carrier sound bar that you're using?

When you do room measurements, there should only be the microphone in the listening position and you should be somewhere else yourself. --plot is the parameter which makes Impulcifer generate the graphs but since that's not working for you at the moment, you cannot obviously use it.

Try out the reverb-management branch if you didn't already and tell me if the problem persists.

I changed branch. but same result.

Code:
C:\Users\JHJ\Impulcifer>venv\Scripts\activate

(venv) C:\Users\JHJ\Impulcifer>git checkout reverb-management
Switched to a new branch 'reverb-management'
Branch 'reverb-management' set up to track remote branch 'reverb-management' from 'origin'.

(venv) C:\Users\JHJ\Impulcifer>git pull
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 3 (delta 2), pack-reused 0
Unpacking objects: 100% (3/3), 472 bytes | 42.00 KiB/s, done.
From https://github.com/jaakkopasanen/Impulcifer
   8e83bf3..e94f364  reverb-management -> origin/reverb-management
Updating 8e83bf3..e94f364
Fast-forward
 hrir.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
 
 (venv) C:\Users\JHJ\Impulcifer>python impulcifer.py --test_signal="data/sweep-6.15s-48000Hz-32bit-2.93Hz-24000Hz.pkl" --dir_path="data/my_hrir" --no_room_correction --channel_balance=mids --plot
Creating impulse response estimator...
Running headphone compensation...
Creating headphone equalization...
Creating frequency response target...
Opening binaural measurements...
Plotting BRIR graphs before processing...
Cropping impulse responses...
Equalizing...
 ** On entry to DLASCLS parameter number  4 had an illegal value
 ** On entry to DLASCLS parameter number  4 had an illegal value
Traceback (most recent call last):
  File "impulcifer.py", line 556, in <module>
    main(**create_cli())
  File "impulcifer.py", line 131, in main
    fr.smoothen_heavy_light()
  File "C:\Users\JHJ\Impulcifer\venv\lib\site-packages\autoeq\frequency_response.py", line 1240, in smoothen_heavy_light
    treble_iterations=1
  File "C:\Users\JHJ\Impulcifer\venv\lib\site-packages\autoeq\frequency_response.py", line 1197, in smoothen_fractional_octave
    treble_f_upper=treble_f_upper
  File "C:\Users\JHJ\Impulcifer\venv\lib\site-packages\autoeq\frequency_response.py", line 1155, in _smoothen_fractional_octave
    y_normal = savgol_filter(y_normal, self._window_size(window_size), 2)
  File "C:\Users\JHJ\Impulcifer\venv\lib\site-packages\scipy\signal\_savitzky_golay.py", line 337, in savgol_filter
    coeffs = savgol_coeffs(window_length, polyorder, deriv=deriv, delta=delta)
  File "C:\Users\JHJ\Impulcifer\venv\lib\site-packages\scipy\signal\_savitzky_golay.py", line 139, in savgol_coeffs
    coeffs, _, _, _ = lstsq(A, y)
  File "C:\Users\JHJ\Impulcifer\venv\lib\site-packages\scipy\linalg\basic.py", line 1218, in lstsq
    raise LinAlgError("SVD did not converge in Linear Least Squares")
numpy.linalg.LinAlgError: SVD did not converge in Linear Least Squares
 
Aug 3, 2020 at 8:28 AM Post #390 of 1,817

Users who are viewing this thread

Back
Top