Realtime sound level measurement with logging

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Realtime sound level measurement with logging

Jonathan Gazeley
Hi folks,

I'd like to set up sound level monitoring for my office, with periodic
logging. I have a handheld meter but I'm really looking for a way to use
a traditional condenser microphone and USB audio interface to measure
the level with some kind of windowing, and log it periodically to a file
(maybe once per minute). Is there a decent application that can monitor
and log data in this way?

I'm also open to the idea of just recording a WAV file over 24 hours and
doing the analysis afterwards, with periodic readings from the file.

Is my approach reasonable, to set up a microphone and use the gain knob
to calibrate it against the handheld meter?

I don't need amazing accuracy. We've just moved into a large open-plan
office for the first time and it is very noisy (handheld meter says
about 50dB of air handling noise measured at my desk, rising to 60dB
when there is background talking). I want to monitor sound levels
throughout the day to test my theory that people are more noisy in the
afternoon, and to get an overnight control reading with the people gone
and only the air handling and computers running.

Thanks,
Jonathan
--
Jonathan Gazeley
Senior Systems Administrator
IT Services
University of Bristol
_______________________________________________
Linux-audio-user mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Realtime sound level measurement with logging

Michael Jarosch
Am Freitag, den 12.05.2017, 10:47 +0100 schrieb Jonathan Gazeley:
> Is there a decent application that can monitor 
> and log data in this way?

What you describe is pretty much the same stuff I was teached last
weekend...

I don't know what (linux-)program fits best for this task, but I would
also appreciate a hint for doing a DIN-15905-5-compliant measurement on
linux. :)

> I'm also open to the idea of just recording a WAV file over 24 hours
> and 
> doing the analysis afterwards, with periodic readings from the file.

I know a tool called "replaygain". It's used to compute the loudness of
a soundfile. But, actually, this is another task and - as much as I
know - has nothing to do with determine a sound pressure level...

What you need is something that determines an average value of the
sound pressure you're recording in dbFS. Then, you "only" have to know,
what sound pressure level represents 0 dbFS. But if you're talking
about perception, you also need some kind of weighting... Not that
easy...

> Is my approach reasonable, to set up a microphone and use the gain
> knob 
> to calibrate it against the handheld meter?

Could work, if you find a program that works exactly like that handheld
meter. That means: Same weighting, same time periods. There are
standardized weighting and time periods (slow = 1s, fast = 125 ms), so
chance is you could be lucky.

> I don't need amazing accuracy.

You won't get much accuracy, anyway, as long as you don't use "class
1"-equipment which costs several thousand euros.
Even with "class 2"- equipment, 3dB is nothing. At least, this is what
my tutor said last weekend.

Greets!
Mitsch
_______________________________________________
Linux-audio-user mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Realtime sound level measurement with logging

Joel Roth-2
In reply to this post by Jonathan Gazeley
Jonathan Gazeley wrote:

> Hi folks,
>
> I'd like to set up sound level monitoring for my office, with periodic
> logging. I have a handheld meter but I'm really looking for a way to use a
> traditional condenser microphone and USB audio interface to measure the
> level with some kind of windowing, and log it periodically to a file (maybe
> once per minute). Is there a decent application that can monitor and log
> data in this way?
>
> I'm also open to the idea of just recording a WAV file over 24 hours and
> doing the analysis afterwards, with periodic readings from the file.
>
> Is my approach reasonable, to set up a microphone and use the gain knob to
> calibrate it against the handheld meter?
>
> I don't need amazing accuracy. We've just moved into a large open-plan
> office for the first time and it is very noisy (handheld meter says about
> 50dB of air handling noise measured at my desk, rising to 60dB when there is
> background talking). I want to monitor sound levels throughout the day to
> test my theory that people are more noisy in the afternoon, and to get an
> overnight control reading with the people gone and only the air handling and
> computers running.

Hi Jonathan,

I think ecasound might be able to serve your purpose.

The way it works is your send the signal through a chain
with the -ev operator, run the engine for a while,
then use the 'cop-status' command, which provides
text output with statistics about the audio that
was processed.

Here's an example of a non-realtime analysis of a .wav file,
omitting some irrelevant messages.
 
$ ecasound -i tmh.wav -ev -o null -c

ecasound ('h' for help)>  start

[engine finishes]

ecasound ('h' for help)> cop-status

### Chain operator status (chainsetup 'untitled-chainsetup') ###
Chain "default":
        1. Volume analysis: [1] cumulative-mode 1.000, [2] result-max-multiplier 1.000
        Status info:
