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 |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 5: | Line 5: | ||
:;<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 | :;<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])</code> | :::<code>''xs''[i] = avr(''x''[i-m], .., ''x''[i+m]); with: i=0..nrow(''x'')</code> | ||
:;<var>xmin</var>: segment threshhold | :;<var>xmin</var>: segment threshhold | ||
:;<var>omax</var>: offset for segment center; 0 < omax | :;<var>omax</var>: offset for segment center; 0 < omax | ||
;Description: | ;Description: | ||
:#A segment is a continuous range of ''x'', where all values are greater than ''xmin'' | :#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). | :#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" | |||
;Result 1 | |''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 | ||
|} | |} | ||
:;<var> | ::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 ≤ 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" | ::{|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> | |||
---- | ---- | ||
[[../#Functions|<function list>]] |
Latest revision as of 08: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
-
- 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, 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:
- 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.
r[0,i] beginning of the segment i r[1,i] end of the segment i
- with: i=0..
nrow(r)
- with: i=0..