0

for a school project, I am supposed to analyze a short sound recording in wav format. I am done with the project, I DFT'd it, filtered out unwanted frequencies, and got the correct result. What eludes me, though, is the meaning of the values of the individual samples of my wav file. I have tens of thousands of samples that look like this:

[ 0.06234258  0.16020246  0.14122963 ... -0.01704375 -0.08993937 -0.09293508]

However, no matter how much I multiply these values by a number, the resulting sound sounds the same. If I multiply every sample by 1000, it sounds just as it sounded before. The same goes for dividing. So what do these samples mean, if not volume?

EDIT:

Here is the code I'm using:

import soundfile as sf
import IPython

samples, sampling_freq = sf.read('recording.wav')
IPython.display.display(IPython.display.Audio(samples, rate=sampling_freq )) #This one displays a playable bar.
ampersander
  • 208
  • 2
  • 9
  • Audio hardware expects the data from the player with a specific format (eg. 48 KHz, 16 bit signed integer) So I guess there is some re-normalisation of the signal occurring in order for the data to take the correct form. How are you playing the data? – Mat Dec 23 '21 at 14:56
  • @Mat I have added my code in the edit. – ampersander Dec 23 '21 at 15:09

1 Answers1

0

The samples (basically a long array of floating point numbers) in the file is the Pulse Code Modulated data representing the audio.

Given that audio players use this data to recreate the original audio wave, multiplying every sample by some factor should increase the volume. However, some audio players scale down (re-normalize) the samples to prevent audio clamping - which can be the cause why it sounds the same.

The ideal way to visualize the audio should be using Audacity. It has the capability to show the audio wave in real time. Something like this -

enter image description here

PC: Google

Tyler Durden
  • 860
  • 6
  • 17
  • Thank you for your answer, I have added my code to the edit, and now I'm beginning to think that the multiplication may not work due to the player I'm using in python (IPython) – ampersander Dec 23 '21 at 15:10