Raven Help Forum  

Go Back   Raven Help Forum > Raven Pro > Raven - New Feature Requests
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-04-2017, 09:34 AM
F.Verbeek F.Verbeek is offline
Junior Member
 
Join Date: Oct 2017
Posts: 6
Arrow Horizontal time slice of spectrogram

I want to be able to measure pulsation rate and intensity of the pulses in several very narrow bands of the spectrum.
The way to do it now is to export the spectrogram data to a text file, import it in excel, find the corresponding columns in the sheet, add the significant columns and make a graph out of it.
Note: time is vertical, frequency is horizontal in the sheet. The number of rows and columns depends on the FFT sample setting.

Is there an easier way?
Reply With Quote
  #2  
Old 10-04-2017, 01:32 PM
Michael Pitzrick Michael Pitzrick is offline
Administrator
 
Join Date: Sep 2008
Posts: 223
Default Re: Horizontal time slice of spectrogram

Quote:
Originally Posted by F.Verbeek View Post
I want to be able to measure pulsation rate and intensity of the pulses in several very narrow bands of the spectrum.
The way to do it now is to export the spectrogram data to a text file, import it in excel, find the corresponding columns in the sheet, add the significant columns and make a graph out of it.
Note: time is vertical, frequency is horizontal in the sheet. The number of rows and columns depends on the FFT sample setting.

Is there an easier way?
Hi F.Verbeek,

I'm not quite clear about why you are exporting spectrograms to estimate pulse rate and intensity. Why not create selections on your pulses and save your selections in a selection table, as described in chapter 6 of the Raven Pro User's Manual? The Manual can be called from the Help menu in Raven Pro, or online at

http://www.birds.cornell.edu/brp/rav...sersManual.pdf

You may also find our new Raven Pro introductory video tutorials helpful:

https://ravenbioacoustics.wixsite.com/raventutorials

You can find the power spectral density for each bin in the spectrogram by hovering over it in the spectrogram view. The power spectral density is reported as "Power" at the bottom of the user interface next to the "Time" and "Frequency" of your mouse pointer. If you have Raven Pro, there are a variety of power-related measurements, many of them described in chapter 6 of the Manual, which can be added to the selections in your selection table.

If creating selections serves to answer your research question, you may find the Band-Limited Energy Detector useful for automatically creating selections. For more details, see Chapter 10 of the Manual.

Please let me know if you have any questions.

-Mike
Reply With Quote
  #3  
Old 10-05-2017, 03:40 AM
F.Verbeek F.Verbeek is offline
Junior Member
 
Join Date: Oct 2017
Posts: 6
Default Re: Horizontal time slice of spectrogram

Thanks for your answer Mike.

Currently the functions "Spectrogam slice view" and Selection Spectrum view both give a graph of intensity vs freq.
Like the title says, I want to see intensity vs time for a specific frequency (range).

I'm trying to diagnose why a burner is making so much noise. The structures are probably the smallest one can see in a spectrograph, just a few buckets high and wide. The number of FFT samples has to be set accurately or one of the directions horizontal or vertical becomes unsharp. (e.g. 1025 gives twice as much frequency bands as 1024 but hardly changes the time resolution)

The noise is roughly organised in three frequency bands. Each band has a number of horizontal lines, several lines consists of dots. Others drown in noise, but still seem to be having some structure. There may be a causal relation between dots of different lines. The frequency may be related to the refresh rate of fuel-air mixture in an internal structure used to pin down the flame. The pulsation-rate with instability, but it is hard to tell.

I tried the hover method before on three lines of a single audio file. It took me hours to write down just the peak intensity and time values of hundreds of dots and display them in graphs. Probably a selection table would do it somewhat faster but it's not always clear whether a point should be counted or not, so the method is subjective.
Besides that, I'm also interested in the values between the peaks especially with the smoothing function.

.. Femme
Reply With Quote
  #4  
Old 10-05-2017, 08:11 AM
Michael Pitzrick Michael Pitzrick is offline
Administrator
 
Join Date: Sep 2008
Posts: 223
Default Re: Horizontal time slice of spectrogram

Hi Femme,

I understand what you are trying to do a little better. A spectrogram displays power spectral density (PSD) in both the time and frequency domains, so is useful in investigating sound intensity vs time. It sounds like you want to employ some objective criterion to determining when PSD is significant, and are finding that the spectrogram slice view and selection spectrum view are of use.

