patriceguyot / acoustic_indices Goto Github PK
View Code? Open in Web Editor NEWAcoustic indices in python
License: GNU General Public License v3.0
Acoustic indices in python
License: GNU General Public License v3.0
First, thanks in advance for the library and any support.
When I try to run main_test_indices.py, I get the following error code:
Read the audio file: audio_files/BALMER-02_0_20150620_0445.wav
Successful read of the audio file: audio_files/BALMER-02_0_20150620_0445.wav
Traceback (most recent call last):
File "main_test_indices.py", line 36, in
data_config = yaml.load(stream, Loader=yaml.FullLoader)
AttributeError: module 'yaml' has no attribute 'FullLoader'
Any ideas what I'm missing? Installed and using PyYAML 3.13.
Thanks!
Dear Patrice and Alice,
Congratulations on an excellent and well documented set of analytical scripts for bioacoustic analysis.
There is a small typo in the current version that breaks the following scripts: main_compute_indices_from_dir, main_test_indices.py, config_014_butter.yaml
In all these scripts there are several references to windowType: hanning when the correct spelling is windowType: hamming.
Best regards, Roberto
Hi there, thanks for the useful repo!
However, when I tried running the main_test_indices.py file after fetching the entire repo on Ubuntu 20.04 and making sure that all 4 required packages were installed with PIP and also APT, I was unsuccessful:
python main_test_indices.py
Traceback (most recent call last):
File "main_test_indices.py", line 16, in <module>
from compute_indice import *
File "/home/kdarras/Documents/Boulot/2020 Hangzhou/ecoSound-web/indices/Acoustic_Indices/compute_indice.py", line 23, in <module>
from scipy import signal, fftpack
File "/usr/lib/python3/dist-packages/scipy/__init__.py", line 62, in <module>
from numpy import show_config as show_numpy_config
ImportError: No module named numpy
please advise whether this is a bug or an error on my part.
wrong repository issue text, sorry
Not an issue but a feature request.
Should it be possible to add the total entropy function ?
As described in https://www.rdocumentation.org/packages/seewave/versions/2.1.4/topics/H
Thank you for porting to Python3!
Olivier
Hi, i'm trying to test the 'windowed_sinc'
pre-processing type but I am facing a problem with the 'roll_off'
key.
To what does this key correspond to ?
data_config['Filtering']['type'] = 'windowed_sinc'
# Pre-processing -----------------------------------------------------------------------------------
if 'Filtering' in data_config:
if data_config['Filtering']['type'] == 'butterworth':
print('- Pre-processing - High-Pass Filtering:', data_config['Filtering'])
freq_filter = data_config['Filtering']['frequency']
Wn = freq_filter/float(file.niquist)
order = data_config['Filtering']['order']
[b,a] = signal.butter(order, Wn, btype='highpass')
# to plot the frequency response
# w, h = signal.freqz(b, a, worN=2000)
# plt.plot((file.sr * 0.5 / np.pi) * w, abs(h))
# plt.show()
file.process_filtering(signal.filtfilt(b, a, file.sig_float))
elif data_config['Filtering']['type'] == 'windowed_sinc':
print('- Pre-processing - High-Pass Filtering:', data_config['Filtering'])
freq_filter = data_config['Filtering']['frequency']
fc = freq_filter / float(file.sr)
roll_off = data_config['Filtering']['roll_off']
b = roll_off / float(file.sr)
N = int(np.ceil((4 / b)))
if not N % 2: N += 1 # Make sure that N is odd.
n = np.arange(N)
# Compute a low-pass filter.
h = np.sinc(2 * fc * (n - (N - 1) / 2.))
w = np.blackman(N)
h = h * w
h = h / np.sum(h)
# Create a high-pass filter from the low-pass filter through spectral inversion.
h = -h
h[(N - 1) / 2] += 1
file.process_filtering(np.convolve(file.sig_float, h))
Read the audio file: audio_files\S4A12065_20200808_160000.wav
Successful read of the audio file: audio_files\S4A12065_20200808_160000.wav
The audio file contains more than one channel. Only the channel 0 will be used.
- Pre-processing - High-Pass Filtering: {'type': 'windowed_sinc', 'order': 8, 'frequency': 300}
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-16-1a5bba1bece8> in <module>
19 freq_filter = data_config['Filtering']['frequency']
20 fc = freq_filter / float(file.sr)
---> 21 roll_off = data_config['Filtering']['roll_off']
22 b = roll_off / float(file.sr)
23 N = int(np.ceil((4 / b)))
KeyError: 'roll_off'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.