sfstoolbox / sfs-matlab

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

fix incorporation of tapering weights for LWFS #138

Closed fietew closed 7 years ago

fietew commented 7 years ago

As x0s(:,7) also contains the integration weight of the secondary source, the influence of the tapering has to be computed by normalising the result to the original integration weight.

hagenw commented 7 years ago

Has this also to be considered in SFS_monochromatic/driving_function_mono_localwfs.m?

fietew commented 7 years ago

It is already considered by https://github.com/sfstoolbox/sfs-matlab/blob/2bbd541d3aa1783a7b5273339b316e3638096d9f/SFS_monochromatic/driving_functions_mono/driving_function_mono_wfs_vss.m#L89.

hagenw commented 7 years ago

If you would like to use only the tapering weights and exclude the integration weights you might also considering to use tapering_window() instead of secondary_source_tapering(). This is actual used in the latter, have a look.

For the time domain the code would then look like this:

wtap = tapering_window(x0s,conf);

and you can remove the x0tmp = secondary_source_tapering(x0s,conf); line.

For the frequencz domain you could change it to

wtap = secondary_source_tapering(xtmp,conf);
Dmatrix(xdx,idx) = driving_function_mono_wfs(xtmp,xv(idx,1:3),'fs',f,conf) .* wtap;

and remove the x0(:,7) = 1; line. In my opinion the result would be easier to understand.

fietew commented 7 years ago

Ah, cool. I will change both functions.