Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
h2. Hydrophone Spectral Data

A number of hydrophones are producing audio data with sounds at a wide range of frequencies, having applications in seismology, marine mammal studies, ship noise and more. Hydrophone spectral data (*PNG*/*PDF* image files of the spectrogram, *FFT* and *MAT* data files) are provided as a summary of the audio recording and for detailed analysis. With spectrogram images and data, users can determine the sources and nature of sounds they can hear in the [audio data files|DP:7]: passing ships make hyperbolic curves, whales make chirps and resonances, etc. Spectrogram images, particularly the *PDF* format, are a great way to scan through a vast amount of data quickly, looking for events. Listening to this data would be very time consuming, plus the human ear is not capable of picking up some high or low frequency sounds that may be quite interesting.

Spectrogram image files (*PDF*/*PNG*) are available for all hydrophones and hydrophone arrays. For hydrophones located on low-bandwidth observatories (Cambridge Bay, Brentwood Bay, etc), [audio data files|DP:7] may not be available. In this case, audio data is stored on site to be retrieved periodically during site visits and uploaded to the archiving system. To provide live data, low-bandwidth observatories upload spectrogram *FFT* files as they are much smaller than the full audio data. *FFT* files may be used to generate and fill in spectrogram plots when full audio data is not available (see the Spectrogram Source data product option option). *MAT* files store one-minute ensemble-averaged spectral data, primarily for use in [spectral probability density plots|http://wiki.oceannetworks.ca/display/DP/51].

h5. Data Diversion

Given the sensitive nature of hydrophone data,  the military has authority to completely divert the data and/or filter it as required.  When filtering occurs, the file-name is appended with '-HPF' or '-LPF', corresponding to high and low pass filtered data. Often, the military diverted data will be returned at a later date, normally modified from the original data (we will often get the spectral complement to the high or low pass filtered data). See [here for more information on the diversion of hydrophone and seismometer data|DP:Diversion of Hydrophone and Seismometer data]. Data product options are provided to sort out the various types of diverted data (see below). Not all options are available for all devices: for instance, in some cases, we may not offer '-LPF' spectrograms even if there are '-LPF' audio files because such a spectrogram would offer so very little useful data. For icListen HF hydrophones in particular, *FFT* spectral data are often available during a diversion and will be used to produce spectrograms to fill in data gaps until audio data is returned.

h5. Processing Time

Spectrograms may take some time to generate. *PNG* spectrograms files are normally pre-generated and stored, so their retrieval is quick. However, *PDF* spectrograms are not pre-generated, but will be computed on-demand from stored source *WAV* or *HYD* files. Processing speed is nominally about 5 to 20 seconds per 5 minute audio file. The final step of *PDF* generation, aggregating the individual spectrograms, takes more time for a larger number of files. In all, requesting a day's worth of PDF spectrograms may 20 to 60 minutes. Please be patient, a day's worth of data is roughly 16 GB of *WAV* files, 500 MB of *MP3{*}s, 160 MB of *PDF{*}s, 200 MB of *PNG{*}s, 100 MB of *MAT{*}s. A single hydrophone can generate terabytes of data in a year. It is a vast amount of data to store and serve to our users.
h5. Calibration

Spectrograms, spectral data and spectral probability density are calibrated to absolute sound pressure level whenever the calibration is available. Calibration data can be found in the device attributes page for each device, e.g. http://dmas.uvic.ca/DeviceListing?DeviceId=23159. Calibrations are time sensitive and frequency specific. For instance, if a 48 kHz hydrophone only has calibration for the first 1600 Hz, then only the calibrated frequency bins will be shown, even though the device is captures signals up to 24 kHz. We will endeavour to calibrate as many hydrophones as possible: the icListen hydrophones in particular are more readily calibrated. When calibration is available, the units on the spectrograms will be dB re 1 uPa RMS and SpectData.isCalibrated in the mat files will be true or 1. When calibration is not available, the units on the spectrograms will be dB re full scale and SpectData.isCalibrated in the mat files will be false or 0. Note that spectrograms produced from *FFT* spectral data are not calibrated.
h3. Revision History

# 20130912: Hydrophone spectrogram *FFT* files initially made publicly available
# 20140123: Spectrogram *PNG*/*PDF* files made available on all hydrophones
# 20140315: Spectrogram images may be produced from *FFT* files
# 20150906: Spectrogram data made available as *MAT* files

h3. Data Product Options


h4. Hydrophone Channel

{include: Hydrophone Channel}

h4. Hydrophone Data Diversion Mode

{include: Hydrophone Data Diversion Mode}

h4. Spectrogram Source

{include: Spectrogram Source}

h3. Format


h5. PNG/PDF (Hydrophone Spectrogram Plot)

This format is a spectrogram plot of 5 minutes of hydrophone/audio data. Here is an example *PNG* spectrogram taken from a hydrophone as Cascadia Basin:

!ICLISTENLF224_20131114T224134.228Z-spect.png|800px,border=1!

Since spectrograms are stored for fast retrieval, users may see older versions (such as the example above), which have different titles, logos, etc., however the data is the same. The colour scale is fixed to facilitate comparisons between multiple spectrograms. Some spectrograms are calibrated with units of dB re 1 μPa. Non-calibrated spectrogram have a colour scale that is relative to the full range of the source audio file: the extreme values in the audio file are scaled from 0 to 1, so that the dB scale is from \-120 dB (0.000001) to 0 dB (1). The spectrogram is generated by a modified Welch method: the data is windowed in time (Hann window 50% overlap) the length of each window is equal to the length of the FFT and the power spectra of each windowed segment is then a column in spectrogram data matrix, the rows are the different frequencies. If calibrated, the calibration range and resolution sets the length of the FFT, while if not calibrated, the length is set by optimizing the trade-off between temporal and spectral resolutions so that the spectrogram data matrix has an aspect ratio that's similar to that of the image file to be generated. Quite often, there are far more columns and rows in the spectrogram data matrix than there are pixels in the image file. In that case, the spectrogram data matrix is downsampled by linear scale box car averaging in both time and frequency to closely match the size of the image in pixels. This occurs after the spectrogram data is calculated, but prior to printing the data to the image file. Standard image renders would distort the logarithmic scale data with linear scale, anti-alias low-pass filtering or averaging, or if not, they would alias the data by decimating it. (There are actually two rendering stages: at image file creation and when the file is printed or displayed on screen, so it is best to view or print spectrograms with as many pixels as in the image file.) This downsampling only occurs for newer versions of the spectrogram data product. Newer versions also have a fixed relationship between time and position on the plot (1 pixel is about 0.3 seconds): if less than 5 minutes of data is provided in the audio source file, the spectrogram will not be stretched to fill the x-axis, but instead the x-axis will be shorter than usual. This will allow us to stitch together spectrograms in our data viewers (to be developed, prototype version exists). Below is an example of the latest version of the spectrogram data product.

!ICLISTENHF1251_20130828T205556.917Z_20130828T210056.917Z-spect.png|800px,border=1!
The *PDF* format contains multiple pages, with each page containing one spectrogram. We recommend this format when users would like to scroll through a large amount data looking for events such as whale calls. *PDF* spectrograms are not normally archived for fast retrieval, so they will be generated on the fly, which will take some time. *PDF* spectrograms do have the advantage of having higher resolution, approximately 300 dpi for landscape letter sized image, while the PNG spectrograms are 1200 by 900 pixels.

h5. FFT (Hydrophone Spectrogram Data File)

The *FFT* format is an ASCII text file with a single column of data. It is intended for expert users, others may refer to the spectrogram PNG/PDF plots. It will only be offered  
Spectrograms can be produced from *WAV* files (described above) or from *FFT* files (described below). Spectrograms generated from *FFT* files have a fixed and generally lower resolution, but have the advantages of not being affected by military diversion and have wider frequency range (*WAV*-sourced spectrograms maybe limited in frequency by their multi-point calibration). Here is an example of a spectrogram generated from an *FFT* file:

!ICLISTENHF1349_20151005T175625.250Z_20151005T180125.250Z-FFT-spect.png|800px,border=1!
h5. FFT (Hydrophone Spectrogram Data File)

The *FFT* format is an ASCII text file with a single column of data. It is intended for expert users, while other users may defer to the spectrogram PNG/PDF plots, which may be made from *FFT* files on user option or when *WAV* files (audio data) is not available (*FFT* files are available when audio data is diverted by the military). *FFT* files are only offered on icListen HF and AF hydrophones and often only for devices with low-bandwidth connections, such as the hydrophone currently at Cambridge Bay (deviceID [instruments:23155]), and icListen HF hydrophones in general to provide coverage when audio data is diverted by the military the hydrophone currently at Cambridge Bay (deviceID [instruments:23155]). The file consists of repeating sequences of 512 FFT spectral coefficients, spanning five minutes. The current sampling rate is 256 kHz, with 4 FFTs per second, or 1200 in one file, with a frequency bin spacing of 250 Hz.  Using MATLAB, one can visualize it (i.e. make a spectrogram) quickly with the following commands:
{noformat}data = dlmRead('myFFTfile.fft', ',');
specData = reshape(data, [512, length(data)/512]);
imagesc((1:size(specData,2))/4, (511:-1:0)*0.250, flipud(specData));
axis xy
xlabel('Time (seconds)');
ylabel('Frequency (kHz)');
cb = colorbar;
ylabel(cb,'(dB re 1 \muPa)');{noformat}
Please note the above stub of MATLAB code is an example only, with hard-coded parameters. Users can retrieve FFT files and process them with this code using our [CodeRunner |http://dmas.uvic.ca/CodeRunner]tool.

h5. MAT (Hydrophone Spectrogram Data File)

The *MAT* file format contains the data used to create the spectrograms, but resampled to one-minute average ensembles (the data is converted from dB to linear, averaged, converted back to dB). The one-minute average ensembles are used as source data for [spectral probability density plots|http://wiki.oceannetworks.ca/display/DP/51]. These files are pre-processed and stored for fast retrieval. If pre-processed *MAT* files do not exist in the archive, then they are created on the fly, which is much slower. On retrieval or on-the-fly generation, there is one small, ~150 kB, *MAT* file per wave or hyd source audio file. For ease of use, the multiple small *MAT* files are then concatenated, with the concatenated *MAT* files breaking on configuration change (exceedingly rare) or on a size limit of approximately 1 GB in memory. The concatenation process applies a weighted average of ensemble periods that overlap between the small *MAT* files, accounting for count and conversion to linear scale and back to dB. 
 
Hydrophone spectral *MAT* files contain two structures, the nominal complex data metadata structure *Meta* and the data: *SpectData*
 
{include: MAT file Metadata structure - Complex}
 
*SpectData*: structure containing hydrophone spectral data in the following fields:
* time: time: vector, timestamp in datenum format.
* frequency: vector of frequency bin centres in Hz.
* PSD: matrix of the power spectral densities of dimensions: (frequency, time). This will always be one-minute box-car/ensemble linear average data.
* countPSD: vector, same length as time. Contains the number of original spectra that contributed to the corresponding one-minute linear average.
* processingComment: string containing a description of the processing steps, including resolutions and calibration information.
* isCalibrated: logical, flag to indicate of the data is calibrated (1 is true, 0 is false, as per matlab logical type).


!hydSpectDataMat.png|border=1!

h2. Discussion

To comment on this product, log in and click _Write a comment..._ below.