Programmer Guide/Command Reference/EVAL/map2map: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
(Created page with '//----- // Map2Map(Type_s=0, X_m, NCol_v {, PRow_v}) // // Type_s=0 expand all rows to equal length (use linear interpolation) // if PRow_v is specified: map varying r…') |
No edit summary |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
//----- | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
Create a x/y-map with fixed grid (''dx'' and ''dy'' is constant) from a x/y-map with varying grid. This function was implemented to display spectrograms with varying hopsize ''dt'' and frequency resolution ''df''. | |||
---- | |||
;Usage 1:<code>map2map(<var>type</var>, <var>x</var>, <var>nc</var>)</code> | |||
:;<var>type</var>:this argument must be set to '''0'''; it will be used in future to select the format of the input data and/or the remapping algorithm | |||
:;<var>x</var>:a NxM matrix containing the input map | |||
:;<var>nc</var>:a vector with length N; the value ''nc''[i] specifies the number of used columns in the row ''x''[i,*] of the input map | |||
::<code>2 ≤ ''nc''[i] ≤ M; with: i=0..N-1</code> | |||
;Description: Each row i of the input map contains a data vector {''x''[i,0], .., ''x''[''i,''nc''[i]-1]}. A linear interpolation is used to expand all vectors to the length M. | |||
:;Example: ''x'' contains a spectrogram. The spectra are computed with constant hopsize, but different transformation length. The length of each spectrum ''x''[i,*] is stored in ''nc''[i]. | |||
;Result 1:A NxM matrix containing the interpolated map ''y''. | |||
---- | |||
;Usage 2:<code>map2map(<var>type</var>, <var>x</var>, <var>nc</var>, <var>pr</var>)</code> | |||
:;<var>type, x, nc</var>:see '''Usage 1''' | |||
:;<var>pr</var>:a vector with length N; the value ''pr''[i] specifies the relative position of the function stored in the row ''x''[i,*] of the input map. | |||
::<code>''pr''[0] < ''pr''[1] < .. < ''pr''[N-1]</code> | |||
;Description: First the vectors ''x''[i,*] are expanded as described above. In the second step interpolated rows are inserted to create a map with equidistant rows. The number of rows L of the interpolated map ''y'' depends on the range of the ''pr'' values and the minimum distance of two neighboring values of ''pr''. | |||
::<code>L = (''pr''[N-1] - ''pr''[0]) / min(''pr''[i] - ''pr''[i-1])</code> | |||
:;Example: ''x'' contains a spectrogram. The spectra stored in the columns of ''x'' are computed with varying hopsize and transformation length. The length of each spectrum ''x''[i,*] is stored in ''nc''[i] and the value ''pr''[i] is set to the center position of the i-th analysis window. | |||
;Result 2:A LxM matrix containing the interpolated map ''y''. | |||
---- | |||
;See also: [[../rpolyreg|rpolyreg]], [[../qinterp|qinterp]], [[../interp|interp]] | |||
[[../#Functions|<function list>]] |
Latest revision as of 11:17, 21 April 2011
Create a x/y-map with fixed grid (dx and dy is constant) from a x/y-map with varying grid. This function was implemented to display spectrograms with varying hopsize dt and frequency resolution df.
- Usage 1
map2map(type, x, nc)
- type
- this argument must be set to 0; it will be used in future to select the format of the input data and/or the remapping algorithm
- x
- a NxM matrix containing the input map
- nc
- a vector with length N; the value nc[i] specifies the number of used columns in the row x[i,*] of the input map
2 ≤ nc[i] ≤ M; with: i=0..N-1
- Description
- Each row i of the input map contains a data vector {x[i,0], .., x[i,nc[i]-1]}. A linear interpolation is used to expand all vectors to the length M.
- Example
- x contains a spectrogram. The spectra are computed with constant hopsize, but different transformation length. The length of each spectrum x[i,*] is stored in nc[i].
- Result 1
- A NxM matrix containing the interpolated map y.
- Usage 2
map2map(type, x, nc, pr)
- type, x, nc
- see Usage 1
- pr
- a vector with length N; the value pr[i] specifies the relative position of the function stored in the row x[i,*] of the input map.
pr[0] < pr[1] < .. < pr[N-1]
- Description
- First the vectors x[i,*] are expanded as described above. In the second step interpolated rows are inserted to create a map with equidistant rows. The number of rows L of the interpolated map y depends on the range of the pr values and the minimum distance of two neighboring values of pr.
L = (pr[N-1] - pr[0]) / min(pr[i] - pr[i-1])
- Example
- x contains a spectrogram. The spectra stored in the columns of x are computed with varying hopsize and transformation length. The length of each spectrum x[i,*] is stored in nc[i] and the value pr[i] is set to the center position of the i-th analysis window.
- Result 2
- A LxM matrix containing the interpolated map y.