Difference between revisions of "Acoustic Analysis"

From Phonlab
Jump to navigationJump to search
Line 1: Line 1:
 
'''Burst detection (burst.py)'''
 
'''Burst detection (burst.py)'''
   
This script does the following things:
+
This script defines a function burst()
   
1) Defines a function burst() which takes as input three arguments: a soundfile, start time, and end time.
+
-- input 1) the name of a soundfile, 2) start time (in seconds), and (3) end time of an analysis window where we will look for a burst.
   
the output is a burst_time (in seconds) and a burst_score which is a measure of how much like a burst the burst is.
+
-- output 1) a burst_time (in seconds), and 2) a burst_score which is a measure of how much like a burst the burst is.
   
2) Resamples sound file to 16,000 Hz.
 
   
  +
The script does the following things:
   
 
1) Resamples sound file to 16,000 Hz.
In the soundfile waveform:
 
   
  +
With the Audio Waveform:
3) Within the window specified by the start and end times, goes through each sample one by one and determines whether it is a peak or valley.
 
   
 
2) within the window specified by the start and end times, goes through each sample and determines whether it is a peak or valley.
4) Finds three biggest valleys in the waveform (corresponding to pressure peaks) within specified time window.
 
   
 
3) Finds three biggest valleys in the waveform (corresponding to pressure peaks) within specified time window.
5) Gives each of these peaks a time-stamped score based on amount of change in waveform relative to neighboring samples
 
   
 
4) Gives each of these peaks a time-stamped score based on amount of change in waveform relative to neighboring samples
   
In the spectragram:
 
   
  +
Compute a series of Mel Frequency Spectra:
6) Now, takes a Mel frequency spectrum with freq above 300 Hz, in 5 ms windows.
 
   
 
5) Now, takes a Mel frequency spectrum with freq above 300 Hz, in 5 ms windows.
7) Compares this window to the next 5 ms spectral window, and selects top three candidates with most change in the spectrum.
 
   
 
6) Compares this window to the next 5 ms spectral window, and selects top three candidates with most change in the spectrum.
8) Compares waveform candidates to spectrum candidates, keeps those where time scores align
 
  +
 
7) Compares waveform candidates to spectrum candidates, keeps those where time scores align
   
   
 
Calculates a burst score (burst strength) for remaining candidates. Using a linear model trained on the burst locations in TIMIT:
 
Calculates a burst score (burst strength) for remaining candidates. Using a linear model trained on the burst locations in TIMIT:
   
10) Selects candidate with highest burst score.
+
8) Selects candidate with highest burst score.
   
11) If no burst is detected, returns a burst score of 0 and a burst_time of -1.
+
9) If no burst is detected, returns a burst score of 0 and a burst_time of -1.

Revision as of 10:11, 26 April 2018

Burst detection (burst.py)

This script defines a function burst()

-- input 1) the name of a soundfile, 2) start time (in seconds), and (3) end time of an analysis window where we will look for a burst.

-- output 1) a burst_time (in seconds), and 2) a burst_score which is a measure of how much like a burst the burst is.


The script does the following things:

1) Resamples sound file to 16,000 Hz.

With the Audio Waveform:

2) within the window specified by the start and end times, goes through each sample and determines whether it is a peak or valley.

3) Finds three biggest valleys in the waveform (corresponding to pressure peaks) within specified time window.

4) Gives each of these peaks a time-stamped score based on amount of change in waveform relative to neighboring samples


Compute a series of Mel Frequency Spectra:

5) Now, takes a Mel frequency spectrum with freq above 300 Hz, in 5 ms windows.

6) Compares this window to the next 5 ms spectral window, and selects top three candidates with most change in the spectrum.

7) Compares waveform candidates to spectrum candidates, keeps those where time scores align


Calculates a burst score (burst strength) for remaining candidates. Using a linear model trained on the burst locations in TIMIT:

8) Selects candidate with highest burst score.

9) If no burst is detected, returns a burst score of 0 and a burst_time of -1.