Prosody speech processing: API: sm_add_input_tone_set

Prototype Definition

int sm_add_input_tone_set(struct sm_input_tone_set_parms *tonesetp)

Parameters

*tonesetp
a structure of the following type:
typedef struct sm_input_tone_set_parms {
	tSMModuleId module;					/* in */
	tSM_INT band1_first_freq_coeffs_id;			/* in */
	tSM_INT band1_freq_count;				/* in */
	tSM_INT band2_first_freq_coeffs_id;			/* in */
	tSM_INT band2_freq_count;				/* in */
	double req_third_peak;					/* in */
	double req_signal_to_noise_ratio;			/* in */
	double req_minimum_power;				/* in */
	double req_twist_for_dual_tone;				/* in */
	tSM_INT id;						/* out */
} SM_INPUT_TONE_SET_PARMS;

Description

This call may be used to define an additional set of simple input tones (recognisable on any input channel) for the specified module module.

The new set of input tones is defined with respect to two sets of possible component frequencies, band 1 and band 2, and various other parameters req_third_peak, req_signal_to_noise_ratio, req_minimum_power and req_twist_for_dual_tone.

Band 1 is comprised of band1_freq_count coefficients whose ids range from: band1_first_freq_coeffs_id to band1_first_freq_coeffs_id + band1_freq_count - 1

Similarly Band 2 is comprised of band2_freq_count coefficients whose ids range from: band2_first_freq_coeffs_id to band2_first_freq_coeffs_id + band2_freq_count - 1

The new set of input tones will consist of all those tones that have a component frequency that is within the limits for a frequency coefficient pair taken from band 1, and another that is within the limits for a frequency coefficient pair taken from band 2.

For example, if band 1 was defined as the set of input frequency coefficient ids {0,1,2,3} and band 2 was defined as {4,5,6,7}, then the defined input tone set would be:

{ <0,4>, <0,5>, <0,6>, <0,7>,
<1,4>, <1,5>, <1,6>, <1,7>,
<2,4>, <2,5>, <2,6>, <2,7>,
<3,4>, <3,5>, <3,6>, <3,7> }

On return id will be set to an identifier for the new set of input tones. This id may be used as a parameter to sm_listen_for() in order to specify the new set of input tones as those to be recognised on an input channel.

If single tones (as opposed to dual tones) are required to be detected, then either band1_freq_count or band2_freq_count should be set to zero. In this case the corresponding band1_first_freq_coeffs_id or band2_first_freq_coeffs_id is ignored.

See Prosody speech processing: pre-loaded input tones for list of predefined input frequency coefficient pairs, and for list of predefined input tone sets. See Prosody - Details of Tone Detection Algorithm for an explanation of the other parameters to this call.

Fields

module
The module to which the tone set is to be added.
band1_first_freq_coeffs_id
One more than the identifier of the first tone in band 1.
band1_freq_count
The number of tones in band 1.
band2_first_freq_coeffs_id
One more than the identifier of the first tone in band 2.
band2_freq_count
The number of tones in band 2.
req_third_peak
The maximum power of the third loudest frequency. If the third frequency exceeds this, then it prevents detection of a tone. This is specified as a factor so, for example, the value 0.1 indicates that the third frequency must be no stronger than a tenth the power of the second frequency.
req_signal_to_noise_ratio
The minimum signal to noise ratio. This is given as a factor to be multiplied by the total power. For example, the value 0.25 means that the detected signal must be more than a quarter of the total received power.
req_minimum_power
The minimum power. For dual tones this is the power of the tone with the lesser amplitude.
req_twist_for_dual_tone
The maximum twist. This is the ratio of power between the two components of a dual tone. For example, a value of 10 means that the stronger must be no more than ten times the power of the weaker.
id
The identifier of this tone set.

Returns

0 if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody speech processing API.