Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chuetz opened this issue Sep 16, 2022 · 8 comments
Open

Comments

@chuetz
Copy link

chuetz commented Sep 16, 2022

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
Copy link
Contributor

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
Copy link
Author

chuetz commented Sep 22, 2022

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
Copy link
Author

chuetz commented Sep 22, 2022

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
Copy link
Author

chuetz commented Sep 22, 2022

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
Copy link
Contributor

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
Copy link
Author

chuetz commented Sep 23, 2022

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](https://github.com/M
logfile.txt
arineBioAcousticsRC/Triton/files/9633124/ltsa_sm_PSD_mean_1h.csv)

@sfregosi
Copy link
Contributor

@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
Copy link
Contributor

sbaumannpickering commented Sep 28, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants