AN2274 Freescale Semiconductor / Motorola, AN2274 Datasheet

no-image

AN2274

Manufacturer Part Number
AN2274
Description
Generic Tone Generation on the StarCore SC140 Core
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
© Freescale Semiconductor, Inc., 2002, 2004. All rights reserved.
Freescale Semiconductor
Application Note
The use of DSPs in computationally intensive applications, such
as media gateways, voice over packet networks (VoIP, VoFR,
VoATM), and xDSL modems, has resulted in efficient designs
and systems with tremendous computational power. Most
communication systems require precise tone generation and
detection for functions such as dual tone multiple frequency
(DTMF) signaling, call progress tones, and FAX requesting
tones. The ITU-T Recommendation E.180/Q.35 [1] specifies
the technical characteristics of tones used in most telephone
services available today. Most off-the-shelf components do not
meet the cost, size, and power consumption requirements of
many systems. However, all the required signaling tones rely on
the same basic principle, which can be efficiently implemented
in today’s DSPs. The use of DSPs enables many unrelated tone
protocols to be synthesized with the same firmware and used
across a wide range of tone frequencies.
This application note presents the design, implementation, and
testing of a generic tone generator on the Freescale MSC8101
processor. The first member of the Freescale MSC8100 family
of DSPs, the MSC8101 processor [2] is based on the
StarCore™ SC140 four-ALU DSP core. This device has 512
KB of memory and a Communications Processor Module
(CPM), which make it a versatile device for communication
applications. The proposed module has two major components:
initialization (fsl_tone_gen) and generation
(fsl_tone_gen_init). The first component relies on
polynomial approximation of a cosine for calculating initial
states and coefficients to be used in the second component. The
Generic Tone Generation on the
StarCore™ SC140/SC1400 Cores
By Marc Cougoule, Lúcio F. C. Pessoa, David Melles, Valentin Emiya
CONTENTS
1
1.1
1.2
2
2.1
2.2
2.3
2.4
2.5
2.6
3
3.1
3.2
3.3
3.4
3.5
4
Digital Sine Wave Generation ................................2
Digital Oscillator .....................................................2
Polynomial Approximation..................................... 3
Tone Generator Implementation ............................. 4
Elementary Components .........................................5
Tone Cycles............................................................. 6
Functional Interface ................................................ 6
Implementation Constraints .................................... 8
Status Reporting ...................................................... 9
Tone Generator Code Structure .............................. 9
Using and Testing the Generic Tone Generator ....11
Test Set-up ............................................................11
Initialization Examples of Multi-Frequency Tones 11
Tests ......................................................................15
Examples of Generated Signaling Tones ..............18
Performance Measurements .................................. 19
References .............................................................19
Rev. 1, 12/2004
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 ...

Related keywords