![]() |
How
it works
|
How it works
FILE NAVIGATION
ANALYSIS
DATA MANIPULATION
GRAPHING
TOOLS
FILE NAVIGATION
ANALYSIS - FILE - SECTION - CALL - PULSE
Sound
Ruler deals with sound in five hierarchically nested levels of time: analysis,
file, section, call and pulse. They are reflected in the way the program deals
with sound, stores and shows results and saves data.
Analysis: Each time you open Sound Ruler,
it starts a new Analysis. All the results within an Analysis are held
in memory and can be navigated, even after several files were measured. An Analysis
ends when Sound Ruler is closed or when you go to the menu File - Clear Data.
When you select Clear Data, a new Analysis is started.
File: This is the .wav sound file. You
do not need to edit your recordings to isolate calls or to produce small files.
It can be your original field cut.
Section: If the file is long, it is broken
into 'sections' of short duration, to allow for better visualization and fast
processing. A section is a segment of sound that Sound Ruler reads from the
disk and keeps in the RAM memory for filtering, measuring and graphing.
Call: Each section is screened for the
presence of 'calls'.
Pulse: Each call contains one or more pulses
which are the basic signal units measured. 'Pulses' are characterized by a certain
amount of amplitude modulation in the call. When data are saved in spreadsheet
format, each row of data represents one pulse.
IMPORTANT: Keep in mind that 'Call' and 'Pulse'
are suggestive names, but for Sound Ruler they are only two levels of measurement,
which do not have to correspond to the acoustic entities produced by animals.
You can use this two levels to analyze calls and pulses, or for example call
groups and calls.
Editing
calls and filtering them takes a lot of time, space on hard disk and organization,
and produces opportunities for human mistakes.
With Sound Ruler, you can have your files digitized
with, for example, one cut per file, and do all your analysis from there. You
can analyze and reanalyse your original files using different resolutions, filters
FFT settings and measurement parameters. Filters are applied 'on the fly', as
data are read from the disk, so you do not have to worry about saving filtered
versions.
When you choose a file to open Sound Ruler asks
you how much of it you want to visualize at a time. It then reads in more information
as necessary to display and analyze the parts of the file that you want.
NOTE: Although there is no limit to the length
of the file, the amount of RAM memory will limit the length of sound displayed
on the screen at a time. If you need to inspect minutes of sound in one plot,
you should try to download a sound editing program from the internet.
NOTE: The system was not tested with REALLY long
files, having hours of sound. Please contact the author if you have such a need.
It should work, but adjustments will be necessary to make it practical to navigate
among hundreds of sections per file.
ANALYSIS
When
you activate Mouse Logging and right-click on any file, Sound Ruler takes the
coordinates of the mouse arrow, assigns them to the underlying data point in
the plot, and pastes those data into the Text Pad. The resolution of the measurements
will be limited by three factors:
1 - The resolution
with which the plots where generated, which is determined by your settings;
2 - The resolution
of the mouse coordinates on the screen. It is fixed at one pixel, but as you
change the size of SoundRuler's main window, you will alter the number of pixels
occupied by each plot;
3 - The resolution
of your mouse. There is a minimum amount of movement that the mouse needs to
sense to inform the computer. It depends on the construction of the mouse, and
on how clean it is.
Sound
Ruler detects signals based on amplitude. Instead of individual samples,
it looks at the sum of the squared (to avoid canceling positives with negatives)
amplitudes of a group of samples (defined by the parameter Smooth). It then
advances a certain number of samples (defined by Resolution) to take the next
sum.
Calls are detected within a section in
one pass, from left to right.
Pulses
are detected in a call in one divided pass: from the maximum peak to the beginning
and from the maximum peak to the end.
Finally, each pulse is delineated with a divided pass, from its peak to the extremes.
Sound
Ruler recognizes and measures repeated acoustic structures, with one level of
subcomponents. The repeated structures are called "calls" and
the subcomponents are called "pulses". It is up to the user
to decide how to fit this two levels to the sounds under analysis. For example:
a sequence of simple, tonal, repetitive sounds can be analyzed as a sequence
of "calls" with one "pulse" each, or as one "call"
containing several "pulses".
The recognition process for each level is described
in the next two items.
Calls
are recognized within a section based on amplitude or also on duration
and/or interval.
Settings specify the expected values and the accepted
range around the expected values.
The
edges of calls do not need to be recognized with precision within the section,
because each call is reanalyzed with greater detail in the next step. One can
use any of the methods available for recognizing calls within a section (even
manual) without influencing the results.
Pulses
are recognized within a call based on amplitude or also on duration,
interval and/or dominant frequency. Settings specify the expected
values and the accepted range around them. Intelligent adjustment
of the expected values can be specified to account for gradual change in the
envelope of the call. There are five options of intelligent adjustment, with
progressive order of complexity:
After a pulse is detected it is delineated. Starting from its peak, amplitude is measured down in both directions and position is recorded at 90%, 50% and 10%. The algorithm continues until it finds amplitude 1% or and increase in amplitude, whichever comes first. In total, nine points are measured, as depicted by the red dots in the left graph above
Measurement of spectral traits
Frequency
measurements are taken from the data underlying the spectrogram. Keep
in mind that the frequency resolution of your measurements is determined by
the settings used to calculate the spectrogram and the sampling rate of the
sound. The frequency with most energy is determined for each of the nine amplitude
points measured in the call. In addition, amplitude is measured at each harmonic
specified by the user, and the time of highest amplitude. These measurements
are ilustrated by the blue dots in the center graph above.
Measurements of tuning are taken from the spectrogram,
but are ilustrated on the Power Spectrum, for easy visualization. The width
of the peak is measured at half and one tenth amplitude (green lines) and divided
by the frequency.
The power spectrum is calculated for inspection
only and its settings do not affect the measurements, except for cross correlation
analysis (CCA) of power spectra.
DATA MANIPULATION
All
measurements, settings and summaries for each measured pulse are stored in the
RAM until an autosave event is due (if autosave is enabled) or the user clicks
on the menu "File" - "Save Data".
The series of listboxes by the Results list allows
the user to navigate the results of previous pulses, calls, sections or files
within a same analysis. All this information is erased when the user selects
the menu "File" - "Clear Data".
Sound Ruler uses a hierarchical structure to hold
each number in memory only once, but if more data are produced within a same
Analysis than the memory can hold, the computer will slow down. If that happens,
save the data, go to the menu "File" - "Clear Data", and
start a new analysis.
Sound
Ruler deals with data in a way that is similar to a text editor. As the analysis
goes on, you can navigate through the results, reanalyze calls and have the
old results replaced by the new ones, and issue Save Data to have them written
to a file.
As with a text editor, the user should avoid working
for long without saving the results.
When data are saved, Sound Ruler loops through
the 5 hierarchical levels and the 3 types of data (raw, summaries and settings)
to produce all the redundant information in the output table(s).
The data are saved in one or two files, as set
in Options - Saving Data. Two-file outputs are meant for incorporation in a
relational database, for efficiency in extensive analysis. They are saved as
a comma-delimited-text file (.CSV) which is a general standard that can be read
by most spreadsheet and database programs.
GRAPHING
Sound
Ruler offers several options of file formats for saving and copying figures.
These fall into two categories: bitmaps and metafiles. Each of these categories
has its advantages and weaknesses, and the user should be aware of them to obtain
the best results when exporting figures.
The difference between a bitmap and a metafile
is the way in which the visual information is described. In a few words, a bitmap
is coded as a table, where each cell represents a pixel and stores the information
for the color and brightness of that pixel. When a plot is saved as a bitmap,
the information of each pixel is saved sequentially. Metafiles, on the other
hand, store the visual information as a set of graphical objects, describing
each object by the relative coordinates of its limits. A plot in a metafile
is stored as a set of lines, each line described by its color and coordinates
of the limit points.
In theory, metafiles should work better for describing
plots, because they are based on relative coordinates, and therefore can be
resized without loss in fidelity to the original. Unfortunately, the way in
which metafiles are implemented in various software lacks standardization, causing
figures to frequently have problems such as distortions in the size of text
when transported among applications.
A simplistic recommendation is to use bitmaps
when you want the figures to look exactly as in Sound Ruler, and metafiles when
you anticipate having to resize them.
Sound
Ruler is designed for analysing and graphing sounds in batches.
When you use the "Export Graphs" menu
in the main window, a new figure is created with the plots that you choose.
This figure is highly customizable and its key feature is a "Refresh"
menu that allows you to update the data in the axes. In addtition, this figure
can be saved in many formats, including Matlab's .fig. When saved in the .fig
format, it can be loaded later on to be further edited and to refresh its data.
You can create your library of template figures
and keep reloading them to quickly produce batches of standartized figures.
TOOLS
Simply
going to the field and pointing a sound pressure level meter to a calling animal
will usually not produce measurements that are useful to calibrate your recordings.
The reason is that animal sounds are commonly short and have a changing amplitude.
Sound pressure level meters take measurements by integrating the sound received
during a window of time, which is usually about 0.5 or 0.2 seconds.
You can calibrate the amplitude of the sounds
that you analyze by comparison with a signal of known amplitude. Sound Ruler
can measure a piece of a reference sound and calculate a calibration factor
for the measurements on your sounds.
There are several ways of producing a reference
sound, and the most appropriate one depends on several factors including: acoustic
environment where the recordings are done, desired precision, available equipment,
and budget.
Some recorders (some reel-to-reel Nagras) have
built in calibrated amplitude meters.
Precision sound pressure level meter manufacturers
usually also offer constant sound sources, which produce sound at highy repeatable
amplitude. One can attach such sound source to the microphone (and recorder)
that will be used in the field and record a signal of known amplitude. Notice
that individual microphones and recorders and tapes vary in sensitivity and
amplification, so that the exact same microphone-recorder-tape combination that
was calibrated in the lab should be used in the field. In addition, all the
gain settings should be exactly the same as what was used in the lab. To make
the system somewhat more versatile in the field, you can calibrate it at several
gain settings in the lab, but in that case, it would not hurt to do some tests
to find out how repeatable your knob-turning is when setting the gain. Another
issue with this method is that the equipment can become less sensitive as the
batteries loose charge. You can check on this by repeating the calibration procedure
in the lab upon returning from the field, so that each tape has the pre-field
calibration tone, the field recordings and the post-field calibration tone.
If the equipment operated as expected the pre and post tones will have the same
amplitude.
When the application does not require highly precise
measurements, a calibration system can be setup up with cheap equipment. General
electronics stores, such as RadioShack carry sound pressure level meters for
about $50. They also carry amplified buzzers ($2), that only need to be connected
to a battery and a switch to make a mini sound source. The idea is to activate
the buzzer, measure the amplitude with the SPL meter, replace the meter by the
microphone and record the calibrated tone. Ideally, this should be done inside
an anechoic chamber to eliminate all sounds except what radiates directly from
the buzzer. Reasonable results can be obtained in a silent place outdoors, with
no wind or nearby hard surfaces. This procedure has many sources of error including:
the inconstancy of the buzzer, the precision of the SPL meter, other sounds
and echo, error in distance and alignment when replacing the SPL meter with
the microphone. One should repeat the procedure several times to obtain error
measurements on the readings of the SPL meter and the amplitudes of the recorded
tones, which will together indicate the overall precision of the calibration
setup.
The
highpass, lowpass and bandpass filters specified in the menu Set - General or
by clicking on the Spectrogram plot, are infinite inpulse response (IIR) digital
Butterworth filters. This type of filter is characterized by being flat in the
passband and monotonic overall, but it does not provide very steep change at
the critical frequency. One should, therefore, avoid settings critical frequencies
close to the frequencies of interest in the analysis.
The magnitude response of the filter at the cutoff
frequencies is sqrt(1/2) = 0.707. One can adjust the frequency response of the
filter by altering the critical frequencies and the filter order. Numerical
problems can arise if one specifies filter orders 15 or higher.
Future releases of Sound Ruler should include
a plot of the frequency response of the filter to allow for more informed adjustment
of the cutoff frequencies and filter order.
The
tuning curve tool employs modified Yule-Walker equations to design recursive
IIR digital filters using a least-squares fit to the frequency response specified
by the user in the filter file.
When a filter is designed, Sound Ruler produces
a plot matching the frequency response specified in the filter file, with the
frequency response produced by the filter. This plot can be used as a guide
to adjust the filter order and the desired frequency response, to obtain the
best filter match. Increased filter orders can produce better matches, but numerical
problems will arise at high filter orders. Sharp transitions in frequency response
might produce poor matches.
The
cross correlation analysis generates an index of maximum overlap between each
per of plots assigned by the user. It does so by sliding the second plot on
the first one and generating an index of overlap at each step of the slide.
It then reports the absolute highest index and the relative displacement at
which it occurred.
For oscillograms, the plots are vectors of amplitude
by time. They are slided along the time axes at steps of the size defined in
the Resolution field of the CCA window.
Power Spectra are vectors of amplitude per frequency.
They are slid along the frequency axes at steps equal to the frequency resolution
of the plot. The FFT size used is independent of the length of the signal and
is equal to the FFT size specified for the Power Spectrum plot (Menu - Options
- Power Spectrum). The FFT is centered on the point of maximum amplitude of
the signal. If the signal is longer than the FFT it is clipped and if it is
shorter zeros are added to the beginning or the end.
Spectrograms are matrices of amplitude per frequency
per time. They are slid along the time axes at steps equal to ( FFT size - FFT
overlap ) specified for the Spectrogram. In 2D CCAs, they are also slid along
the frequency axes at steps equal to ( sample rate / FFT size ) specified for
the Spectrogram. Each signal assigned to the analysis receives ( FFT size /
2 ) zeros at the beginning and ( FFT size / 2 ) zeros at the end, to allow the
beginning and the end of the signal to be centered on FFTs. One might want to
specify extra signal time to be included with calls assigned to CCA, to make
the FFTs of the edges of the sound contain background noise and not zeros.
The correlation index is the sum of the products,
for each each step in the slide, of the values of the two signals. If the Normalize
amplitude option is selected, than the calculation of the index is the same,
but for each step on the slide, the product of values is divided by the square
root of the product of the sums of the values in each signal.
This
tool is intended as a didactic and conceptual aid for visualizing acoustic scenarios.
The numeric approach is to help one realize the quantitative relations between
variables. The results obtained should not be expected to precisely match real
situations, as the relations between variables are considered in their most
simplistic form, with assumptions such as free field, sound pressure level =
sound intensity, no sound absorption by the medium, etc.
Sound Math is in its infancy and there are many
plans for expansion, such as visual aids to identify related variables, display
of the mathematical relation and/or a plot for pairs of variables, new scenarios,
and gradual added complexity. Feedback from the users, however, will be very
important in defining the directions in which Sound Math should grow.
The current scenario presents a point source in
a silent free or hemispherical field, producing a tone with no frequency modulation.
The sound propagates through an homogeneous static medium with no absorption
and reaches a static receiver which encodes the sound as digital information.
Problems for students could not only include questions
within the scope of the scenario, but extensions to it, such as Doppler effects,
calculation of sound pressure on the surface of the tympanic membrane, problems
with multiple sources, aliasing, etc.
The source power level is:
sourcePowerLevel
= 10 * log10 ( sourcePower/ 0.000000000001)
Note: 1 picowatt
is the reference for sound power level.
Sound radiates from the source in an expanding
surface that is:
surface = 4 * pi
* r ^ 2 in a free field (a bird in flight)
surface = 2 * pi
* r ^ 2 in a hemispherical field (such as flat ground or water surface).
Sound intensity decreases with distance
as:
remoteIntensity
= sourcePower / surface
The remote pressure level is approximately:
remotedBSPL ~= 10
* log10 ( remoteIntensity / 0.000000000001)
Note: 1 picowatt
is the reference for sound intensity level.
The period of the source sound is:
sourcePer = 1 / sourceFreq
And the number of sound cycles produce id given
by:
sourceCycles
= sourceFreq * sourceDuration
The sound wavelength in the medium is defined
as:
mediumWavelength = mediumSoundSpeed / sourceFreq
The delay with which the sound is perceived
by the receiver is:
remoteDelay = remoteDistance / mediumSoundSpeed
The remote pressure (in Pascal) is:
remotePressurePa = 10 ^ ( remotedBSPL / 20 + log10 ( 0.00002 ) )
Note: 0.00002 Pa is the reference for sound pressure level (SPL).
And in atmospheres, the pressure is:
remotePressureAtm = remotePressurePa / 101325
When the sound is digitized, the Nyquist frequency
is:
remoteNyquistFreq = remoteSRate / 2
The frequency resolution is given by:
remoteFreqResol = remoteSRate / remoteFFTsize
And the time resolution is:
remoteTimeResol = 1 / ( remoteSRate / remoteFFTsize )
The number of possible values of amplitude with
which sound is stored is:
remoteCategories = 2 ^ remoteBits
And if the signal ranges from -1 volt to +1 volt, the
amplitude resolution is:
remoteAmplResol = 2 / remoteCategories