MarineBioAcousticsRC / Triton

:whale: Scripps Whale Acoustics Lab :earth_americas: Scripps Acoustic Ecology Lab - Triton with remoras in development
Other
36 stars 25 forks source link

loading wav files in remora soundscape LTSA that are not HARP or SoundTrap #90

Open chuetz opened 2 years ago

chuetz commented 2 years ago

I'm having an issue with loading wav files that were not recorded by either HARP or SoundTrap devices. Is there any user defined format loading possibility?

sfregosi commented 1 year ago

Could you share a bit more information so we can try to troubleshoot.

What error messages are you getting? Is this issue happening when you are trying to create a soundscape LTSA? What is the format of the filenames that you are reading in? It is important the time stamp fits a certain format.

chuetz commented 1 year ago

Hi, Thank you very much for your answer. There was an issue with the last wav file in the folder selected for LTSA computation. I fixed it in a "dirty way" by adding some lines in the sm_calc_ltsa function (around line 175) : if (yi+nsamp) < info_audio.TotalSamples [dall,Fs] = audioread( fullfile(PARAMS.ltsa.indir,PARAMS.ltsa.fname(k,:)), [yi yi-1+nsamp], 'native' ); else [dall,Fs] = audioread( fullfile(PARAMS.ltsa.indir,PARAMS.ltsa.fname(k,:)), [yi info_audio.TotalSamples], 'native' ); warning('sm_calc_ltsa : ndays too long, reading up to the end of last wav file') end Any better idea? I also noticed that the plotted LTSA (just after computation) does not correspond to the one plotted when triton is restarted and remora>soundscape metric>load LTSA is executed. It plots the same image as if the LTSA computed with the remora soundscape is open with the triton control panel file>open LTSA. Any idea why? Finally: I tried to compute soundscape metrics with the remora, but the output CSV files only contain headers (no data inside). Again, I would appreciate any suggestion. Thank you very much in advance !

chuetz commented 1 year ago

sorry, I forgot to add the previous line of my code, just above the if: info_audio = audioinfo(fullfile(PARAMS.ltsa.indir,PARAMS.ltsa.fname(k,:)));

chuetz commented 1 year ago

And to answer your questions (sorry for the several messages):

What error messages are you getting? The error was with audioread trying to read too far in the last wav file

Is this issue happening when you are trying to create a soundscape LTSA? yes

What is the format of the filenames that you are reading in? It is important the time stamp fits a certain format. The files are wav files recorded from a home made device. The names fit the standards of the Soundtrap data (ex : "20220426_093500UTC_V00OS11.WAV"). Thanks again

sfregosi commented 1 year ago

Hi @chuetz

I think your 'dirty fix' for the initial audioread error shouldn't present any issues and thanks for pointing it out - it is likely a fix worth making permanent for others that are trying to create LTSAs for durations of wavs that are not a full day duration.

For your other two issues: Different visual display of LTSA following creation and opening it later: Could you upload a screenshot and also the .ltsa file here so I can look at them and try to see what is going on. I think that the plotting code for right after an LTSA is made is slightly different (but just in colormap display, not in the data displayed) than when one is opened using File>Open LTSA but I need to look into that more for the soundscape remora to confirm.

No soundscape metrics - if you upload the LTSA here I can take a closer look at it. Thanks, Selene

chuetz commented 1 year ago

Hi Selene,

Thank you for the quick answer!

Concerning the visual display, it looks like it is a bug when the computation just finished. When I close triton and reload the soundmetric LTSA using the remora, it's fine.

Concerning the metrics, it might very well be that I'm using the wrong parameters. I'm uploading the csv files and the log, but the ltsa cannot be uploaded here (file type not supported).

LTSA was computed using the remora, and the following parameters: -wav files have a 22050Hz sampling rate -PARAMS.ltsa.tave = 10; % averaging time [seconds] -PARAMS.ltsa.dfreq = 200; % frequency bin size [Hz] -PARAMS.ltsa.ndays = 1; % length of LTSA [days] -PARAMS.ltsa.nstart = 1; % start number of LTSA file (e.g. want to start at week 2)

Thank you very much in advance for your help!

ltsa_sm_PSD_mean_1h.csv

sfregosi commented 1 year ago

@chuetz just as an FYI I also have a wonky looking output when the soundscape LTSA is first computed, but then it looks fine when I load it. That is just a bug that needs to be resolved.

For what it's worth, the nice thing about the soundscape ltsa's is that you can make them just 1 day at a time, so you can look at really fine resolution (1 sec, 1 Hz) and then compute metrics on those fine resolution LTSAs. I typically use settings like 10 sec/200 Hz for creating just "regular" LTSAs that are used for manual analysis to find cetaceans, boat sounds, etc. and then the soundscape remora is specially set up do make these finer scale ltsas to look at noise trends (someone at MBARC, please chime in here if you all do something different, this is just from my experience!)

sbaumannpickering commented 1 year ago

Agreed, it seems like the trend goes toward computing 1s / 1 Hz resolution initial soundscape LTSAs (pretty large files!) and then reduce to whatever averaging scheme one may want in step 2. Simone

On Sep 27, 2022, at 9:19 PM, sfregosi @.***> wrote:

@chuetz https://urldefense.com/v3/__https://github.com/chuetz__;!!Mih3wA!GM61DaKQjgRdKErEU9bDiK3Zivopx3RDjK78OPKjMBTeOncwAN4xMvZuBrLjFMKhLjokMevB4zPCcl9dkcSQOnYj$ just as an FYI I also have a wonky looking output when the soundscape LTSA is first computed, but then it looks fine when I load it. That is just a bug that needs to be resolved.

For what it's worth, the nice thing about the soundscape ltsa's is that you can make them just 1 day at a time, so you can look at really fine resolution (1 sec, 1 Hz) and then compute metrics on those fine resolution LTSAs. I typically use settings like 10 sec/200 Hz for creating just "regular" LTSAs that are used for manual analysis to find cetaceans, boat sounds, etc. and then the soundscape remora is specially set up do make these finer scale ltsas to look at noise trends (someone at MBARC, please chime in here if you all do something different, this is just from my experience!)

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/MarineBioAcousticsRC/Triton/issues/90*issuecomment-1260366725__;Iw!!Mih3wA!GM61DaKQjgRdKErEU9bDiK3Zivopx3RDjK78OPKjMBTeOncwAN4xMvZuBrLjFMKhLjokMevB4zPCcl9dkWDDaVgb$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AIFJ574HM3MPS2O67S2INCLWAPBLLANCNFSM6AAAAAAQOMVFHQ__;!!Mih3wA!GM61DaKQjgRdKErEU9bDiK3Zivopx3RDjK78OPKjMBTeOncwAN4xMvZuBrLjFMKhLjokMevB4zPCcl9dkXwuXfv6$. You are receiving this because you are subscribed to this thread.