Changes between Version 4 and Version 5 of Tone_Generator


Ignore:
Timestamp:
Sep 18, 2008 1:58:12 PM (16 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tone_Generator

    v4 v5  
    88 - {{{PJMEDIA_TONEGEN_SINE}}}: The good-old generation using math's sine(), floating point. This has very good precision but it's the slowest and requires floating point support and linking with the math library. 
    99 - {{{PJMEDIA_TONEGEN_FLOATING_POINT}}}: Floating point approximation of sine(). This has relatively good precision and much faster than plain sine(), but it requires floating-point support and linking with the math library. 
    10  - {{{PJMEDIA_TONEGEN_FIXED_POINT_CORDIC}}} (new in 1.0-rc3): Fixed point using sine signal generated by Cordic algorithm. This algorithm can be tuned to provide balance between precision and performance by tuning the {{{PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP}}} setting, and may be suitable for platforms that lack floating-point support. The default setting for {{{PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP}}} is 8. 
     10 - {{{PJMEDIA_TONEGEN_FIXED_POINT_CORDIC}}} (new in 1.0-rc3): Fixed point using sine signal generated by Cordic algorithm. This algorithm can be tuned to provide balance between precision and performance by tuning the {{{PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP}}} setting, and may be suitable for platforms that lack floating-point support.  
    1111 - {{{PJMEDIA_TONEGEN_FAST_FIXED_POINT}}}: Fast fixed point using some approximation to generate sine waves. The tone generated by this algorithm is not very precise, however the algorithm is very fast. 
    1212 
     
    3131 
    3232|| PJMEDIA_TONEGEN_SINE:[[BR]] [[Image(sine.JPG)]] || PJMEDIA_TONEGEN_FLOATING_POINT:[[BR]] [[Image(float.JPG)]] || 
    33 || PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 16 iterations:[[BR]] [[Image(cordic16.JPG)]] || PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 12 iterations (default):[[BR]][[Image(cordic12.JPG)]] || 
    34 || PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 10 iterations:[[BR]] [[Image(cordic10.JPG)]] || PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 8 iterations (default):[[BR]][[Image(cordic8.JPG)]] || 
     33|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 16 iterations:[[BR]] [[Image(cordic16.JPG)]] || PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 12 iterations:[[BR]][[Image(cordic12.JPG)]] || 
     34|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 10 iterations:[[BR]] [[Image(cordic10.JPG)]] || PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 8 iterations:[[BR]][[Image(cordic8.JPG)]] || 
    3535|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 7 iterations:[[BR]] [[Image(cordic7.JPG)]] || PJMEDIA_TONEGEN_FAST_FIXED_POINT: [[BR]][[Image(fast-fixed-point.JPG)]] || 
    3636 
     
    5252|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 12 iterations || 13,561 || 1.356 || 2.69 || 
    5353|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 10 iterations || 11,662 || 1.166 || 2.31 || 
    54 || PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 8 iterations (default) || 9,872 || 0.987 || 1.95 || 
     54|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 8 iterations || 9,872 || 0.987 || 1.95 || 
    5555|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 7 iterations || 8,943 || 0.894 || 1.77 || 
    5656|| PJMEDIA_TONEGEN_FAST_FIXED_POINT || 1,449 || 0.145 || 0.29 || 
     
    6565|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 12 iterations || 1,140 || 0.114 || 9.24 || 
    6666|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 10 iterations || 998 || 0.100 || 8.09 || 
    67 || PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 8 iterations (default) || 826 || 0.083 || 6.69 || 
     67|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 8 iterations || 826 || 0.083 || 6.69 || 
    6868|| PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 7 iterations || 743 || 0.074 || 6.02 || 
    6969|| PJMEDIA_TONEGEN_FAST_FIXED_POINT || 117 || 0.012 || 0.95 || 
    7070 
     71 
     72== Conclusion == 
     73 
     74Based on the results above, and as of version 1.0-rc3, we set the tone generator settings in {{{pjmedia/config.h}}} as follows: 
     75 - on PC and platforms where floating point '''is''' available: 
     76   {{{ 
     77#define PJMEDIA_TONEGEN_ALG                       PJMEDIA_TONEGEN_FLOATING_POINT 
     78   }}} 
     79 - on platforms where floating point '''is NOT''' available: 
     80   {{{ 
     81#define PJMEDIA_TONEGEN_ALG                       PJMEDIA_TONEGEN_FIXED_POINT_CORDIC 
     82#define PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP   8 
     83   }}} 
     84 
     85These settings of course can be overridden in your {{{config_site.h}}} as usual. 
     86 
     87 
     88 
     89[[BR]] 
     90[[BR]] 
     91