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

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 21: Line 21:
:;<var>nset</var>:defines the comb bandwidth (+/- ''nset'' points); if ''nset'' equals 0, a variable comb bandwidth is used to remove the detected components; this argument is only used if ''oflag'' equals '''1'''
:;<var>nset</var>:defines the comb bandwidth (+/- ''nset'' points); if ''nset'' equals 0, a variable comb bandwidth is used to remove the detected components; this argument is only used if ''oflag'' equals '''1'''
;Description:
;Description:
#The function extracts the frequency of the test tone ''ft'' from the selected test frequency band (arguments: ''mflag'', ''imin'', ''imax'' and ''rr'').  
#The function extracts the frequency ''ft'' of the test tone from the selected test frequency band (arguments: ''mflag'', ''imin'', ''imax'' and ''rr'').  
#The argument ''ot'' is used to compute the fundamental frequency ''f0'' of the harmonic comb.
#The argument ''ot'' is used to compute the fundamental frequency ''f0'' of the harmonic comb.
#For each frequency band of the harmonic comb is tested if there is a harmonic spectral component or not. The frequency, amplitude and order of the detected harmonic components is saved.
#For each frequency band of the harmonic comb is tested if there is a spectral component (peak) or not. The frequency, amplitude and order of the detected harmonic components are saved.
;Result:  
;Result:  
:*''oflag''=0: The result is a (M+1)x3 matrix, with M is the number of detected harmonics
:*''oflag''=0: The result ''r'' is a (M+1)x3 matrix, with M is the number of detected harmonics
::{class ="einrahmen"
|''r''[0,0] || fundamental frequency ''f0'' (weighted average of component frequencies)
|-
|''r''[0,1], ''r[0,2] || always '''0'''
|-
|''r''[i,0] || frequency of component i (i=1..M)
|-
|''r''[i,1] || amplitude of component i (i=1..M)
|-
|''r''[i,2] || order of component i (i=1..M)
|}
:*''oflag''=1
:*''oflag''=1
;See also: [[../optmm|optmm]], [[../cvphase|cvphase]], [[Programmer_Guide/BScript#MulAc|script application '''MulAc''']]
;See also: [[../optmm|optmm]], [[../cvphase|cvphase]], [[Programmer_Guide/BScript#MulAc|script application '''MulAc''']]


[[../#Functions|<function list>]]
[[../#Functions|<function list>]]

Revision as of 13:19, 20 April 2011

This function implements a methods to detect harmonics in a spectrum and to create a harmonic comb filter. It was especially implemented for the script application MulAc.

Usage
hcomb(mflag, oflag, a, imin, imax, ot, ok, oo, nget, rrms, nrms, nset)
mflag
selects the method used to detect the test tone ft
mflag=0 peak picking
mflag=1 harmonic grid
oflag
selects the format and content of the result (see Result); the values 0 and 1 are supported
a
a vector containing amplitude spectrum (linear, with constant df); in the description below n is the length of a.
imin, imax
index range for test tone (ft) detection; 0 <= imin < imax < n
ot
test tone order (f0 = ft / ot); 0 < ot
ok, oo
order factor and offset for the components of the comp fc[i];
fc[i] = f0 * (oo + ok*i); with: i=1,2,...
nget
the number of points (+/-) to detect the peak of a harmonic component fc[i]; 3 <= nget
rrms
defines the energy ratio threshold for harmonic components; 0 <= rrms < 1
nrms
defines the bandwidth (+/- nrms points) used to compute the energy ratio; 2 <= nrms
(component-rms / testband-rms >= rrms)
nset
defines the comb bandwidth (+/- nset points); if nset equals 0, a variable comb bandwidth is used to remove the detected components; this argument is only used if oflag equals 1
Description
  1. The function extracts the frequency ft of the test tone from the selected test frequency band (arguments: mflag, imin, imax and rr).
  2. The argument ot is used to compute the fundamental frequency f0 of the harmonic comb.
  3. For each frequency band of the harmonic comb is tested if there is a spectral component (peak) or not. The frequency, amplitude and order of the detected harmonic components are saved.
Result
  • oflag=0: The result r is a (M+1)x3 matrix, with M is the number of detected harmonics
{class ="einrahmen"

|r[0,0] || fundamental frequency f0 (weighted average of component frequencies) |- |r[0,1], r[0,2] || always 0 |- |r[i,0] || frequency of component i (i=1..M) |- |r[i,1] || amplitude of component i (i=1..M) |- |r[i,2] || order of component i (i=1..M) |}

  • oflag=1
See also
optmm, cvphase, script application MulAc

<function list>

Navigation menu

Personal tools