Skip to content

Commit

Permalink
Fixed a critical wfs_preequalization() bug.
Browse files Browse the repository at this point in the history
Before the filter does not work properly for ir_wfs(). Note that this bug was
newly introduced for the 1.0.0 version and worked fine in older versions
  • Loading branch information
hagenw committed Sep 11, 2013
1 parent db43df5 commit 46b2a02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 7 additions & 0 deletions SFS_time_domain/sound_field_imp_wfs.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
else
greens_function = 'ps';
end
usehpre = conf.wfs.usehpre;


%% ===== Computation =====================================================
Expand All @@ -96,6 +97,12 @@
x0 = secondary_source_tapering(x0,conf);
% Get driving signals
d = driving_function_imp_wfs(x0,xs,src,conf);
% Fix the time to account for sample offset of the pre-equalization filter
if usehpre
% add a time offset due to the filter (the filter has 128 coefficients,
% hence the offset is 64 samples)
t = t + 64;
end
% Calculate sound field
[varargout{1:min(nargout,4)}] = ...
sound_field_imp(X,Y,Z,x0,greens_function,d,t,conf);
Expand Down
3 changes: 0 additions & 3 deletions SFS_time_domain/wfs_preequalization.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@
hpre = wfs_fir_prefilter(conf);
% apply filter
ir = convolution(hpre,ir);
% remove time offset due to the filter (the filter has 128 coefficients,
% hence we can remove 64 samples at the beginning)
ir = ir(65:end,:);
elseif strcmp('IIR',hpretype)
% get IIR filter
hpre = wfs_iir_prefilter(conf);
Expand Down

0 comments on commit 46b2a02

Please sign in to comment.