MarineBioAcousticsRC/Triton

meaning of the "MIN. Seconds/Average"(in GUI) or REMORA.sm.cmpt.perc (in code) setting?

chuetz opened this issue · 1 comments

chuetz commented

Hi all,

Sorry in advance for this long post, but I'm trying to be as precise as possible...

I'm having some issues finding the correct settings to compute metrics with the soundscape metrics Remora.
More specifically with the "MIN. Seconds/Average" settings.

Here are the parameters I use to compute the LTSA :
PARAMS.ltsa.tave = 60; % averaging time [seconds]
PARAMS.ltsa.dfreq = 1; % frequency bin size [Hz]
PARAMS.ltsa.ndays = 16; % length of LTSA [days]
PARAMS.ltsa.nstart = 1; % start number of LTSA file (e.g. want to start at week 2)

% experiment defined (in WAV/XWAV file):
PARAMS.ltsa.fs = 22000; % sample rate [Hz]
PARAMS.ltsa.ftype = 1; % 1= WAVE, 2=XWAV
PARAMS.ltsa.dtype = 1; % 1 = HARP, 2 = ARP, 3 = OBS, 4 = towed array or sonobuoy, 5 = SoundTrap
PARAMS.ltsa.ch= 1; % channel to do ltsa on for multichannel wav files

And here are the parameters used for the metrics :
REMORA.sm.cmpt.ltsaout = 0; % yes/no for a new average LTSA output
REMORA.sm.cmpt.csvout = 1; % yes/no for a csv output
REMORA.sm.cmpt.fstart = 1; % LTSA file number to start with for calculation

%% Analysis Options
% Bandpass Edges
REMORA.sm.cmpt.lfreq = 20; % low frequency cut off (Hz)
REMORA.sm.cmpt.hfreq = 10000; % hight frequency cut off (Hz)

% Analysis Type
REMORA.sm.cmpt.bb= 0; % yes/no broadband level
REMORA.sm.cmpt.ol = 0; % yes/no octave level
REMORA.sm.cmpt.tol = 0; % yes/no third octave level
REMORA.sm.cmpt.psd = 1; % yes/no power spectral density

% Averaging
REMORA.sm.cmpt.avgt = 60; % bin size of time average in seconds
REMORA.sm.cmpt.avgf = 1; % bin size of frequency average in Hz
REMORA.sm.cmpt.perc = 0.01; % percentage of seconds with good data / time average
REMORA.sm.cmpt.mean = 1; % mean averaging type
REMORA.sm.cmpt.median = 0; % median averaging type
REMORA.sm.cmpt.prctile = 0; % percentiles averaging type

% Remove Erroneous Data
REMORA.sm.cmpt.fifo = 0; % yes/no remove fifo noise
REMORA.sm.cmpt.dw = 0; % yes/no remove disk writes in HARP data
REMORA.sm.cmpt.strum = 0; % yes/no remove flow or strumming noise

With the data I’m analyzing at the moment, anything else than 1 for the REMORA.sm.cmpt.perc parameter does not work, and the output says Time average NOT computed.

I tried to see where the problem comes from, and it appears that any other value than 1 puts the condition in line 85 of sm_cmpt_avgs.m

if (length(hidx) + length(REMORA.sm.cmpt.pre.timeavgs)) >= REMORA.sm.cmpt.avgt*REMORA.sm.cmpt.perc || last_avg == 1

being always false. Therefore, the program never goes into the sm_cmpt_writeout(tidx) line and therefore all outputs are empty.
The variable hidx is incremented by one at each loop turn and that timeavgs is always empty. Therefore length(hidx) + length(REMORA.sm.cmpt.pre.timeavgs)) is always 1 and never > REMORA.sm.cmpt.avgt*REMORA.sm.cmpt.perc except if REMORA.sm.cmpt.perc > 1/ REMORA.sm.cmpt.avgt, which, in my case is equal to 60 seconds.

With this parameter equals to 1% (ie REMORA.sm.cmpt.perc=0.01), it seems that all the averages are done correctly, without skiping LTSA data. Is that correct?
If so, what is the purpose of this parameter?

Thank you very much for any help on this issue!