Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time domain plots are too sparse #170

Open
hagenw opened this issue Jan 20, 2021 · 3 comments · May be fixed by #172
Open

Time domain plots are too sparse #170

hagenw opened this issue Jan 20, 2021 · 3 comments · May be fixed by #172

Comments

@hagenw
Copy link
Member

hagenw commented Jan 20, 2021

The example images in master are broken compared compared to v0.5.0.

E.g.

image

vs.

image

@fs446
Copy link
Member

fs446 commented Jan 20, 2021

I spent the day to figure out what happens here. I could not 100% trace it, but it seems that matplotlib rendering changed in the meantime between these two versions. One could figure out this exactly, however our SFS processing is not optimum anyway, so we should rather address this first. The problem is that by using a perfect Dirac impuls as excitation the synthesized sound field has very sharp transients and a lot of zeros (in dB we then get -Inf) and the rendering algorithms need somehow align these values to RGB. Success is then highly dependent on the sampling grid, amplitude, time instance and so on, which can be observed, when playing around with different configurations.

So, to solve the problem in the toolbox I would propose to use bandlimited Dirac impulse as excitation, see the branch
https://github.com/sfstoolbox/sfs-python/tree/doc_td_plot_routine
where a simple Kaiser-Bessel windowed FIR lowpass is used with some meaningful parameters for nice plots.

We might consider to write a signal generating function, e.g. create_bandlimited_dirac(number of samples, cut frequency, **kwargs) for user convenience.

Furthermore, I would propose to use the normalization of weights for the points sources, such that we get similar level than for the plane wave case. Normalization for focused source seems to be not correct yet.

@hagenw
Copy link
Member Author

hagenw commented Jan 21, 2021

Good point, I think we did something similar in Matlab and used a hanning window as Dirac impulse at some point, see https://github.com/sfstoolbox/sfs-matlab/blob/02194f0243d1ead26572f760032c40527718919d/SFS_time_domain/dirac_imp.m#L48-L53

@hagenw
Copy link
Member Author

hagenw commented Jan 21, 2021

So, to solve the problem in the toolbox I would propose to use bandlimited Dirac impulse as excitation, see the branch
https://github.com/sfstoolbox/sfs-python/tree/doc_td_plot_routine
where a simple Kaiser-Bessel windowed FIR lowpass is used with some meaningful parameters for nice plots.

Seems to work, for me locally the WFS plane wave plot from above now looks like this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants