Programmer Guide/Command Reference/EVAL/aseg1: Difference between revisions

From STX Wiki
Jump to navigationJump to search
(initial import)
 
No edit summary
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====aseg1=====
This function implements a simple automatic signal segmentation based on the energy (rms) track of the signal.
----
;Usage 1:<code>aseg1(<var>x</var>, 0, <var>n</var>, <var>m</var>, <var>xmin</var>, <var>omax</var>)</code>
:;<var>x</var>: data vector (usally rms track in dB)
:;<var>n</var>: minimum length of a signal segment in frames; 0 < n < <code>nrow(''x'')</code>
:;<var>m</var>: smoothing length; 0 &le; m</code>; if ''m'' is greater than zero, the segmentation is performed on a smoothed data vector ''xs''.
:::<code>''xs''[i] = avr(''x''[i-m], .., ''x''[i+m]); with: i=0..nrow(''x'')</code>
:;<var>xmin</var>: segment threshhold
:;<var>omax</var>: offset for segment center; 0 < omax
;Description:
:#A segment is a continuous range of ''x'', where all values are greater than ''xmin''
:#The center of a segment is a continuous range of values inside a segment, where all values are greater than ''xmax''-''omax'' (with: ''xmax'' is the maximum value inside the segment).
;Result 1: A matrix ''r'' with 4 rows. Each column of ''r'' defines one segment. Note that all values of ''r'' are frame indices (or row indices) of the data vector ''x''.
::{|class="einrahmen"
|''r''[0,i] || beginning of the segment i
|-
|''r''[1,i] || beginning of the center of the segment i
|-
|''r''[2,i] || end of the center of the segment i
|-
|''r''[3,i] || end of the segment i
|}
::with: i=0..<code>nrow(''r'')</code>
----
;Usage 2:<code>aseg1(<var>x</var>, 1, <var>n</var>, <var>m</var>, <var>xmax</var>, <var>xmin</var>)</code>
:;<var>x</var>: data vector (usally rms track in dB)
:;<var>n</var>: minimum length of a signal segment in frames; 0 < n < <code>nrow(''x'')</code>
:;<var>m</var>: smoothing length; 0 &le; m</code>; if ''m'' is greater than zero, the segmentation is performed on a smoothed data vector ''xs''.
:::<code>''xs''[i] = avr(''x''[i-m], .., ''x''[i+m]); with: i=0..nrow(''x'')</code>
:;<var>xmax</var>: maximum threshold; the maximum value of a segment must be greater than ''xmax''
:;<var>xmin</var>: minimum threshold; all values of a segment must be greater than ''xmin''
;Description: segment detection:
:#find a position ''i'' with ''x''[i]>''xmax''
:#go backward while ''x''[i-j]>''xmin; last index i-j is the segment begin
:#go forward while ''x''[i+k]>''xmin; last index i+k is the segment end
;Result 2: A matrix ''r'' with 2 rows. Each column of ''r'' defines one segment. Note that all values of ''r'' are frame indices (or row indices) of the data vector ''x''.
::{|class="einrahmen"
|''r''[0,i] || beginning of the segment i
|-
|''r''[1,i] || end of the segment i
|}
::with: i=0..<code>nrow(''r'')</code>
----


Automatically segment a signal. Apply automatic segmentation to the vector <var>x</var>.
[[../#Functions|<function list>]]
 
=====Usage:=====
 
<code>aseg1(<var>x</var>, <var>xmin</var>, <var>omin</var>, <var>omax</var>, <var>nmin</var>, <var>navr</var>)</code>
 
=====Parameters:=====
 
;<var>x</var>
 
:A data vector (e.g. an rms function).
 
;<var>xmin</var>
 
:The pause threshold.
 
;<var>omin</var>
 
:The offset for segment detection. E.g. <var>x</var><code>[i] ></code> <var>xmin</var><code>+</code><var>omin</var>.
 
;<var>omax</var>
 
:The offset for the segment center detection. E.g. <var>x</var><code>[i] > max("segment")-</code><var>omax</var>.
 
;<var>nmin</var>
 
:The minimum segment duration in frames. A segment is assigned if the segment condition is true for at least <var>nmin</var> frames.
 
;<var>navr</var>
 
:The averaging length. If <var>navr</var> is greater than <code>0</code> then all elements <var>x</var><code>[i]</code> are replaced by <code>avr(</code><var>x</var><code>[i-</code><var>navr</var> <code>.. i+</code><var>navr</var><code>])</code>.
 
=====Result:=====
 
A matrix (or vector) <code>y</code> with 4 rows and one column for each detected segment. Note that all values of <code>y</code> are frame indices.
 
<code>y[0,i]</code> = The beginning of the segment <code>i</code>.
 
<code>y[1,i]</code> = The beginning of the center of the segment <code>i</code>.
 
<code>y[2,i]</code> = The end of the center of the segment <code>i</code>.
 
<code>y[3,i]</code> = The end of the segment <code>i</code>.

Latest revision as of 09:05, 6 June 2013

This function implements a simple automatic signal segmentation based on the energy (rms) track of the signal.


Usage 1
aseg1(x, 0, n, m, xmin, omax)
x
data vector (usally rms track in dB)
n
minimum length of a signal segment in frames; 0 < n < nrow(x)
m
smoothing length; 0 ≤ m; if m is greater than zero, the segmentation is performed on a smoothed data vector xs.
xs[i] = avr(x[i-m], .., x[i+m]); with: i=0..nrow(x)
xmin
segment threshhold
omax
offset for segment center; 0 < omax
Description
  1. A segment is a continuous range of x, where all values are greater than xmin
  2. The center of a segment is a continuous range of values inside a segment, where all values are greater than xmax-omax (with: xmax is the maximum value inside the segment).
Result 1
A matrix r with 4 rows. Each column of r defines one segment. Note that all values of r are frame indices (or row indices) of the data vector x.
r[0,i] beginning of the segment i
r[1,i] beginning of the center of the segment i
r[2,i] end of the center of the segment i
r[3,i] end of the segment i
with: i=0..nrow(r)

Usage 2
aseg1(x, 1, n, m, xmax, xmin)
x
data vector (usally rms track in dB)
n
minimum length of a signal segment in frames; 0 < n < nrow(x)
m
smoothing length; 0 ≤ m; if m is greater than zero, the segmentation is performed on a smoothed data vector xs.
xs[i] = avr(x[i-m], .., x[i+m]); with: i=0..nrow(x)
xmax
maximum threshold; the maximum value of a segment must be greater than xmax
xmin
minimum threshold; all values of a segment must be greater than xmin
Description
segment detection:
  1. find a position i with x[i]>xmax
  2. go backward while x[i-j]>xmin; last index i-j is the segment begin
  3. go forward while x[i+k]>xmin; last index i+k is the segment end
Result 2
A matrix r with 2 rows. Each column of r defines one segment. Note that all values of r are frame indices (or row indices) of the data vector x.
r[0,i] beginning of the segment i
r[1,i] end of the segment i
with: i=0..nrow(r)

<function list>

Navigation menu

Personal tools