Programmer Guide/Command Reference/EVAL/aseg1: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 24: | Line 24: | ||
::with: i=0..<code>nrow(''r'')</code> | ::with: i=0..<code>nrow(''r'')</code> | ||
---- | ---- | ||
;Usage 2:<code>aseg1(<var>x</var>, 0, <var>n</var>, <var>m</var>, <var> | ;Usage 2:<code>aseg1(<var>x</var>, 0, <var>n</var>, <var>m</var>, <var>xmax</var>, <var>xmin</var>)</code> | ||
:;<var>x</var>: data vector (usally rms track in dB) | :;<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>n</var>: minimum length of a signal segment in frames; 0 < n < <code>nrow(''x'')</code> | ||
:;<var>m</var>: smoothing length; 0 <= m</code>; if ''m'' is greater than zero, the segmentation is performed on a smoothed data vector ''xs''. | :;<var>m</var>: smoothing length; 0 <= 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> | :::<code>''xs''[i] = avr(''x''[i-m], .., ''x''[i+m]); with: i=0..nrow(''x'')</code> | ||
:;<var> | :;<var>xmax</var>: maximum threshold; the maximum value of a segment must be greater than ''xmax'' | ||
:;<var> | :;<var>xmin</var>: minimum threshold; all values of a segment must be greater than ''xmin'' | ||
;Description: segment detection: | ;Description: segment detection: | ||
:#find a position ''i'' with ''x''[i]>''xon'' | :#find a position ''i'' with ''x''[i]>''xon'' |
Revision as of 15:15, 12 April 2011
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
-
- 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.
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)
- with: i=0..
- Usage 2
aseg1(x, 0, 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:
- find a position i with x[i]>xon
- go backward while x[i-j]>xoff; last index i-j is the segment begin
- go forward while x[i+k]>xoff; 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[3,i] end of the segment i
- with: i=0..
nrow(r)
- with: i=0..