Have you investigated the measurements feature, as described in Chapter 6 of the Manual. For example, "Peak Frequency", "Peak Time", and "Peak Power" report the frequency, the time, and the PSD of the spectrogram bin with the highest PSD within each selection. Are any of these measurements useful if you make selections around sound events of interest?

As you say, selection of spectrogram parameters is critical when making measurements in spectrograms. You may find spectrogram presets useful in applying your optimal set of parameters, once you have determined what it is. Please find tips for optimizing spectrogram parameters below.

-Mike


Adjusting spectrogram parameters and display in Raven Pro
A concise guide

Although the initial default spectrogram that Raven displays when you open a sound file is often acceptable, it can almost always be improved. In most cases, you can get a better image by using spectrogram parameters different from the defaults. Brightness and contrast settings can also make a big difference, as can simply the vertical and horizontal scale.
This document provides tips on how to make these adjustments.

These are basic guidelines to get you started, not religious injunctions. You may want to deviate from the suggestions here for specific reasons. The point is to pay attention to how the spectrogram looks and think about whether it could be improved.

Spectrograms are like shoes— one size does not fit all!

1. Listen

Listen carefully to your sound. Depending on the frequency range or modulation rate, you may find it helpful to listen to the sound played pack slower or faster than normal. Particularly for mid- to high-frequency bird sounds, slowing playback down to ¼ or 1/10 normal speed will often reveal details of structure that you can’t hear at normal speed. If you’re using spectrograms to describe details of sound structure, the spectrogram should show visually all of the details that you can hear.

2. Adjust the vertical and horizontal scale (zoom)

If your sound only occupies part of the frequency band of the spectrogram, zoom in to that band. Why waste part of the image space showing nothing but background? Zoom in time so that you could potentially see all of the details you can hear (at whatever playback rate is most informative).

3. Adjust brightness and contrast (preliminary)

You have a limited range of grayscale values available to you between white and black. Why waste part of that on background noise? Use the brightness / contrast sliders to adjust the image so that the background is mostly white and only the highest-intensity parts of your signal are black. You can do a more careful adjustment later, after adjusting spectrogram parameters.

4. Adjust window size (preliminary)

Using the window size slider in the toolbar, try window sizes both shorter and longer than the default. The goal here is to find a window size that lets you see what you can hear when you listen to the sound at an informative speed, and gives an acceptable tradeoff between sharpness in time and frequency.

Sound Analysis Workshop 20150330
Cornell Bioacoustics Research Program

TIP: If the signal you have open is very long and Raven is slow to make changes to the spectrogram when you change the window size, copy a smaller piece of it (e.g., a single call, song, or syllable) and paste it into a new window. Use this smaller piece to experiment with spectrogram settings more quickly.

5. Turn smoothing off

Turn off spectrogram smoothing (using the button in the toolbar, to the left of the brightness slider). This will enable you to see the individual cells of the spectrogram (if you’re zoomed in enough), which is helpful in the following steps to refine the spectrogram parameters.

6. Adjust spectrogram parameters

6.1 Adjust Frequency Grid Spacing
Remember that Frequency Grid Spacing is determined by DFT Size, which is always a power of 2 (e.g., 256, 512, 1024, etc.). Larger DFT Size results in finer Frequency Grid Size, which determines (a) the vertical dimension of the boxes in an unsmoothed spectrogram, and (b) the precision of frequency measurements. By default Raven chooses the smallest DFT Size that is ≥ the Window Size parameter (in samples). This may result in coarser Frequency Grid Spacing than you want, either for spectrogram image quality or measurement precision. You can adjust the Frequency Grid Spacing to be as fine as you want, but remember that finer grid spacing yields a spectrogram matrix with more cells in it, so it will take longer to recompute, and you might run out of memory. Play around with different settings to find what works.

6.2 Adjust Hop Size
Remember that Hop Size is the width of the boxes in an unsmoothed spectrogram and determines the precision of time measurements. By default Raven displays Hop Size in Samples; switching the units to normal time units (ms or s) is generally more useful. By default Raven determines the Hop Size based on 50% Overlap of the Window Size. Consider using a higher Overlap (e.g., 75% or even higher) to get a better image and more precise measurements.

