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

Return wfs delay #62

Merged
merged 4 commits into from
Feb 17, 2016
Merged

Return wfs delay #62

merged 4 commits into from
Feb 17, 2016

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Feb 5, 2016

This is a follow up on #59.

The main goal was fomulated by @fietew as:

Imho, it would be easier to return the pre-delay which has been added to the driving function by a particular processing step, e.g. fractional delay, wfs prefilter, focused source, plane wave, etc..
Furthermore, I would prefer that t=0 corresponds to the t=0 of the virtual source, i.e. where the sound "starts" to radiate from a point/focused source or when the plane wave passed its point of zero phase.

In order to achieve this I did the following things:

  1. Add an additional prefilter_delay return parameter to wfs_preequalization(), which returns the delay that is added by the applied pre-filter.
  2. Add an additional delay_offset return parameter to driving_function_imp_wfs(). In the case of conf.removedelay=1 it returns prefilter_delay. In the case of conf.wfs.removedelay=0 it returns secondary_source_diameter(conf)/c + prefilter_delay
  3. I used this directly in sound_field_imp_wfs():
[d,~,~,delay_offset] = driving_function_imp_wfs(x0,xs,src,conf);
t = t + delay_offset*fs;

Result
That means if you use sound_field_imp_wfs() with conf.wfs.removedelay=1 you will have the first activity at the secondary sources for t = 0. With conf.wfs.removedelay=0 you will have the first activity of the virtual sources for t = 0.

Example

conf = SFS_config;
conf.wfs.removedelay = 1;
conf.plot.usedb = 1;
sound_field_imp_wfs([-2 2],[-2 2],0,[0 0.5 0 0 -1 0],'fs',0,conf)

wfs_fs_removedelay1

conf = SFS_config;
conf.wfs.removedelay = 0;
conf.plot.usedb = 1;
sound_field_imp_wfs([-2 2],[-2 2],0,[0 0.5 0 0 -1 0],'fs',0,conf)

wfs_fs_removedelay0

Open questions

  • @fietew : as you can see I have only added the return value to the driving function, not to the delayline etc. Could you maybe add it to the other functions?
  • @trettberg : I have added a return value also for the IIR filter with delay = conf.wfs.hpreIIRorder/2 / fs; I guess this is not correct, could you please correct it.

hagenw and others added 4 commits February 5, 2016 08:56
This is directly used in sound_field_imp_wfs() to ensure:
In the case of conf.wfs.removedelay=1:
        t=0: first activity of secondary sources
In the case of conf.wfs.removedelay=0:
        t=0: first activity of virtual source
@trettberg
Copy link
Contributor

I have added a return value also for the IIR filter
I think it's best to return a delay of zero, instead of something like maximum group delay.

btw: The IIR case in wfs_preequalization had some issues. It should hopefully work now.

@fietew
Copy link
Member

fietew commented Feb 17, 2016

As the new version of the delayline is still under construction (see #50) I would prefer to add the delay_offset return value to this function after the merge of the new delayline.

@hagenw
Copy link
Member Author

hagenw commented Feb 17, 2016

OK, I have created #64 in order to not forget it and will merge this pull request in the meantime.

hagenw added a commit that referenced this pull request Feb 17, 2016
@hagenw hagenw merged commit ebb11a8 into master Feb 17, 2016
@hagenw hagenw deleted the return_wfs_delay branch February 17, 2016 14:22
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 this pull request may close these issues.

None yet

3 participants