jaakkopasanen / Impulcifer

Measurement and processing of binaural impulse responses for personalized surround virtualization on headphones.
MIT License
213 stars 14 forks source link

New error after the last update #41

Closed PhilHiTech closed 4 years ago

PhilHiTech commented 5 years ago

this error appears both in demo but also with my hrir Win10 x64, Python 3.7.5

(venv) C:\ProgramsPortable\Impulcifer>python impulcifer.py --test_signal=D:\I\Impulcifer_Data\sweep-6.15s-48000Hz-32bit-2.93Hz-24000Hz.pkl --room_mic_calibration=D:\I\Impulcifer_Data\demo\room-mic-calibration.txt --room_target=D:\I\Impulcifer_Data\harman-room-target.csv --dir_path=D:\I\Impulcifer_Data\demo --plot

Traceback (most recent call last): File "impulcifer.py", line 494, in <module> main(**create_cli()) File "impulcifer.py", line 94, in main plot=plot File "impulcifer.py", line 223, in correct_room fr.raw -= room_mic_calibration.raw AttributeError: 'str' object has no attribute 'raw'

jaakkopasanen commented 5 years ago

Thanks a lot for reporting. It's fixed now. Could you test and close the issue if it has been solved for you?

PhilHiTech commented 5 years ago

Many thanks! No more errors appear, but when I process my recordings, the left speaker post plots show a null amplitude, unlike the results shown for the demo recording...

Why? ... should I redo the recordings? What do you think about it?

jaakkopasanen commented 5 years ago

Hmm, interesting. Could you share the plots or the whole recording folder here with me so I can take a look? You can simply drag and drop files to the comment field and Github will handle it.

PhilHiTech commented 5 years ago

plots.zip I recorded the room files with this setting: --channels = 1 ... could this be the reason for plots with zero amplitude?

PhilHiTech commented 5 years ago

My Scarlett 2i2 always records two channels, so I have to use the setting --channels = 1 ...

jaakkopasanen commented 5 years ago

The pre and room plots look correct but the post plots definitely have that -40 dB for left side. Can't really say more from the plots. I would guess this is a glitch.

Please share the all the recordings and mic calibration files too and I'll try debug this.

PhilHiTech commented 5 years ago

Thank you very much for your availability!

PhilHiTech commented 5 years ago

I realized now that they are -30 dB amplitude for the demo hrir.wav and also for my hrir.wav...

jaakkopasanen commented 4 years ago

So the level difference problem exists in the demo files and results as well? I don't have this myself and I use the demo results myself as my daily driver so the channel balance in those is definitely correct. Could you share the generated demo plots? Also could you share your recording files so I could try to run Impulcifer on those?

PhilHiTech commented 4 years ago

demo_hrir.zip DaytonEmm6_Cal.txt my_hrir-recordings.7z

PhilHiTech commented 4 years ago

my-hrir_plots.zip my_hrir.7z

jaakkopasanen commented 4 years ago

demo_hrir.zip contains HRIR WAV file while I need the demo plots. Actually it would be better if you shared the whole demo folder with all the results and plots.

jaakkopasanen commented 4 years ago

I tried running Impulcifer with your recordings but it seems the recordings are 96 kHz. Did you actually measure them at 96 kHz? If so could you also share the test signal WAV or PKL file with me?

PhilHiTech commented 4 years ago

Yes, I recorded at 96 KHz. sweep-seg-96k.7z

PhilHiTech commented 4 years ago

demo_plots.7z demo_hrir-results.7z

PhilHiTech commented 4 years ago

The demo's working now, but there's 24dB of headroom...

jaakkopasanen commented 4 years ago

Demo plots look about right. Do you have the hesuvi.wav available, I'd like to confirm the results by listening to it?

Where did you get the 24 dB from?

PhilHiTech commented 4 years ago

I got the value from Audacity

jaakkopasanen commented 4 years ago

I ran your recordings. I get a bit over 4 dB of headroom. Channel balance is good.

I'm not sure why the peak isn't at 0 dB. I've never done 96 kHz recordings before. Could be related to that.

jaakkopasanen commented 4 years ago

You shouldn't look at the values of the impulse responses. They don't tell the truth about headroom. Having a reverberation tail in the impulse response increases the total loudness and can even increase it past 0 dB. The real headroom must be read from FFT when all left side IRs have been summed together (and right side IRs together). It's the peak value of the summed FFT.

PhilHiTech commented 4 years ago

Okay, my mistake... I thought we should just consider this: Audacity

jaakkopasanen commented 4 years ago

I solved the 4 dB headroom mystery. Resampling impulse response to a different sampling rate (from 96 kHz to 48 kHz in this case) changes the headroom. I just added another normalization in Impulcifer to be done after resampling if resampling is used. This fixed the problem.

Have all issues been solved now for you? If so, could you close this ticket.

PhilHiTech commented 4 years ago

I ran your recordings. I get a bit over 4 dB of headroom. Channel balance is good.

I'm not sure why the peak isn't at 0 dB. I've never done 96 kHz recordings before. Could be related to that.

OK... mmmh... boh! The plots I sent you, as you can see, show that there is actually an imbalance between the two channels, so the only way to correct this problem is to use channel-balance mids. The point is that I'm getting a different result from yours, and I can't understand why.

PhilHiTech commented 4 years ago

I solved the 4 dB headroom mystery. Resampling impulse response to a different sampling rate (from 96 kHz to 48 kHz in this case) changes the headroom. I just added another normalization in Impulcifer to be done after resampling if resampling is used. This fixed the problem.

Have all issues been solved now for you? If so, could you close this ticket.

OK! ... I'm gonna try hrirs again.

jaakkopasanen commented 4 years ago

I do get minor channel balance problems with demo recording. I just use --channel_balance=trend which fixes it. This is one of the greatest mysteries I'm facing with Impulcifer because in theory this should not be needed but yet it is. I've spent quite a lot of time trying to figure out the reason for it but have not solved it yet. Some users are not experiencing the problem at all. I made HRIR measurement for my friend a while ago and those results have channel balance bang on.

PhilHiTech commented 4 years ago

In fact I tried different channel-balance settings on different recordings, and the only one that always worked was --channel_balance=mids

jaakkopasanen commented 4 years ago

Hmm, okay. They're all pretty wild heuristic solutions so I cannot guarantee them working perfectly every time. That's why there are options.

PhilHiTech commented 4 years ago

results now the plots are fine thanks!

jaakkopasanen commented 4 years ago

Great! Thanks for your cooperation.