7. Final adjustment of Window Size

7.1 Lock Hop Size and Frequency Grid Spacing
Remember that by default Raven adjusts the Hop Size and Frequency Grid Spacing in response to changes in Window Size (Hop Size based on the specified % Overlap of spectrogram windows, and Frequency Grid Size is based on the DFT Size which must always be larger than the Window Size). In order to prevent the Hop Size and Frequency Grid Spacing you chose above from changing in the next step, click the Lock icons next to Hop Size and DFT Size. Again, finer resolution means a larger spectrogram matrix that
may be slow to compute or may run out of memory.

7.2 Adjust Window Size one last time
What you’re looking for here is the (subjectively judged) best tradeoff you can find between smearing in the time and frequency dimensions. If you decide you need to change it drastically from the value you selected in step 4 above, you may want to unlock the Hop Size and Frequency Grid Spacing, and just repeat all steps starting at step 4.

8. [optional] Final adjustment of brightness and contrast

To get finer control of the brightness and contrast of the spectrogram image, right-click on the spectrogram image and choose Configure Brightness and Contrast. In the dialog that appears,

1. Adjust the Floor setting so that most of the background of your signal appears as white.
Watch the fainter parts of your signal to make sure they don’t disappear.

2. Adjust the Ceiling so that only the highest-intensity (darkest) parts of your signal are black.


.
Reply With Quote
  #5  
Old 10-06-2017, 09:37 AM
F.Verbeek F.Verbeek is offline
Junior Member
 
Join Date: Oct 2017
Posts: 6
Default Re: Horizontal time slice of spectrogram

Hi Mike,

I advised to buy the pro version, but it takes time before such decisions are made here. Besides that the IT department is allowed to install software from an approved list only. So I installed the Lite version on an old notebook that we use for measurements, not connected to the network.
The only available parameter in Lite is Avg Power density, but this gives only a single number in the selection table. For what I can see in the video's, this is the same for the other functions in the pro-version, so this would not help.

My sound signal is not as clear as a birds-song. It is drowned in noise, but still some features are still audible. Sorry that I can't send any further details, I'm bound by secrecy.
At the right focus, brightness and contrast, the spectrograph contains a number of horizontal lines at fixed frequencies, all between 500 and 3000 Hz. The lines themselves consist of dots (pulsations) which seem to have a more or less constant appearance rate (say once per 0.15s). Also the appearance phase between the pulsations at different lines seems to be constant. Perhaps this would show up in a correlation function. The size of the dots is approximately 40Hz x 60 ms. At the right focus setting this is only approximately 3x3 buckets. The smoothing function helps to see them. Hop frequency and Overlap are not in the lite version.

There is a very useful slider called Focus, which probably just the DFT size. If I move the slider, the value changes
...250,270...512, 548,....971,1050,...
Better would be multiples of 2^n +1
so ..,257,513,1025,2049,...

Right now I am doing statistics on the exported spectrograph data in excel, including FFT and correlation on the pulsation lines. I can see the pulsation rate changing in time, but it is a lot of work.
The export function could be made easier to use if there would be a way to include time and frequency data in the table. Also when it would export just the selected cells. This would bring down the enormous size of the sheets.

What I propose is to add two new view types, just another way of looking at the same data.

1: the horizontal equivalent of "Spectrogram Slice".
The graph shows the spectrogram color vs time rather than vs frequency. Instead of a vertical magenta line marker placed on a certain time, this needs a horizontal marker to be placed on a certain frequency. The marker is already there, but it does not seem to do anything.

2: the horizontal equivalent of "Selection spectrum".
The graph shows the spectrograph buckets averaged over a selected frequency range vs time rather than the spectrograph buckets averaged over a selected time range vs frequency.



.. Femme
Reply With Quote
  #6  
Old 10-06-2017, 10:21 AM
Michael Pitzrick Michael Pitzrick is offline
Administrator
 
Join Date: Sep 2008
Posts: 223
Default Re: Horizontal time slice of spectrogram

Hi Femma,

We'd be happy to send you a free 30-day trial license for Raven Pro. If interested, please address your request to raven_orders@cornell.edu.

