[Asterisk-Dev] zt_tone_def explanation

Karl Brose khb at brose.com
Wed Dec 15 13:10:28 MST 2004


No, not DTMF,  it is used to generate the tone indications (playtones) 
which are either pure frequencies, combinations of two,
or modulated frequencies, see also  zonedata.c and indications.conf


el Flynn wrote:

> hi there,
>
> in the zaptel.h file, i found the following bit of code:
>
>     Calculate the next 6 factors using the following equations:
>     l = <level in dbm>, f1 = <freq1>, f2 = <freq2>
>     gain = pow(10.0, (l - 3.14) / 20.0) * 65536.0 / 2.0;
>
>     // Frequency factor 1
>     fac_1 = 2.0 * cos(2.0 * M_PI * (f1/8000.0)) * 32768.0;
>     // Last previous two samples
>     init_v2_1 = sin(-4.0 * M_PI * (f1/8000.0)) * gain;
>     init_v3_1 = sin(-2.0 * M_PI * (f1/8000.0)) * gain;
>
>     // Frequency factor 2
>     fac_2 = 2.0 * cos(2.0 * M_PI * (f2/8000.0)) * 32768.0;
>     // Last previous two samples
>     init_v2_2 = sin(-4.0 * M_PI * (f2/8000.0)) * gain;
>     init_v3_2 = sin(-2.0 * M_PI * (f2/8000.0)) * gain;
>
> if i'm not mistaken, this has something to do with generating DTMF 
> tones. can someone give more insight on what the init_v2_1, init_v3_1, 
> init_v2_2, init_v3_2 variables are used for?
>
> and also perhaps what this bit of code does? I think it's used in 
> tonezone.c
>
> thanks a bunch.
>
> Flynn
>
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>




More information about the asterisk-dev mailing list