-- Amplitude statistics --
Pos/neg, count,(%), ch1...n
Pos    3dB: _______0 _______0
Pos    0dB: _______0 _______0
Pos -0.1dB: _______0 ______17
Pos   -3dB: _____717 ____3247
Pos   -6dB: ___26347 ___58661
Pos  -10dB: __206742 __280703
Pos  -20dB: _1177971 _1203440
Pos  -30dB: _1035427 __988797
Pos  -60dB: __754914 __677400
Pos -infdB: __214307 __211396
Neg -infdB: __107059 ___98364
Neg  -60dB: __710105 __641269
Neg  -30dB: _1030655 __963146
Neg  -20dB: _1162815 _1191367
Neg  -10dB: __218110 __291908
Neg   -6dB: ___27221 ___61362
Neg   -3dB: _____250 ____1563
Neg -0.1dB: _______0 _______0
Neg    0dB: _______0 _______0
Neg    3dB: _______0 _______0
Total.....: _6672640 _6672640
(audiofx) Peak amplitude: pos=0.99997 neg=0.96002.
(audiofx) Max gain without clipping: 1.00003.
(audiofx) -- End of statistics --

HTH,

Joel
 

> Thanks,
> Jonathan
> --
> Jonathan Gazeley
> Senior Systems Administrator
> IT Services
> University of Bristol
> _______________________________________________
> Linux-audio-user mailing list
> [hidden email]
> http://lists.linuxaudio.org/listinfo/linux-audio-user

--
Joel Roth
 

_______________________________________________
Linux-audio-user mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Realtime sound level measurement with logging

Maurizio Berti
In reply to this post by Jonathan Gazeley
Hi Jonathan,
I found your request actually interesting to play with.
If you use jack, I made a little python script, which only requires you to download and compile a small program, jack-peak, that Robin Gaerus wrote a couple of years ago.
Just download the tar or zip file, unpack it and type make. It might give you some erros, but don't worry: if a "jack-peak" file (without any extension) is created, it means that the build process was successful.
Then, just use the attached "meter.py" script, put it anywere you want, then copy that jack-peak compiled file in the same path, then run

./meter.py -c 1

this will just create a single input port, without jack connection, and will print the output at the default delay rate (100ms).
For example, this command line will record the value every second, connect to the first system audio input and save the data to the file "peaks.txt"
./meter.py -d 1000 -f peaks.txt system:capture_1

By default, the value is a float linear (3 digits after decimal point), from 0 to 1, you can use a custom integer scale, eg from 0 to 1000.
To stop recording, just hit ctrl+c.

For more options, look at the help documentation:
./meter.py -h

I'm actually thinking about converting it to a pure python script, by including jack-python bindings and supporting alsa too, but right now I'm in the middle of another project and I don't have much time for that right now.
Anyway, let me know if this suits your needs.

PS: Robin's program can be used even without this script, but you need to forward its output to a file and then parse every line, since it just rewrites the lines everytime the data is analyzed, which results in an unreadable output or file.

Cheers,
MaurizioB

2017-05-12 11:47 GMT+02:00 Jonathan Gazeley <[hidden email]>:
Hi folks,

I'd like to set up sound level monitoring for my office, with periodic logging. I have a handheld meter but I'm really looking for a way to use a traditional condenser microphone and USB audio interface to measure the level with some kind of windowing, and log it periodically to a file (maybe once per minute). Is there a decent application that can monitor and log data in this way?

I'm also open to the idea of just recording a WAV file over 24 hours and doing the analysis afterwards, with periodic readings from the file.

Is my approach reasonable, to set up a microphone and use the gain knob to calibrate it against the handheld meter?

I don't need amazing accuracy. We've just moved into a large open-plan office for the first time and it is very noisy (handheld meter says about 50dB of air handling noise measured at my desk, rising to 60dB when there is background talking). I want to monitor sound levels throughout the day to test my theory that people are more noisy in the afternoon, and to get an overnight control reading with the people gone and only the air handling and computers running.

Thanks,
Jonathan
--
Jonathan Gazeley
Senior Systems Administrator
IT Services
University of Bristol
_______________________________________________
Linux-audio-user mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-user



--
È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net

_______________________________________________
Linux-audio-user mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-user

meter.py (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Realtime sound level measurement with logging

Fons Adriaensen-3
In reply to this post by Michael Jarosch
On Fri, May 12, 2017 at 11:56:31PM +0200, Michael Jarosch wrote:

> Could work, if you find a program that works exactly like that handheld
> meter. That means: Same weighting, same time periods. There are
> standardized weighting and time periods (slow = 1s, fast = 125 ms), so
> chance is you could be lucky.

Jnoisemeter will provide the exact filters and detector response.
 
You could probably modify it easily to print out the measured
value (with some calibration offset) so you can log it to a
file.

Ciao,

--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

_______________________________________________
Linux-audio-user mailing list
[hidden email]
http://lists.linuxaudio.org/listinfo/linux-audio-user