sfstoolbox / sfs-matlab

SFS Toolbox for Matlab/Octave
https://sfs-matlab.readthedocs.io
MIT License
97 stars 39 forks source link

Update usage of bandpass in sound_field_imp() #119

Closed hagenw closed 7 years ago

hagenw commented 7 years ago

This is a follow up of #113.

At the moment we have the default config setting:

conf.usebandpass = true;
conf.bandpassflow = 10;
conf.bandpassfhigh = 20000;

This setting results in an execution of the following line inside sound_field_imp():

d = bandpass(d,bandpassflow,bandpassfhigh,conf);

in bandpass() the function fir2() is used to create the filter and applied by convolution().

sound_field_imp() is the only place where the bandpass filtering is applied at the moment.

This pull request should figure out, why we have enabled the bandpass filtering as the default setting and if we can disable as default or even remove it.

hagenw commented 7 years ago

If we simulate an impulse response at a single listening position, as for example done by time_response_wfs() the bandpass filtering results in a reduced amplitude as shown in #113.

Here, I do sound field simulations in the time domain for WFS and NFC-HOA with and without bandpass filtering.

WFS

conf = SFS_config;
conf.plot.usedb = true;
conf.usebandpass = true;
sound_field_imp_wfs([-2 2],[-2 2],0,[0 2.5 0],'ps',200,conf)
conf.usebandpass = false;
sound_field_imp_wfs([-2 2],[-2 2],0,[0 2.5 0],'ps',200,conf)

wfs_w_bandpass wfs_wo_bandpass

NFC-HOA

conf = SFS_config;
conf.plot.usedb = true;
conf.usebandpass = true;
sound_field_imp_nfchoa([-2 2],[-2 2],0,[0 2.5 0],'ps',200,conf)
conf.usebandpass = false;
sound_field_imp_nfchoa([-2 2],[-2 2],0,[0 2.5 0],'ps',200,conf)

nfchoa_w_bandpass nfchoa_wo_bandpass

Looking at both results I would say that both looks better without the bandpass filtering.

@fietew: do you have an idea for an example that might look better with bandpass filtering? @spors: if I remember the bandpass filtering was included from the beginning in the time-domain scripts, could you comment on the idea behind it

hagenw commented 7 years ago

@fietew: would it be ok with you, if I change the default value of conf.usebandpass to false?

fietew commented 7 years ago

Is it used somewhere else appart from the time-domain sound field computation?

hagenw commented 7 years ago

No.

fietew commented 7 years ago

I will have a quick chat with @spors, whether we are missing any benefit of using the bandpass filtering. I don't see any.

hagenw commented 7 years ago

Ok, thanks.

fietew commented 7 years ago

One meaningful application could be, that the user wants to simulate the sound field using an bandlimited impulse ranging e.g. from 0 to 1 kHz instead of a fullband impulse. However, switching the default of conf.usebandpass to false makes sense imho.