Skip to content

Commit b866b03

Browse files
committed
update call to cleanBEM
1 parent c7b9723 commit b866b03

2 files changed

Lines changed: 30 additions & 14 deletions

File tree

OWC/OrificeModel/hydroData/bemio.m

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
11
%% OWC - WAMIT GBM simulation
2+
%% Define the despiking structure
3+
despike = struct();
4+
despike.negThresh = 1e-3; % the threshold below which negative damping will be removed
5+
despike.N = 5; % will loop the despiking procedure N time before filtering
6+
despike.appFilt = 1; % boolean, 1 to apply low pass filter after despiking
27

3-
%% Run BEMIO for WAMIT Run and despike the hydro data
4-
% 1) load deSpike.mat, to create structure depSpike in workspace.
5-
% 2) call >> outHydro=badBemioFix_fcn({'test17a.out'},'WAMIT',deSpike,[1,1;3,3;5,5;7,7])
6-
% This will despike the resonance associated with the OWC moonpool and generate an h5
7-
% file with the _clean suffix.
8+
% thresholds: applied to 'Threshold' argument of findpeaks
9+
despike.B.Threshold = 2e-4; % damping
10+
despike.A.Threshold = 1e-3; % added mass
11+
despike.ExRe.Threshold = 1e-3; % real part excitation
12+
despike.ExIm.Threshold = 1e-3; % imag part excitation
813

14+
% minimum peak prominence, applied to 'MinPeakProminence' argument of findpeaks
15+
despike.B.Prominence = 2e-4;
16+
despike.A.Prominence = 1e-3;
17+
despike.ExRe.Prominence = 1e-3;
18+
despike.ExIm.Prominence = 1e-3;
919

10-
% outHydro = cleanBEM({'test17a.out'},'WAMIT',deSpike,[1,1;3,3;5,5;7,7]);
11-
% writeBEMIOH5(outHydro);
20+
% minimum peak distance, applied to 'MinPeakDistance' argument of findpeaks
21+
despike.A.MinPeakDistance = 3;
22+
despike.B.MinPeakDistance = 3;
23+
despike.ExRe.MinPeakDistance = 3;
24+
despike.ExIm.MinPeakDistance = 3;
1225

13-
%% Run BEMIO for WAMIT Run
14-
% 1) load deSpike.mat, to create structure depSpike in workspace.
15-
% 2) call cleanBEM to despike the resonance associated with the OWC
16-
% moonpool and generate an h5 file with the _clean suffix.
26+
% the b and a inputs to MATLAB's filtfilt(b,a,x) function
27+
despike.Filter.b = 0.02008336556421123561544384017452102853 .* [1 2 1];
28+
despike.Filter.a = [1 -1.561018075800718163392843962355982512236 0.641351538057563175243558362126350402832];
1729

18-
load deSpike.mat
30+
%% Read and clean WAMIT results
1931
hydro = struct();
2032
hydro = readWAMIT(hydro,'test17a.out',[]);
21-
hydro = cleanBEM(hydro, deSpike);
33+
hydro = cleanBEM(hydro,despike);
34+
hydro.file = 'test17a_clean';
35+
2236
hydro = radiationIRF(hydro,20,[],[],[],11);
2337
hydro = radiationIRFSS(hydro,20,[]);
2438
hydro = excitationIRF(hydro,20,[],[],[],11);
39+
2540
hydro.plotDofs = [1,1;3,3;5,5;7,7];
41+
% plotBEMIO(hydro);
42+
2643
writeBEMIOH5(hydro);
27-
% plotBEMIO(hydro);
-476 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)