Changes between Version 4 and Version 5 of Tone_Generator
 Timestamp:
 Sep 18, 2008 1:58:12 PM (12 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

Tone_Generator
v4 v5 8 8  {{{PJMEDIA_TONEGEN_SINE}}}: The goodold 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. 9 9  {{{PJMEDIA_TONEGEN_FLOATING_POINT}}}: Floating point approximation of sine(). This has relatively good precision and much faster than plain sine(), but it requires floatingpoint support and linking with the math library. 10  {{{PJMEDIA_TONEGEN_FIXED_POINT_CORDIC}}} (new in 1.0rc3): 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 floatingpoint support. The default setting for {{{PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP}}} is 8.10  {{{PJMEDIA_TONEGEN_FIXED_POINT_CORDIC}}} (new in 1.0rc3): 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 floatingpoint support. 11 11  {{{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. 12 12 … … 31 31 32 32  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)]]  35 35  PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 7 iterations:[[BR]] [[Image(cordic7.JPG)]]  PJMEDIA_TONEGEN_FAST_FIXED_POINT: [[BR]][[Image(fastfixedpoint.JPG)]]  36 36 … … 52 52  PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 12 iterations  13,561  1.356  2.69  53 53  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  55 55  PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 7 iterations  8,943  0.894  1.77  56 56  PJMEDIA_TONEGEN_FAST_FIXED_POINT  1,449  0.145  0.29  … … 65 65  PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 12 iterations  1,140  0.114  9.24  66 66  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  68 68  PJMEDIA_TONEGEN_FIXED_POINT_CORDIC with 7 iterations  743  0.074  6.02  69 69  PJMEDIA_TONEGEN_FAST_FIXED_POINT  117  0.012  0.95  70 70 71 72 == Conclusion == 73 74 Based on the results above, and as of version 1.0rc3, 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 85 These settings of course can be overridden in your {{{config_site.h}}} as usual. 86 87 88 89 [[BR]] 90 [[BR]] 91