AN2274 Freescale Semiconductor / Motorola, AN2274 Datasheet
![no-image](/images/no-image-200.jpg)
AN2274
Related parts for AN2274
AN2274 Summary of contents
Page 1
... Tone Generator Implementation ............................. 4 2.1 Elementary Components .........................................5 2.2 Tone Cycles............................................................. 6 2.3 Functional Interface ................................................ 6 2.4 Implementation Constraints .................................... 8 2.5 Status Reporting ...................................................... 9 2.6 Tone Generator Code Structure .............................. 9 3 Using and Testing the Generic Tone Generator ....11 3.1 Test Set-up ............................................................11 3.2 Initialization Examples of Multi-Frequency Tones 11 3.3 Tests ......................................................................15 3.4 Examples of Generated Signaling Tones ..............18 3.5 Performance Measurements .................................. 19 4 References .............................................................19 AN2274 ...
Page 2
Digital Sine Wave Generation core of the tone generator (second component) relies on a digital oscillator. We tested this approach with a large number of signaling tones (such as DTMF, MF-R1, MF-R2), and it showed a good compromise in terms ...
Page 3
A digital oscillator requires the following initializations: • The coefficient • The two initial conditions: x(–1) and x(–2) The following table shows the computation of initial conditions: COSINE Initialization ( ) ± – = amplitude coefficient ( ( ...
Page 4
Tone Generator Implementation The actual implementation uses a factorized version of this formula with a finite number of elements and normalized coefficients. A sixth-order polynomial provides sufficient precision for 16-bit coefficients; furthermore, the same polynomial can be used to compute ...
Page 5
Elementary Components The elementary tone component is a pair composed of a sound period followed by a silence period (see Figure 2). This pair (sound + silence) can be repeated as often as needed to yield a component. In ...
Page 6
Tone Generator Implementation • Bit 1: Unit_1 — 0 Frequency1. — 1 Frequency1 divided by 3. • Bit 2: Unit_2 — 0 Frequency2. — 1 Frequency2 divided by 3. • Bit 3: Phase_1 — 0 Frequency1 initialized with 0° phase. ...
Page 7
GEN_CHANNEL containing all channel data for generation. Tone Initialization Used Once Per Tone samples_out Flag fsl_tone_gen returns the following integer flag: • Bit 0 (LSB): Indicates whether tone generation is complete. — 0 ...
Page 8
Tone Generator Implementation • tone_component_count. Number of components in the cycle. • tone_component[5]. An array that contains the description of every component. TONE_COMPONENT parameters are described at the beginning of this section. The TONE_GENERIC structure is not persistent, so the ...
Page 9
Note that the filter state is initialized between two cycles, but not between two occurrences of the same component without silence in between. If only one component is ...
Page 10
Tone Generator Implementation fsl_tone_gen BEGIN Generated Samples = 0 Flag = Not Completed + Buffer Empty Is No sound_duration=0? Yes Is No silence_duration=0? Yes Initialize Next Component in Respect of Cycles and Component Number. Update Flag if Tone is complete. ...
Page 11
Function name: Input: Output: BEGIN FOR (Number of sample to generate/8) IF (sound duration is expired) ELSE END IF END FOR RETURN (Flag) END BEGIN 3 Using and Testing the Generic Tone Generator We integrated and tested the generic tone ...
Page 12
Using and Testing the Generic Tone Generator UINT16 DTMFl[] = {697, 770, 852, 941}; UINT16 DTMFh[] = {1209, 1336, 1477, 1633}; void test_initialize(TONE_GENERIC * testcases) // testcases must point to a 16-item TONE_GENERIC structure { int i, j; for (i ...
Page 13
UINT16 R1[] = {700, 900, 1100, 1300, 1500, 1700}; void test_initialize(TONE_GENERIC * testcases) // testcases must point to a 15-item TONE_GENERIC structure { int for ( < 15; i++) { ...
Page 14
Using and Testing the Generic Tone Generator } // 15 MF-R2 forward direction digits for ( < 6; j++) { } // 15 MF-R2 backward direction digits for ( < 6; j++) { } ...
Page 15
Only one frequency is used - level is initialized to -63db testcases[0].tone_component[1].frequency_2 = 0; testcases[0].tone_component[1].level_2 = NOT_USED; } 3.3 Tests The following MATLAB script displays the FFT of generated tones. A Hanning ...
Page 16
Using and Testing the Generic Tone Generator Example 8. Driver for Generating Time Domain Samples Using ADSFS [5] #include "fsl_tone_gen.h" #define TBUFSZ 4096 #define DTMF //#define MFR1 //#define MFR2 #ifdef DTMF #define NUMBER_OF_TONES 16 #endif #ifdef MFR1 #define NUMBER_OF_TONES 15 ...
Page 17
Table 2. Digital Oscillator Algorithm for DTMF Generation Frequency (Hz) 3.3.2 MF-R2 Frequency Accuracy Test The module capabilities were tested on the most constraining standard for frequency accuracy: MF-R2 signaling defined in the ITU-T Recommendation Q.454 [7]. A deviation of ...
Page 18
Using and Testing the Generic Tone Generator 3.4 Examples of Generated Signaling Tones Figure 7 and Figure 8 illustrate the spectrum of two typical signaling tones. The figures on the left correspond to the FFT magnitude plots of actual data ...
Page 19
Performance Measurements The proposed tone generation module typically requires less than 0.1 MCPS. The worst case would be to change the component every millisecond, but this mode of operation is not used in practice (typical component change intervals are ...
Page 20
... P.O. Box 5405 Denver, Colorado 80217 1-800-441-2447 or 303-675-2140 Fax: 303-675-2150 LDCForFreescaleSemiconductor@hibbertgroup.com AN2274 Rev. 1 12/2004 Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document ...