Difference between revisions of "Acoustic Analysis"
Keithjohnson (talk | contribs) (Created page with "Burst detection (burst.py) This script does the following things:") |
|||
Line 2: | Line 2: | ||
This script does the following things: |
This script does the following things: |
||
+ | |||
+ | 1) Defines a function burst() which takes as input three arguments: a soundfile, start time, and end time. |
||
+ | |||
+ | 2) Resamples sound file to 16,000 Hz. |
||
+ | |||
+ | |||
+ | In the soundfile 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. |
||
+ | |||
+ | 4) 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 |
||
+ | |||
+ | In the spectragram: |
||
+ | |||
+ | 6) 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. |
||
+ | |||
+ | 8) Compares waveform candidates to spectrum candidates, keeps those where time scores align |
||
+ | |||
+ | Calculates a burst score (burst strength) for remaining candidates: |
||
+ | |||
+ | 9) This is a linear model trained on the burst locations in TIMIT |
||
+ | |||
+ | 10) |
||
+ | |||
+ | 10) If function does not find a burst, returns a burst_time of -1. |
Revision as of 13:25, 16 April 2018
Burst detection (burst.py)
This script does the following things:
1) Defines a function burst() which takes as input three arguments: a soundfile, start time, and end time.
2) Resamples sound file to 16,000 Hz.
In the soundfile 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.
4) 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
In the spectragram:
6) 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.
8) Compares waveform candidates to spectrum candidates, keeps those where time scores align
Calculates a burst score (burst strength) for remaining candidates:
9) This is a linear model trained on the burst locations in TIMIT
10)
10) If function does not find a burst, returns a burst_time of -1.