Skip to content

Commit 22b11fa

Browse files
committed
Updated handling of progress_bar in freq_response_* functions
1 parent ccd0e36 commit 22b11fa

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

SFS_analysis/freq_response_nfchoa.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
%% ===== Configuration ==================================================
8080
% Plotting result
8181
useplot = conf.plot.useplot;
82+
% progress bar
83+
showprogress = conf.showprogress;
84+
% disable for sound field function
85+
conf.showprogress = false;
8286

8387

8488
%% ===== Computation ====================================================
@@ -92,6 +96,7 @@
9296
S = zeros(size(f));
9397
% Get the result for all frequencies
9498
for ii = 1:length(f)
99+
if showprogress, progress_bar(ii,length(f)); end
95100
D = driving_function_mono_nfchoa(x0,xs,src,f(ii),conf);
96101
% calculate sound field at the listener position
97102
P = sound_field_mono(X(1),X(2),X(3),x0,'ps',D,f(ii),conf);

SFS_analysis/freq_response_wfs.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
%% ===== Configuration ==================================================
8080
% Plotting result
8181
useplot = conf.plot.useplot;
82+
showprogress = conf.showprogress;
83+
% disable progress bar for sound field function
84+
conf.showprogress = false;
8285

8386

8487
%% ===== Computation ====================================================
@@ -94,6 +97,7 @@
9497
S = zeros(size(f));
9598
% Get the result for all frequencies
9699
for ii = 1:length(f)
100+
if showprogress, progress_bar(ii,length(f)); end
97101
D = driving_function_mono_wfs(x0,xs,src,f(ii),conf);
98102
% calculate sound field at the listener position
99103
P = sound_field_mono(X(1),X(2),X(3),x0,'ps',D,f(ii),conf);

0 commit comments

Comments
 (0)