2

I lack a background in acoustics, but need to work on a data-science project in acoustics.

Please help me understand how to correctly interpret what amplitude of waveform represent, correctly set the metrics, and possibly set correct sampling rate when doing analysis.

Consider this example.

I have a waveform file of an animal recorded at 250000 sampling rate.

You can listen to it here:

https://www.whyp.it/tracks/75747/bat-120614013233718915?token=Lmt6M (original audio)

data, rate = librosa.core.load('my_file.wav')

# data is numpy array
# rate is 250000

I am learning the amplitude units can be decibel or voltage; in case of wave files, amplitude is represented by 16-bits integers : from -32768 to 32767, where 0 represents no sound (silence).

I load the file with librosa, and amplitude should get normalised between [-1, 1].

When I plot the data, I see y-axis in between of -0.4, and 0.4 as max values.

enter image description here

If I extract a segment (see any interval between the red lines, above), which is about at 0, and plot it, now the y-axis ranges between -.008 and +0.006.

fig, ax = plt.subplots(nrows=1,ncols=1, figsize=(1,4))
plt.plot(segment, color='black')
plt.show()

enter image description here Audio(data = segment, rate = 192000)

But in both cases, both the file and segments are perfectly audible. I was expecting not to be able to perceive anything for segments with amplitude about zero...

In both cases, in order to hear something, I resample to 192000, which appears to be the maximum value supported by my browser (I am using jupyter on local browser).

Now, a few questions because I feel I lack basic concepts :

  • what is the metric of y-axis of the waveform in wav format: decibels ? voltage?
  • what is the relation between amplitude and volume : why can I hear sound, when its amplitude is around 0 ?
user305883
  • 1,635
  • 2
  • 24
  • 48

2 Answers2

0
  1. The y-axis labels don't denote any particular metrics, however sound levels in decibels, which are relative, can be inferred from them. For instance, a dB level of 0 corresponds to -1 and +1 respectively (the negative and positive maximum values). A level of -6 dB corresponds to -0.5 and +0.5 and so on. The important thing to take from this is that a signal level given in decibels is relative and we can't compute absolute values in volts from this alone.

  2. Obviously, the higher the amplitude, the higher the volume. Note, however that percieved loudness also depends on the frequency of the signal in question. Still, you shouldn't hear any sound for amplitudes in the range below 0.008, so perhaps there was some sort of mistake while resampling your sound. If you can share that sound file, I'll have a listen.

dsp_user
  • 2,061
  • 2
  • 16
  • 23
  • Hi @dsp_user! Thanks for your help. Would you be available for a chat, so that I can send you the file, and understand a bit better some concepts in acoustics and signal processing ? I m new to it. I invited you here - https://chat.stackoverflow.com/rooms/252217/room-for-user305883-and-dsp-user – user305883 Mar 01 '23 at 09:07
  • P.s. for anyone interested in, I found this service that seems like imgur for audio - pretty useful : you can listen to the wav file at: https://www.whyp.it/tracks/75747/bat-120614013233718915?token=Lmt6M – user305883 Mar 01 '23 at 09:18
0

For instance, a dB level of 0 corresponds to -1 and +1 respectively (the negative and positive maximum values).

0dB couldn't correspond to -1 because dB is log10() function, and values must be only positive. We could try to use abs(amp) before transform linear amplitude to logarithmic dB. After that we could convert amplitude to dB, 20*Log10(amp+minvalue). for example minvalue = 1e-6 to avoid Log10(0).

trace
  • 11
  • 4