<p>The free and open source software, <strong><a href="https://www.pamguard.org/" rel="noreferrer">PAMGuard</a></strong>, has an option for an LTSA module to be run while you're processing your acoustic data. This is stored in binary files which can be accessed using either:</p>
<ul>
<li>R (via the Pamguard R library, <strong><a href="https://github.com/TaikiSan21/PamBinaries" rel="noreferrer">PamBinaries</a></strong> by Taiki San), or</li>
<li>Matlab (via the PAMGuard Matlab library, <strong><a href="https://github.com/PAMGuard/PAMGuardMatlab" rel="noreferrer">pgmatlab</a></strong>).</li>
</ul>
<p>Once in either of these suites, you can handle the data and plot as you wish.</p>

CC BY-SA 4.0
2022-07-06T08:00:51.630Z
2022-07-06T08:00:51.630Z
Chloe
<p>I have been using this <a href="https://github.com/tryan/LTSA/blob/master/python/ltsa.py" rel="noreferrer">code</a> posted in Github from <a href="https://github.com/tryan" rel="noreferrer">tryan</a>, which is written in Python, to build some LTSAs. It is basically Triton's algorithm but in Python. Since it is an open source code you can maybe change the algorithm to output the product you want. I was wondering if it would not be useful for you, since the resulting output of the LTSA is an image, converting the LTSA images into numpy arrays in Python. It might be a very naive step but depending on what you need it could be useful.</p>
<p>This repository also has the the relevant Matlab/Octave code.</p>

CC BY-SA 4.0
2022-07-19T11:55:18.217Z
Thanks for the tip! I am a new stack user and still learning how it works. I just edited the answer so the information is more clear now and with the github source.
Guilherme Frainer
CC BY-SA 4.0
2022-07-06T11:14:28.923Z
Great to share your own code! Super helpful.

If you wouldn't mind, could you add that it is a github link that you are sharing, and your github username so folks could find it again if the link breaks?
etgriffiths
CC BY-SA 4.0
2022-07-06T10:39:09.883Z
2022-07-18T18:06:11.213Z
2022-07-18T18:06:11.213Z
Guilherme Frainer
<p>DetEdit has functionality to calculate LTSAs; it's a GUI but the code is written in MATLAB (open-source, relies on mkLtsa function mostly).</p>
<p>Article describing it: <a href="https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1007598" rel="noreferrer">https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1007598</a></p>
<p>Code/instructions/wiki: <a href="https://github.com/MarineBioAcousticsRC/DetEdit" rel="noreferrer">https://github.com/MarineBioAcousticsRC/DetEdit</a></p>

CC BY-SA 4.0
2022-07-06T14:32:10.500Z
2022-07-06T14:32:10.500Z
Carly Batist
<p>I have not personally used the below linked code, but I did have this starred in my GitHub folder a while back and had been meaning to try it. It may provide the type of output you can work with more easily, compared to Triton.</p>
<p><a href="https://github.com/schonkopf/long-term-spectrogram" rel="noreferrer">https://github.com/schonkopf/long-term-spectrogram</a></p>

CC BY-SA 4.0
2022-07-18T18:03:21.187Z
2022-07-18T18:03:21.187Z
selene
<p>What software programs exist that can be used to calculate sound levels for long-durations of continuous audio files?</p>
<p>A helpful list of other sound processing programs was shared recently: <a href="https://bioacoustics.stackexchange.com/a/136/112">https://bioacoustics.stackexchange.com/a/136/112</a>, but only <a href="https://github.com/MarineBioAcousticsRC/Triton" rel="noreferrer">Triton</a> is listed for calculating long-term spectral averages. <a href="https://bitbucket.org/CLO-BRP/manta-wiki/wiki/Home" rel="noreferrer">MANTA</a> is a similar tool for processing lots of continuous data.</p>
<p>I am interested in both stand-alone and/or programs that need to be run through Matlab/R/etc, but it's important for me to be able to export the LTSA product as an array or similar for further processing.</p>
<p>Thanks!</p>

<analysis><soundscape><software><ltsa>
Software for calculating long-term spectral averages
# Software for calculating long-term spectral averages

(Asked by: username_0 on 2022-07-05)

What software programs exist that can be used to calculate sound levels for long-durations of continuous audio files?

A helpful list of other sound processing programs was shared recently: <https://bioacoustics.stackexchange.com/a/136/112>, but only [Triton](https://github.com/MarineBioAcousticsRC/Triton) is listed for calculating long-term spectral averages. [MANTA](https://bitbucket.org/CLO-BRP/manta-wiki/wiki/Home) is a similar tool for processing lots of continuous data.

I am interested in both stand-alone and/or programs that need to be run through Matlab/R/etc, but it's important for me to be able to export the LTSA product as an array or similar for further processing.

Thanks!

**Tags:** analysis, soundscape, software, ltsa


---

## 4 answers

### Answer by username_1 on 2022-07-06. Score: 21

The free and open source software, **[PAMGuard](https://www.pamguard.org/)**, has an option for an LTSA module to be run while you're processing your acoustic data. This is stored in binary files which can be accessed using either:

* R (via the Pamguard R library, **[PamBinaries](https://github.com/TaikiSan21/PamBinaries)** by Taiki San), or
* Matlab (via the PAMGuard Matlab library, **[pgmatlab](https://github.com/PAMGuard/PAMGuardMatlab)**).

Once in either of these suites, you can handle the data and plot as you wish.


---

### Answer by username_2 on 2022-07-06. Score: 15

I have been using this [code](https://github.com/tryan/LTSA/blob/master/python/ltsa.py) posted in Github from [tryan](https://github.com/tryan), which is written in Python, to build some LTSAs. It is basically Triton's algorithm but in Python. Since it is an open source code you can maybe change the algorithm to output the product you want. I was wondering if it would not be useful for you, since the resulting output of the LTSA is an image, converting the LTSA images into numpy arrays in Python. It might be a very naive step but depending on what you need it could be useful.

This repository also has the the relevant Matlab/Octave code.

> **Comments:**
> **username_3**: Great to share your own code! Super helpful.  If you wouldn't mind, could you add that it is a github link that you are sharing, and your github username so folks could find it again if the link breaks?  
> **username_2**: Thanks for the tip! I am a new stack user and still learning how it works. I just edited the answer so the information is more clear now and with the github source.  

---

### Answer by username_4 on 2022-07-06. Score: 7

DetEdit has functionality to calculate LTSAs; it's a GUI but the code is written in MATLAB (open-source, relies on mkLtsa function mostly).

Article describing it: <https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1007598>

Code/instructions/wiki: <https://github.com/MarineBioAcousticsRC/DetEdit>


---

### Answer by username_5 on 2022-07-18. Score: 6

I have not personally used the below linked code, but I did have this starred in my GitHub folder a while back and had been meaning to try it. It may provide the type of output you can work with more easily, compared to Triton.

<https://github.com/schonkopf/long-term-spectrogram>


---

