Module emphasis
source code
Perceptual loudness measurement. This is an implementation of
"Percieved Level of Noise by Mark VII and Decibels (E)" S. S.
Stevens, J. Acoustical Soc. Am. v. 51(2, part 2) 1972 pages 575-602.
The algorithm matches the paper for FractOct==ThirdOct or OneOct. The
algorithm assumes that the level defined by SIXTY_EIGHT corresponds to
68dB relative to 20 micro-Newtons per square meter sound pressure.
USER INFORMATION:
You'll find, somewhere, a subdirectory named speechresearch/voicing .
Within this is a script called emphasis_stevens.py . This can be run as
python emphasis_stevens.py -o outputfile -write BITPIX=0 -c channelnumber
inputfile (there are a couple of other flags, too).
It will then read the input file (which is an audio recording) and
produce a time-series of the loudness. Data input and output is via the
gpkio library, in .../speechresearch/gpkio. That library has many
virtues, but reading WAV files is not one of them, so you have to convert
.wav files to the "GPK ASCII image" format (or one of several
other formats), using .../speechresearch/lib/wavio.py .
The output will be in an ASCII version of the format, which should be
reasonably intelligible. (The GPK ASCII image format is based on the
FITS astronomy format from NASA.)
However, that script uses the gpkio and gpklib libraries (also under
../speechresearch). These need to be compiled, and it uses the
gpk_img_python package that needs to be installed via "python
setup.py install". Oh, and .../speechresearch/gmisclib needs to be
in your PYTHONPATH.
Give it a try, and I'll be happy to help, and will incorporate the
troubles you have into some form of documentation. Sorry, I have
nothing better yet.
|
|
|
|
|
|
|
|
|
emphasis(data,
extra,
DT=0.01)
Measure the time-series of loudness of a data array data. |
source code
|
|
|
simple_emphasis(data,
dt,
DT=0.01,
extra=extra_c(Fmin, Fmax, FracOct, FAC)) |
source code
|
|
|
|
|
FAC = 0.5
|
|
ThirdOct = 1.25992104989
|
|
OneOct = 2.0
|
|
FracOct = 1.62450479271
|
|
Fmax = 12500.0
|
|
Fmin = 50.0
|
|
EXFAC = 2
|
|
TAUFAC = 1.2
|
|
SIXTY_EIGHT = 6000.0
|
|
E = 0.3333
|
|
Fullband = extra_c(Fmin, Fmax, FracOct, FAC)
|
|
Speechband = extra_c(300.0, 4000.0, FracOct, FAC)
|
|
__package__ = ' lib '
|
Imports:
math,
numpy,
Numeric_gpk,
die,
gpkmisc,
voice_misc
Approximate loudness of the sound in data array d. Extra contains
misc. parameters.
|
Measure the time-series of loudness of a data array data. DT is the
sampling interval for the resulting loudness time series.
|