BTW, the "Adjust Focus (Spectrogram Window Size)" slider controls what it says, the window size of the STFT. In Raven Lite 2.0, the DFT size is set to the lowest multiple of 2^n which is greater than window size. In Raven Pro, DFT size and window size can be set independently.

Based on what you've said, it is possible that you would find the Band Limited Energy Detector, as described in Chapter 10 of the Manual, to be useful for automatically annotating your narrow-band pulses. The "Peak Time" measurement, as described in Chapter 6 might be useful in identifying the energy maximum with each pulse.

Believe it or not low SNR is also a challenge in our work monitoring populations of endangered and threatened animals and birds by placing autonomous recording units (ARUs) in the field (and in the water)! For those interested in learning about terrestrial and marine ARUs we have for sale and for rent, as well as our other activities, check out Bioacoustics Research Program.

I will pass your suggestions for new sound views on to the developers.

-Mike
Reply With Quote
  #7  
Old 10-09-2017, 02:11 AM
F.Verbeek F.Verbeek is offline
Junior Member
 
Join Date: Oct 2017
Posts: 6
Default Re: Horizontal time slice of spectrogram

Thx Mike,

I'll send in a request for the trial licence.

So far the program has been very helpful in understanding what is going on. Especially the brightness, contrast, focus and zooming are helpful. So any further improvement on this would be welcome.
Is it possible to change the playback speed without changing the pitch, like in Audacity?
.. Femme
Reply With Quote
  #8  
Old 10-09-2017, 08:21 AM
Michael Pitzrick Michael Pitzrick is offline
Administrator
 
Join Date: Sep 2008
Posts: 223
Default Re: Horizontal time slice of spectrogram

Quote:
Originally Posted by F.Verbeek View Post
Thx Mike,

I'll send in a request for the trial licence.

So far the program has been very helpful in understanding what is going on. Especially the brightness, contrast, focus and zooming are helpful. So any further improvement on this would be welcome.
Is it possible to change the playback speed without changing the pitch, like in Audacity?
.. Femme
Hi Femme,

In Raven, changing playback speed will change pitch. This makes it possible to hear infrasound and ultrasound, which is useful for studying whales, dolphins, bats, rodents, and many other organisms that make sounds outside the range of human hearing.

-Mike
Reply With Quote
  #9  
Old 10-12-2017, 09:34 AM
F.Verbeek F.Verbeek is offline
Junior Member
 
Join Date: Oct 2017
Posts: 6
Default Re: Horizontal time slice of spectrogram

It turns out that what I am trying to do is very similar to what is called Cepstrum analysis, only I'm calculating it in a different way. I calculated the FT of a narrow band in the spectrograph logarithmic values, which yields a peak at the periodic frequency of pulsations.
Cepstrum takes the logarithmic magnitude of the Fourier transformed signal and inverses the transformation. This will give information about the periodicity in the spectrum.

Inbetween the two transformations filters (lifters) are applied.
Is there any possibility of doing Cepstrum analysis in Raven?

I think it is completely up your street.
There are plenty of applications for it. Speech pitch analysis, echo elimination, path separation for earthquake signals, diagnostics for machines and gears etc. It is more powerful than auto correlation.


.. Femme
Reply With Quote
  #10  
Old 10-12-2017, 01:01 PM
Michael Pitzrick Michael Pitzrick is offline
Administrator
 
Join Date: Sep 2008
Posts: 223
Default Re: Horizontal time slice of spectrogram

Quote:
Originally Posted by F.Verbeek View Post
It turns out that what I am trying to do is very similar to what is called Cepstrum analysis, only I'm calculating it in a different way. I calculated the FT of a narrow band in the spectrograph logarithmic values, which yields a peak at the periodic frequency of pulsations.
Cepstrum takes the logarithmic magnitude of the Fourier transformed signal and inverses the transformation. This will give information about the periodicity in the spectrum.

Inbetween the two transformations filters (lifters) are applied.
Is there any possibility of doing Cepstrum analysis in Raven?

I think it is completely up your street.
There are plenty of applications for it. Speech pitch analysis, echo elimination, path separation for earthquake signals, diagnostics for machines and gears etc. It is more powerful than auto correlation.


.. Femme
Hi Femme,

I think there's a good chance we will include Cepstrum analysis in Raven 2.0.

-Mike
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 04:14 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.