├── AUTHORS ├── COPYING ├── ChangeLog ├── DueDiligence ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── README.testdata ├── aclocal.m4 ├── autogen.sh ├── config-h.in ├── config ├── ax_c99_features.m4 ├── ax_check_export_capability.m4 ├── ax_check_real_file.m4 ├── ax_compiler_vendor.m4 ├── ax_fixed_point_machine.m4 ├── ax_misaligned_access_fails.m4 ├── config.guess ├── config.sub ├── depcomp ├── install-sh ├── ltmain.sh └── missing ├── configure ├── configure.ac ├── debian ├── changelog ├── compat ├── control ├── copyright ├── libspandsp-dev.install ├── libspandsp-doc.install ├── libspandsp6.install ├── rules └── watch ├── doc ├── Makefile.am ├── Makefile.in ├── css.css ├── doxygen.in ├── t38-gateway.dia ├── t38-terminal.dia ├── t38_manual.xml ├── t38_manual │ └── css.css └── wrapper.xsl ├── spandsp-sim ├── Makefile.am ├── Makefile.in ├── g1050.c ├── libspandsp_sim.2005.vcproj ├── libspandsp_sim.2008.vcproj ├── libspandsp_sim.dsp ├── line_model.c ├── make_line_models.c ├── msvc │ ├── make_line_models.2008.vcproj │ ├── msvcproj.foot │ ├── msvcproj.head │ ├── vc8proj.foot │ ├── vc8proj.head │ ├── vc9proj.foot │ └── vc9proj.head ├── rfc2198_sim.c ├── spandsp-sim.h ├── spandsp │ ├── g1050.h │ ├── line_model.h │ ├── line_models.h │ ├── rfc2198_sim.h │ └── test_utils.h └── test_utils.c ├── spandsp.pc ├── spandsp.pc.in ├── spandsp.spec ├── spandsp.spec.in ├── spandsp ├── fax-tests.dtd ├── global-tones.xml ├── tones.dtd └── tsb85.xml ├── src ├── Makefile.am ├── Makefile.in ├── adsi.c ├── async.c ├── at_interpreter.c ├── awgn.c ├── bell_r2_mf.c ├── bert.c ├── bit_operations.c ├── bitstream.c ├── complex_filters.c ├── complex_vector_float.c ├── complex_vector_int.c ├── crc.c ├── dds_float.c ├── dds_int.c ├── dtmf.c ├── echo.c ├── fax.c ├── fax_modems.c ├── faxfont.h ├── filter_tools.c ├── filter_tools.h ├── floating_fudge.h ├── fsk.c ├── g711.c ├── g722.c ├── g726.c ├── gsm0610_decode.c ├── gsm0610_encode.c ├── gsm0610_local.h ├── gsm0610_long_term.c ├── gsm0610_lpc.c ├── gsm0610_preprocess.c ├── gsm0610_rpe.c ├── gsm0610_short_term.c ├── hdlc.c ├── ima_adpcm.c ├── libspandsp.2005.sln ├── libspandsp.2005.vcproj ├── libspandsp.2008.sln ├── libspandsp.2008.vcproj ├── libspandsp.dsp ├── libtiff.2005.vcproj ├── libtiff.2008.vcproj ├── logging.c ├── lpc10_analyse.c ├── lpc10_decode.c ├── lpc10_encdecs.h ├── lpc10_encode.c ├── lpc10_placev.c ├── lpc10_voicing.c ├── make_at_dictionary.c ├── make_modem_filter.c ├── mmx_sse_decs.h ├── modem_connect_tones.c ├── modem_echo.c ├── msvc │ ├── Download_TIFF.2005.vcproj │ ├── Download_TIFF.2008.vcproj │ ├── config.h │ ├── getopt.c │ ├── gettimeofday.c │ ├── inttypes.h │ ├── make_at_dictionary.2005.vcproj │ ├── make_at_dictionary.2008.vcproj │ ├── make_modem_filter.2005.vcproj │ ├── make_modem_filter.2008.vcproj │ ├── msvcproj.foot │ ├── msvcproj.head │ ├── spandsp.h │ ├── sys │ │ └── time.h │ ├── tgmath.h │ ├── tiff │ │ └── cleancount │ ├── unistd.h │ ├── util.vbs │ ├── vc8proj.foot │ ├── vc8proj.head │ ├── vc9proj.foot │ └── vc9proj.head ├── noise.c ├── oki_adpcm.c ├── playout.c ├── plc.c ├── power_meter.c ├── queue.c ├── schedule.c ├── sig_tone.c ├── silence_gen.c ├── spandsp.h.in ├── spandsp │ ├── adsi.h │ ├── arctan2.h │ ├── async.h │ ├── at_interpreter.h │ ├── awgn.h │ ├── bell_r2_mf.h │ ├── bert.h │ ├── biquad.h │ ├── bit_operations.h │ ├── bitstream.h │ ├── complex.h │ ├── complex_filters.h │ ├── complex_vector_float.h │ ├── complex_vector_int.h │ ├── crc.h │ ├── dc_restore.h │ ├── dds.h │ ├── dtmf.h │ ├── echo.h │ ├── expose.h │ ├── fast_convert.h │ ├── fax.h │ ├── fax_modems.h │ ├── fir.h │ ├── fsk.h │ ├── g168models.h │ ├── g711.h │ ├── g722.h │ ├── g726.h │ ├── gsm0610.h │ ├── hdlc.h │ ├── ima_adpcm.h │ ├── logging.h │ ├── lpc10.h │ ├── modem_connect_tones.h │ ├── modem_echo.h │ ├── noise.h │ ├── oki_adpcm.h │ ├── playout.h │ ├── plc.h │ ├── power_meter.h │ ├── private │ │ ├── README │ │ ├── adsi.h │ │ ├── async.h │ │ ├── at_interpreter.h │ │ ├── awgn.h │ │ ├── bell_r2_mf.h │ │ ├── bert.h │ │ ├── bitstream.h │ │ ├── dtmf.h │ │ ├── echo.h │ │ ├── fax.h │ │ ├── fax_modems.h │ │ ├── fsk.h │ │ ├── g711.h │ │ ├── g722.h │ │ ├── g726.h │ │ ├── gsm0610.h │ │ ├── hdlc.h │ │ ├── ima_adpcm.h │ │ ├── logging.h │ │ ├── lpc10.h │ │ ├── modem_connect_tones.h │ │ ├── modem_echo.h │ │ ├── noise.h │ │ ├── oki_adpcm.h │ │ ├── queue.h │ │ ├── schedule.h │ │ ├── sig_tone.h │ │ ├── silence_gen.h │ │ ├── super_tone_rx.h │ │ ├── super_tone_tx.h │ │ ├── swept_tone.h │ │ ├── t30.h │ │ ├── t30_dis_dtc_dcs_bits.h │ │ ├── t31.h │ │ ├── t38_core.h │ │ ├── t38_gateway.h │ │ ├── t38_non_ecm_buffer.h │ │ ├── t38_terminal.h │ │ ├── t4_rx.h │ │ ├── t4_tx.h │ │ ├── time_scale.h │ │ ├── tone_detect.h │ │ ├── tone_generate.h │ │ ├── v17rx.h │ │ ├── v17tx.h │ │ ├── v18.h │ │ ├── v22bis.h │ │ ├── v27ter_rx.h │ │ ├── v27ter_tx.h │ │ ├── v29rx.h │ │ ├── v29tx.h │ │ ├── v42.h │ │ ├── v42bis.h │ │ └── v8.h │ ├── queue.h │ ├── saturated.h │ ├── schedule.h │ ├── sig_tone.h │ ├── silence_gen.h │ ├── super_tone_rx.h │ ├── super_tone_tx.h │ ├── swept_tone.h │ ├── t30.h │ ├── t30_api.h │ ├── t30_fcf.h │ ├── t30_logging.h │ ├── t31.h │ ├── t35.h │ ├── t38_core.h │ ├── t38_gateway.h │ ├── t38_non_ecm_buffer.h │ ├── t38_terminal.h │ ├── t4_rx.h │ ├── t4_tx.h │ ├── telephony.h │ ├── time_scale.h │ ├── timing.h │ ├── tone_detect.h │ ├── tone_generate.h │ ├── v17rx.h │ ├── v17tx.h │ ├── v18.h │ ├── v22bis.h │ ├── v27ter_rx.h │ ├── v27ter_tx.h │ ├── v29rx.h │ ├── v29tx.h │ ├── v42.h │ ├── v42bis.h │ ├── v8.h │ ├── vector_float.h │ ├── vector_int.h │ ├── version.h │ └── version.h.in ├── super_tone_rx.c ├── super_tone_tx.c ├── swept_tone.c ├── t30.c ├── t30_api.c ├── t30_local.h ├── t30_logging.c ├── t31.c ├── t35.c ├── t38_core.c ├── t38_gateway.c ├── t38_non_ecm_buffer.c ├── t38_terminal.c ├── t4_rx.c ├── t4_t6_decode_states.h ├── t4_tx.c ├── testcpuid.c ├── time_scale.c ├── tone_detect.c ├── tone_generate.c ├── v17_v32bis_rx_constellation_maps.h ├── v17_v32bis_tx_constellation_maps.h ├── v17rx.c ├── v17tx.c ├── v18.c ├── v22bis_rx.c ├── v22bis_tx.c ├── v27ter_rx.c ├── v27ter_tx.c ├── v29rx.c ├── v29tx.c ├── v29tx_constellation_maps.h ├── v42.c ├── v42bis.c ├── v8.c ├── vector_float.c └── vector_int.c ├── test-data ├── Makefile.am ├── Makefile.in ├── etsi │ ├── Makefile.am │ ├── Makefile.in │ └── fax │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ └── generate_etsi_300_242_pages.c ├── itu │ ├── Makefile.am │ ├── Makefile.in │ └── fax │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── generate_dithered_tif.c │ │ ├── generate_sized_pages.c │ │ ├── itu1.pbm │ │ ├── itu2.pbm │ │ ├── itu3.pbm │ │ ├── itu4.pbm │ │ ├── itu5.pbm │ │ ├── itu6.pbm │ │ ├── itu7.pbm │ │ ├── itu8.pbm │ │ ├── test1.pbm │ │ ├── test2.pbm │ │ ├── test3.pbm │ │ └── test4.pbm └── local │ ├── Makefile.am │ ├── Makefile.in │ ├── dam9.wav │ ├── dam9_lpc55.wav │ ├── short_nb_voice.wav │ └── short_wb_voice.wav ├── tests ├── Makefile.am ├── Makefile.in ├── adsi_tests.c ├── async_tests.c ├── at_interpreter_tests.c ├── awgn_tests.c ├── bell_mf_rx_tests.c ├── bell_mf_tx_tests.c ├── bert_tests.c ├── bit_operations_tests.c ├── complex_tests.c ├── complex_vector_float_tests.c ├── complex_vector_int_tests.c ├── crc_tests.c ├── dc_restore_tests.c ├── dds_tests.c ├── dtmf_rx_tests.c ├── dtmf_tx_tests.c ├── echo_monitor.cpp ├── echo_monitor.h ├── echo_tests.c ├── fax_decode.c ├── fax_tester.c ├── fax_tester.h ├── fax_tests.c ├── fax_tests.sh ├── fax_utils.c ├── fax_utils.h ├── fsk_tests.c ├── g1050_tests.c ├── g168_tests.c ├── g711_tests.c ├── g722_tests.c ├── g726_tests.c ├── gsm0610_tests.c ├── hdlc_tests.c ├── ima_adpcm_tests.c ├── line_model_monitor.cpp ├── line_model_monitor.h ├── line_model_tests.c ├── logging_tests.c ├── lpc10_tests.c ├── make_g168_css.c ├── media_monitor.cpp ├── media_monitor.h ├── modem_connect_tones_tests.c ├── modem_echo_tests.c ├── modem_monitor.cpp ├── modem_monitor.h ├── msvc │ ├── adsi_tests.vcproj │ ├── complex_tests.vcproj │ ├── complex_vector_float_tests.vcproj │ ├── complex_vector_int_tests.vcproj │ ├── dtmf_rx_tests.vcproj │ ├── dtmf_tx_tests.vcproj │ ├── queue_tests.vcproj │ ├── t38_core_tests.vcproj │ ├── t38_non_ecm_buffer_tests.vcproj │ ├── t38_terminal_tests.vcproj │ ├── v22bis_tests.vcproj │ ├── v29_tests.vcproj │ ├── v80_tests.vcproj │ ├── v8_tests.vcproj │ ├── vector_float_tests.vcproj │ └── vector_int_tests.vcproj ├── noise_tests.c ├── oki_adpcm_tests.c ├── playout_tests.c ├── plc_tests.c ├── power_meter_tests.c ├── queue_tests.c ├── r2_mf_rx_tests.c ├── r2_mf_tx_tests.c ├── regression_tests.sh ├── rfc2198_sim_tests.c ├── schedule_tests.c ├── sig_tone_tests.c ├── super_tone_rx_tests.c ├── super_tone_tx_tests.c ├── swept_tone_tests.c ├── t31_tests.c ├── t38_core_tests.c ├── t38_gateway_tests.c ├── t38_gateway_to_terminal_tests.c ├── t38_non_ecm_buffer_tests.c ├── t38_terminal_tests.c ├── t38_terminal_to_gateway_tests.c ├── t4_tests.c ├── testadsi.c ├── testfax.c ├── time_scale_tests.c ├── tone_detect_tests.c ├── tone_generate_tests.c ├── tsb85_tests.c ├── tsb85_tests.sh ├── v17_tests.c ├── v18_tests.c ├── v22bis_tests.c ├── v27ter_tests.c ├── v29_tests.c ├── v42_tests.c ├── v42bis_tests.c ├── v42bis_tests.sh ├── v8_tests.c ├── vector_float_tests.c └── vector_int_tests.c ├── unpack_g722_data.sh ├── unpack_g726_data.sh ├── unpack_gsm0610_data.sh ├── unpack_v56ter_data.sh └── wrapper.xsl /AUTHORS: -------------------------------------------------------------------------------- 1 | Steve Underwood 2 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 07.08.29 - 0.0.4 - Steve Underwood 2 | - 3 | 4 | 06.05.23 - 0.0.3 - Steve Underwood 5 | - T.38 now implemented, though it needs further polishing. 6 | - G.726 and G.722 now implemented. 7 | 8 | 04.08.29 - 0.0.2 - Steve Underwood 9 | - T.4 no longer uses libtiff for compresion and decompression on the line side 10 | (it is still used to handle the TIFF files). Spandsp no longer depends on 11 | accessing the "internals" of libtiff. New 1D and 2D compression and 12 | decompression code now handles the line side. This should be more robust than 13 | using libtiff, and handles the fudging of bad scan lines rather better. 14 | - T.30 line turn-around timing corrected. 15 | - T.30 DCS header contents corrected. 16 | - T.30 provision for V.17 added, as an option. 17 | - T.30 now has a statistics interface, for applications to find details about 18 | image transfers. 19 | - T.30 processing now correctly closes TIFF files are they have been sent. 20 | - FAX header line insertion is now supported for transmitted FAXes. 21 | - asynchronous serial processing now has a V.14 compatible rate adaption option. 22 | - V.8 modem negotiation module added. 23 | - OKI ADPCM now supports Dialogic compatible operation at 6k samples/second, as 24 | well as 8k samples/second, using its own sample rate converter. 25 | - message queuing added to ease things like T.31 handling 26 | - incomplete skeleton (still rather nasty, to be honest) T.31 processing. 27 | - incomplete skeleton of V.22bis added. There is probably quite a bit to do 28 | to get this complete and robust. It probably requires the T.31 processing 29 | be expanded to something more like V.250, so it doesn't just handle FAX. 30 | - Incomplete V.17 added (there could be an IBM patent related to the TCM part of 31 | V.17, but I think it has expired. Don't distribute binaries of spandsp built 32 | with V.17 enabled until this is resolved - and the modem is completed, of 33 | course :-) ). The current version transmits OK. It receives OK with the 34 | long training sequence, but the symbol and carrier syncing isn't good enough 35 | for robust receiving with the short training sequence. 36 | - A basic BER tester has been added. 37 | - The faster modems now have proper shutdown procedures, whether one is defined in 38 | the spec. or not. 39 | - The modems (except simple FSK) now have APIs to access performance information. 40 | - A common GUI (using FLTK) added for the modem tests. 41 | - A bit more documentation added. 42 | - Some API inconsistencies cleaned up. 43 | - The usual bundle of assorted buglet fixes and polishing. 44 | 45 | 04.04.29 - 0.0.1k - Steve Underwood 46 | - The first version which gives solid faxing for a large number of people. 47 | 48 | -------------------------------------------------------------------------------- /DueDiligence: -------------------------------------------------------------------------------- 1 | Intellectual Property Due Diligence 2 | ----------------------------------- 3 | 4 | Modems and voice coding are heavily patented areas. Implementing these without 5 | serious consideration of IP issues would be foolish. This document describes 6 | the basis on which the software has been implemented. 7 | 8 | 9 | A check of the intellectual property information at the ITU web site shows a 10 | number of patent claims against the current standards implemented by spandsp. 11 | It is important to realise, however, that some of these patents have long 12 | since expired (group III fax dates back to the 1970s). Also, many are 13 | related to recent additions to the FAX standard, such as colour FAX handling, 14 | which few people ever use. 15 | 16 | The V.14 rate adaption standard seems free of patent encumberance. 17 | 18 | One patent is listed as relevant to the V.17 standard. It is a patent from 19 | IBM, but the ITU database does not specify its nature. I believe it is 20 | related to the trellis coding used, and I think it has expired. I do not 21 | know for sure. The techniques used in the implementation should be free of 22 | patent encumberance. Most of the implementation is similar to the V.29 23 | modem. The key addition the trellis code processing. The trellis encoding 24 | is trivial. The decoding uses Viterbi techniques, which are quite old. 25 | 26 | The V.21 standard dates from the 1950s. The V.23 standard is also very old. 27 | There is no possibility that any patents related to it are still in force. 28 | However, the implementation also needs to be free of patented techniques. 29 | The implementation only uses very mature numerical oscillator and quadrature 30 | correlation techniques, so there should be no patent issues. 31 | 32 | Only one patent is listed as relevant to the V.29 standard. This dates from 33 | the 1970s, and must have expired. The modem has been implemented using only 34 | very mature techniques, none of which can be less than 20 years old. There 35 | seem no possibility, therefore, that any patents are still in force related 36 | to the techniques used. 37 | 38 | Some aspect of the V.8 standard seems to have patents associated with it, 39 | according to the ITU patent database. I am unclear what these are. V.8 is a 40 | very simple standard. There seems to be nothing innovative about it. 41 | 42 | Many patents are listed as relevant to the T.30 standard. However, they all 43 | appear to relate to newer features, such as colour FAX, added in recent years. 44 | The current implementation only covers the original features from the late 45 | 1970s, where there appear to be patent issues. 46 | 47 | The T.4 standard defines the image compression and decompression techniques 48 | used for group 3 FAXes. The spandsp implementation is based on code derived 49 | from freely available implementations of T.4. These have existed for a number 50 | of years without IP issues. The standard is old enough for any patents to have 51 | expired, anyway. 52 | 53 | V.42bis compression uses the LZW algorithm. This is the same algorithm used in 54 | GIF files. Unisys patented this algorithm. However, the Unisys patent has now 55 | expired. 56 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## SpanDSP - a series of DSP components for telephony 3 | ## 4 | ## Makefile.am - Process this file with automake to produce Makefile.in 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU Lesser General Public License version 2.1, 8 | ## as published by the Free Software Foundation. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU Lesser General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Lesser General Public 16 | ## License along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ## 19 | ## $Id: Makefile.am,v 1.49 2009/05/30 05:55:22 steveu Exp $ 20 | 21 | AM_CFLAGS = $(COMP_VENDOR_CFLAGS) 22 | AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) 23 | 24 | noinst_SCRIPTS = spandsp.spec 25 | 26 | MAINTAINERCLEANFILES = Makefile.in 27 | 28 | EXTRA_DIST = autogen.sh \ 29 | DueDiligence \ 30 | debian/changelog \ 31 | debian/compat \ 32 | debian/control \ 33 | debian/copyright \ 34 | debian/libspandsp6.install \ 35 | debian/libspandsp-dev.install \ 36 | debian/libspandsp-doc.install \ 37 | debian/rules \ 38 | debian/watch \ 39 | README.testdata \ 40 | spandsp.pc \ 41 | spandsp.spec \ 42 | spandsp/fax-tests.dtd \ 43 | spandsp/global-tones.xml \ 44 | spandsp/tones.dtd \ 45 | spandsp/tsb85.xml \ 46 | unpack_g722_data.sh \ 47 | unpack_g726_data.sh \ 48 | unpack_gsm0610_data.sh \ 49 | unpack_v56ter_data.sh \ 50 | wrapper.xsl 51 | 52 | if COND_DOC 53 | MAYBE_DOC=doc 54 | endif 55 | if COND_TESTDATA 56 | MAYBE_TESTDATA=test-data 57 | endif 58 | if COND_TESTS 59 | MAYBE_TESTDATA=test-data 60 | MAYBE_TESTS=spandsp-sim tests 61 | endif 62 | SUBDIRS = src $(MAYBE_DOC) $(MAYBE_TESTDATA) $(MAYBE_TESTS) 63 | 64 | DIST_SUBDIRS = src doc test-data spandsp-sim tests 65 | 66 | pkgconfigdir = $(libdir)/pkgconfig 67 | pkgconfig_DATA = spandsp.pc 68 | 69 | faq: faq.xml 70 | cd faq ; xsltproc ../wrapper.xsl ../faq.xml 71 | 72 | rpm: rpm-build 73 | 74 | rpm-build: 75 | $(MAKE) -$(MAKEFLAGS) bump.rpm.release 76 | $(MAKE) -$(MAKEFLAGS) dist 77 | rm -rf rpm/BUILD/* 78 | rm -f rpm/RPMS/*/* 79 | rm -f rpm/SOURCES/* 80 | rm -f rpm/SPECS/* 81 | rm -f rpm/SRPMS/* 82 | rpmbuild -ta --sign @PACKAGE@-@VERSION@.tar.gz 83 | 84 | bump.rpm.release: spandsp.spec 85 | VERSION="x"; \ 86 | test -f $(srcdir)/rpm.release && . $(srcdir)/rpm.release; \ 87 | NEXT_RELEASE=0; \ 88 | test "$$VERSION" = "@VERSION@" && NEXT_RELEASE="$$RELEASE"; \ 89 | RELEASE=`expr $$NEXT_RELEASE + 1`; \ 90 | echo "VERSION=@VERSION@" >$(srcdir)/rpm.release; \ 91 | echo "RELEASE=$$RELEASE" >>$(srcdir)/rpm.release; \ 92 | sed 's/^Release: .*/Release: '$$RELEASE'/' \ 93 | spandsp.spec.new; \ 94 | mv spandsp.spec.new spandsp.spec 95 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | No news is good news! -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | spandsp 0.0.5 - A DSP library for telephony 2 | ------------------------------------------- 3 | 4 | SpanDSP is a library of DSP functions for telephony, in the 8000 sample per 5 | second world of E1s, T1s, and higher order PCM channels. It contains low level 6 | functions, such as basic filters. It also contains higher level functions, such 7 | as cadenced supervisory tone detection, and a complete software FAX machine. 8 | The software has been designed to avoid intellectual property issues, using 9 | mature techniques where all relevant patents have expired. See the file 10 | DueDiligence for important information about these intellectual property issues. 11 | 12 | The library is licenced under the LGPL 2.1 licence. The test suite, and some support 13 | programs are licenced under the GPL 2 licence. The full text of these licences can 14 | be found in the file COPYING. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | spandsp depends on various other packages for various tasks. Most of these 20 | dependencies relate to building the test suite. 21 | 22 | libtiff (and libtiff-devel on most Linux distributions) is required to 23 | build the spandsp library. 24 | 25 | libaudiofile (and libaudiofile-devel) is required to build the test suite 26 | fftw (and fftw-devel) is required to build the test suite. Version 2 or 3 of 27 | FFTW may be used. Spandsp adapts to the differences between them. 28 | 29 | fltk (and fltk-devel), Fl_Cartesian and Fl_Audio_Meter are required to build 30 | the test suite with GUI interfaces for some of the tests. The tests will build 31 | without these packages, but the GUI features will not be available. 32 | Fl_Cartesian and Fl_Audio_Meter can be downloaded from 33 | http://www.soft-switch.org/downloads. 34 | 35 | Steve Underwood 36 | -------------------------------------------------------------------------------- /README.testdata: -------------------------------------------------------------------------------- 1 | Setting up test data for the supplied suite of test programs. 2 | ------------------------------------------------------------- 3 | 4 | Some of the tests in the test suite for this package require test data files. These test 5 | data files fall into four categories: 6 | 7 | - Some data files, such as those for some of the FAX tests, are generated by programs 8 | in the package. 9 | 10 | - Some are freely distributable data files, from various sources. These are supplied 11 | with the package. 12 | 13 | - Some are test data files from a standards body. These are the copyright material of 14 | the standards body, and so cannot be distributed with this package. However, most of 15 | these files can currently be downloaded at no charge from the standards body's web 16 | site. This file describes which files are needed, and how they may be processed to 17 | produce the right files in the right places for the tests. 18 | 19 | - The two industry standard sources of test data for DTMF decoders are Bellcore/Telcordia 20 | and Mitel. Neither of these is either free, or supplied in a form directly usable 21 | with the test suite. These data sources are expected by several tests, and not just 22 | the DTMF decoder tests. Sad to say, you are on your own when trying to source data 23 | for these tests. 24 | 25 | For the G.722 tests, obtain the file T-REC-G.722-198703-I!AppII!ZPF-E.zip from the ITU web site, 26 | and place it in this directory. Then run 27 | 28 | ./unpack_g722_data.sh 29 | 30 | For the G.726 tests, obtain the file T-REC-G.726-199103-I!AppII!SOFT-ZST-E.zip from the ITU web 31 | site, and place it in this directory. Then run 32 | 33 | ./unpack_g726_data.sh 34 | 35 | For the GSM 06.10 tests, obtain the file en_300961v080101p0.zip from the ETSI web site, 36 | and place it in this directory. If you are able to run .exe (i.e. MS DOS or Windows) 37 | files you can simply run 38 | 39 | ./unpack_gsm0610_data.sh 40 | 41 | If you are unable to run .exe files on the machine you are using (e.e. you are not using Cygwin, 42 | Mingw, Wine, FreeDOS or something of that sort) you will need to find a machine which will. First, 43 | run 44 | 45 | ./unpack_gsm0610_data.sh --no-exe 46 | 47 | This will leave 6 .EXE files in the etsitetss/gsm0610 directory. Take these to a machine which 48 | can run .EXE files, and execute all of them. This should result in a number of files which end 49 | with .COD, INP and .OUT. Copy these to the etsitests/gsm0610 directory, and run 50 | 51 | ./unpack_gsm0610_data.sh --no-exe-continue 52 | 53 | The remainder of the extraction and repacking of files should then take place. 54 | -------------------------------------------------------------------------------- /config/ax_check_export_capability.m4: -------------------------------------------------------------------------------- 1 | # @synopsis AX_CHECK_EXPORT_CAPABILITY 2 | # 3 | # Does the compiler support the exporting of library symbols? 4 | # @version 1.0 Jan 31 2009 5 | # @author Steve Underwood 6 | # 7 | # Permission to use, copy, modify, distribute, and sell this file for any 8 | # purpose is hereby granted without fee, provided that the above copyright 9 | # and this permission notice appear in all copies. No representations are 10 | # made about the suitability of this software for any purpose. It is 11 | # provided "as is" without express or implied warranty. 12 | 13 | AC_DEFUN([AX_CHECK_EXPORT_CAPABILITY], 14 | [AC_CACHE_CHECK([if $1 supports library symbol export], 15 | ac_cv_symbol_export_capability, 16 | 17 | [# Initialize to unknown 18 | ac_cv_symbol_export_capability="no" 19 | 20 | case "${ax_cv_c_compiler_vendor}" in 21 | gnu) 22 | save_CFLAGS="${CFLAGS}" 23 | CFLAGS="${CFLAGS} -fvisibility=hidden" 24 | AC_COMPILE_IFELSE( 25 | [AC_LANG_PROGRAM( 26 | [int foo __attribute__ ((visibility("default")));], 27 | [;] 28 | )], 29 | 30 | [AC_MSG_RESULT([yes]) 31 | COMP_VENDOR_CFLAGS="-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 $COMP_VENDOR_CFLAGS" 32 | COMP_VENDOR_CXXFLAGS="-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 $COMP_VENDOR_CXXFLAGS" 33 | ac_cv_symbol_export_capability="yes"], 34 | 35 | [AC_MSG_RESULT([no])] 36 | ) 37 | CFLAGS="${save_CFLAGS}" 38 | ;; 39 | 40 | sun) 41 | save_CFLAGS="${CFLAGS}" 42 | CFLAGS="${CFLAGS} -xldscope=hidden" 43 | AC_COMPILE_IFELSE( 44 | [AC_LANG_PROGRAM( 45 | [int foo __attribute__ ((visibility("default")));], 46 | [;] 47 | )], 48 | 49 | [AC_MSG_RESULT([yes]) 50 | COMP_VENDOR_CFLAGS="-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 $COMP_VENDOR_CFLAGS" 51 | COMP_VENDOR_CXXFLAGS="-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 $COMP_VENDOR_CXXFLAGS" 52 | ac_cv_symbol_export_capability="yes"], 53 | 54 | [AC_MSG_RESULT([no])] 55 | ) 56 | CFLAGS="${save_CFLAGS}" 57 | ;; 58 | 59 | esac]) 60 | AS_IF([test AS_VAR_GET(ac_cv_symbol_export_capability) = yes], [$2], [$3])[]dnl 61 | ]) # AX_CHECK_EXPORT_CAPABILITY 62 | -------------------------------------------------------------------------------- /config/ax_check_real_file.m4: -------------------------------------------------------------------------------- 1 | # AX_CHECK_REAL_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 2 | # ------------------------------------------------------------------ 3 | # 4 | # Check for the existence of FILE, and make sure it is a real file or 5 | # directory, and not a symbolic link. 6 | # 7 | AC_DEFUN([AX_CHECK_REAL_FILE], 8 | [AC_DIAGNOSE([cross], 9 | [cannot check for file existence when cross compiling])dnl 10 | AS_VAR_PUSHDEF([ac_RealFile], [ac_cv_real_file_$1])dnl 11 | AC_CACHE_CHECK([for $1], ac_RealFile, 12 | [test "$cross_compiling" = yes && 13 | AC_MSG_ERROR([cannot check for file existence when cross compiling]) 14 | if test -r "$1" 15 | then 16 | if test -h "$1" 17 | then 18 | AS_VAR_SET(ac_RealFile, no) 19 | else 20 | AS_VAR_SET(ac_RealFile, yes) 21 | fi 22 | else 23 | AS_VAR_SET(ac_RealFile, no) 24 | fi]) 25 | AS_IF([test AS_VAR_GET(ac_RealFile) = yes], [$2], [$3])[]dnl 26 | AS_VAR_POPDEF([ac_RealFile])dnl 27 | ])# AX_CHECK_REAL_FILE 28 | -------------------------------------------------------------------------------- /config/ax_compiler_vendor.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://autoconf-archive.cryp.to/ax_compiler_vendor.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_COMPILER_VENDOR 8 | # 9 | # DESCRIPTION 10 | # 11 | # Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, 12 | # hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, 13 | # watcom, etc. The vendor is returned in the cache variable 14 | # $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. 15 | # 16 | # LAST MODIFICATION 17 | # 18 | # 2008-04-12 19 | # 20 | # COPYLEFT 21 | # 22 | # Copyright (c) 2008 Steven G. Johnson 23 | # Copyright (c) 2008 Matteo Frigo 24 | # 25 | # This program is free software: you can redistribute it and/or modify it 26 | # under the terms of the GNU General Public License as published by the 27 | # Free Software Foundation, either version 3 of the License, or (at your 28 | # option) any later version. 29 | # 30 | # This program is distributed in the hope that it will be useful, but 31 | # WITHOUT ANY WARRANTY; without even the implied warranty of 32 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 33 | # Public License for more details. 34 | # 35 | # You should have received a copy of the GNU General Public License along 36 | # with this program. If not, see . 37 | # 38 | # As a special exception, the respective Autoconf Macro's copyright owner 39 | # gives unlimited permission to copy, distribute and modify the configure 40 | # scripts that are the output of Autoconf when processing the Macro. You 41 | # need not follow the terms of the GNU General Public License when using 42 | # or distributing such scripts, even though portions of the text of the 43 | # Macro appear in them. The GNU General Public License (GPL) does govern 44 | # all other use of the material that constitutes the Autoconf Macro. 45 | # 46 | # This special exception to the GPL applies to versions of the Autoconf 47 | # Macro released by the Autoconf Macro Archive. When you make and 48 | # distribute a modified version of the Autoconf Macro, you may extend this 49 | # special exception to the GPL to apply to your modified version as well. 50 | 51 | AC_DEFUN([AX_COMPILER_VENDOR], 52 | [AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, 53 | [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown 54 | # note: don't check for gcc first since some other compilers define __GNUC__ 55 | for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do 56 | vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" 57 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ 58 | #if !($vencpp) 59 | thisisanerror; 60 | #endif 61 | ])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break]) 62 | done 63 | ]) 64 | ]) 65 | -------------------------------------------------------------------------------- /config/ax_fixed_point_machine.m4: -------------------------------------------------------------------------------- 1 | # AX_FIXED_POINT_MACHINE(MACHINE, [ACTION-IF-FIXED-POINT], [ACTION-IF-NOT-FIXED-POINT]) 2 | # ------------------------------------------------------------------------------------- 3 | # 4 | # Check if a specified machine type is a fixed point only machine. That is, if it lacks 5 | # fast floating point support. 6 | # 7 | # This is a simple lookup amongst machines known to the current autotools. So far we deal 8 | # with the embedded ARM, Blackfin, MIPS, TI DSP and XScale processors as things which lack 9 | # fast hardware floating point. 10 | # 11 | # Other candidates would be the small embedded Power PCs. 12 | # 13 | AC_DEFUN([AX_FIXED_POINT_MACHINE], 14 | [AS_VAR_PUSHDEF([ac_FixedPoint], [ac_cv_fixed_point_machine_$1])dnl 15 | AC_CACHE_CHECK([if $1 is fixed point only], ac_FixedPoint, 16 | [case $1 in 17 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] \ 18 | | bfin \ 19 | | mips | mipsbe | mipseb | mipsel | mipsle \ 20 | | tic54x | c54x* | tic55x | c55x* | tic6x | c6x* \ 21 | | xscale | xscalee[bl] \ 22 | | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ 23 | | bfin-* \ 24 | | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ 25 | | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ 26 | | xscale-* | xscalee[bl]-* ) 27 | AS_VAR_SET(ac_FixedPoint, yes) 28 | ;; 29 | *) 30 | AS_VAR_SET(ac_FixedPoint, no) 31 | ;; 32 | esac]) 33 | AS_IF([test AS_VAR_GET(ac_FixedPoint) = yes], [$2], [$3])[]dnl 34 | AS_VAR_POPDEF([ac_FixedPoint])dnl 35 | ])# AX_FIXED_POINT_MACHINE 36 | -------------------------------------------------------------------------------- /config/ax_misaligned_access_fails.m4: -------------------------------------------------------------------------------- 1 | # AX_MISALIGNED_ACCESS_FAILS(MACHINE, [ACTION-IF-MISALIGNED-FAILS], [ACTION-IF-MISALIGNED-OK]) 2 | # ------------------------------------------------------------------------------------- 3 | # 4 | # Check if a specified machine type cannot handle misaligned data. That is, multi-byte data 5 | # types which are not properly aligned in memory fail. Many machines are happy to work with 6 | # misaligned data, but slowing down a bit. Other machines just won't tolerate such data. 7 | # 8 | # This is a simple lookup amongst machines known to the current autotools. So far we only deal 9 | # with the ARM and sparc. 10 | # A lookup is used, as many of the devices which cannot handled misaligned access are embedded 11 | # processors, for which the code normally be cross-compiled. 12 | # 13 | AC_DEFUN([AX_MISALIGNED_ACCESS_FAILS], 14 | [AS_VAR_PUSHDEF([ac_MisalignedAccessFails], [ac_cv_misaligned_access_fails_$1])dnl 15 | AC_CACHE_CHECK([if $1 fails on misaligned memory access], ac_MisalignedAccessFails, 16 | [case $1 in 17 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] \ 18 | | bfin \ 19 | | sparc \ 20 | | xscale | xscalee[bl] \ 21 | | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ 22 | | bfin-* \ 23 | | sparc-* \ 24 | | xscale-* | xscalee[bl]-* ) 25 | AS_VAR_SET(ac_MisalignedAccessFails, yes) 26 | ;; 27 | *) 28 | AS_VAR_SET(ac_MisalignedAccessFails, no) 29 | ;; 30 | esac]) 31 | AS_IF([test AS_VAR_GET(ac_MisalignedAccessFails) = yes], [$2], [$3])[]dnl 32 | AS_VAR_POPDEF([ac_MisalignedAccessFails])dnl 33 | ])# MISALIGNED_ACCESS_FAILS 34 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: spandsp 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Debian VoIP Team 5 | Uploaders: Jose Carlos Garcia Sogo , Kilian Krause , Santiago Garcia Mantinan , Mark Purcell , Tzafrir Cohen , Santiago Ruano Rincón 6 | Build-Depends: debhelper (>= 4.0.0), libtiff4-dev, libjpeg62-dev, dpatch, doxygen, autotools-dev, xsltproc 7 | Standards-Version: 3.7.2 8 | XS-Vcs-Svn: svn://svn.debian.org/pkg-voip/ 9 | XS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-voip/ 10 | 11 | Package: libspandsp6 12 | Architecture: any 13 | Depends: ${shlibs:Depends} 14 | Conflicts: libspandsp0, libspandsp1, libspandsp2 15 | Description: Telephony signal processing library 16 | This is a low-level signal processing library that modulate and demodulate 17 | signals commonly used in telephony, such as the "noise" generated by a 18 | fax modem or DTMF touchpad. 19 | . 20 | This package contains the shared library. 21 | 22 | Package: libspandsp-dev 23 | Section: libdevel 24 | Architecture: any 25 | Depends: libspandsp6 (= ${Source-Version}), libtiff4-dev, libjpeg62-dev 26 | Description: Telephony signal processing library 27 | This is a low-level signal processing library that modulate and demodulate 28 | signals commonly used in telephony, such as the "noise" generated by a 29 | fax modem or DTMF touchpad. 30 | . 31 | This package contains the static library and development headers. 32 | . 33 | Homepage: http://www.soft-switch.org/ 34 | 35 | Package: libspandsp-doc 36 | Section: doc 37 | Architecture: all 38 | Description: Documentation for the spandsp signal processing library 39 | This package contains the online API in HTML for the libspandsp, a low 40 | level signal processing library that modulate and demodulate siignals 41 | commonly used in telephony, such as the "noise" generated by a fax 42 | modem or DTMF touchpad. 43 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Simon Richter on 2 | Sun, 2 Jan 2005 15:22:58 +0100. 3 | 4 | It was downloaded from http://soft-switch.org/downloads/spandsp/ 5 | 6 | Copyright: Steve Underwood 7 | 8 | License: 9 | 10 | This package is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation; version 2 dated June, 1991. 13 | 14 | This package is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License along with 20 | this package; if not, write to the Free Software Foundation, Inc., 21 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 22 | 23 | 24 | On Debian systems, the complete text of the GNU General 25 | Public License can be found in `/usr/share/common-licenses/GPL'. 26 | -------------------------------------------------------------------------------- /debian/libspandsp-dev.install: -------------------------------------------------------------------------------- 1 | debian/tmp/usr/include 2 | debian/tmp/usr/lib/libspandsp.so 3 | debian/tmp/usr/lib/libspandsp.la 4 | debian/tmp/usr/lib/libspandsp.a 5 | -------------------------------------------------------------------------------- /debian/libspandsp-doc.install: -------------------------------------------------------------------------------- 1 | doc/api/html usr/share/doc/libspandsp-doc/api/ 2 | -------------------------------------------------------------------------------- /debian/libspandsp6.install: -------------------------------------------------------------------------------- 1 | debian/tmp/usr/lib*/libspandsp.so.2.* 2 | debian/tmp/usr/lib*/libspandsp.so.2 3 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | # Uncomment this to turn on verbose mode. 4 | #export DH_VERBOSE=1 5 | 6 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) 7 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 8 | 9 | DEBVERSION:=$(shell head -n 1 debian/changelog \ 10 | | sed -e 's/^[^(]*(\([^)]*\)).*/\1/') 11 | ORIGTARVER:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//')# -e 's/.dfsg$$//' -e 's/~//') 12 | 13 | UPVERSION:=$(shell echo $(ORIGTARVER) | tr -d '~') 14 | 15 | FILENAME := spandsp_$(ORIGTARVER).orig.tar.gz 16 | FULLNAME := spandsp-$(UPVERSION) 17 | URL := http://soft-switch.org/downloads/spandsp/spandsp-$(UPVERSION).tgz 18 | 19 | CFLAGS = -Wall -g 20 | 21 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) 22 | CFLAGS += -O0 23 | else 24 | CFLAGS += -O2 25 | endif 26 | 27 | include /usr/share/dpatch/dpatch.make 28 | 29 | 30 | autotools: patch-stamp 31 | ln -s /usr/share/misc/config.sub config.sub 32 | ln -s /usr/share/misc/config.guess config.guess 33 | touch autotools 34 | 35 | config.status: autotools configure 36 | dh_testdir 37 | CFLAGS="$(CFLAGS)" ./configure \ 38 | --host=$(DEB_HOST_GNU_TYPE) \ 39 | --build=$(DEB_BUILD_GNU_TYPE) \ 40 | --prefix=/usr \ 41 | --mandir=\$${prefix}/share/man \ 42 | --infodir=\$${prefix}/share/info \ 43 | --enable-doc 44 | 45 | build: build-stamp 46 | 47 | build-stamp: config.status 48 | dh_testdir 49 | $(MAKE) 50 | touch build-stamp 51 | 52 | clean: clean-patched unpatch 53 | clean-patched: 54 | dh_testdir 55 | dh_testroot 56 | rm -f build-stamp autotools 57 | -$(MAKE) distclean 58 | 59 | -$(RM) -f config.sub 60 | -$(RM) -f config.guess 61 | 62 | dh_clean 63 | 64 | install: build-stamp 65 | dh_testdir 66 | dh_testroot 67 | dh_clean -k 68 | $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp 69 | 70 | binary-indep: build-stamp install 71 | dh_testdir -i 72 | dh_testroot -i 73 | dh_installchangelogs -i ChangeLog 74 | dh_installdocs -i DueDiligence 75 | dh_install -i 76 | dh_compress -i 77 | dh_fixperms -i 78 | dh_installdeb -i 79 | dh_gencontrol -i 80 | dh_md5sums -i 81 | dh_builddeb -i 82 | 83 | binary-arch: build-stamp install 84 | dh_testdir -a 85 | dh_testroot -a 86 | dh_installchangelogs -a ChangeLog 87 | dh_installdocs -a DueDiligence 88 | dh_install -a 89 | dh_strip -a 90 | dh_compress -a 91 | dh_fixperms -a 92 | dh_makeshlibs -a 93 | dh_installdeb -a 94 | dh_shlibdeps -a 95 | dh_gencontrol -a 96 | dh_md5sums -a 97 | dh_builddeb -a 98 | 99 | get-orig-source: 100 | -@@dh_testdir 101 | @@[ -d ../tarballs/. ]||mkdir -p ../tarballs 102 | @@echo Downloading $(FILENAME) from $(URL) ... 103 | @@wget -N -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL) 104 | 105 | binary: binary-indep binary-arch 106 | .PHONY: build clean binary-indep binary-arch binary install patch unpatch 107 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | # See uscan(1) for format 2 | 3 | # Compulsory line, this is a version 3 file 4 | version=3 5 | 6 | # 7 | http://soft-switch.org/downloads/spandsp/ spandsp-(.*)\.tgz debian svn-upgrade 8 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## SpanDSP - a series of DSP components for telephony 3 | ## 4 | ## Makefile.am - Process this file with automake to produce Makefile.in 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU Lesser General Public License version 2.1, 8 | ## as published by the Free Software Foundation. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU Lesser General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Lesser General Public 16 | ## License along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ## 19 | ## $Id: Makefile.am,v 1.12 2008/09/20 15:44:40 steveu Exp $ 20 | 21 | MAINTAINERCLEANFILES = Makefile.in 22 | 23 | EXTRA_DIST = css.css \ 24 | doxygen.in \ 25 | t38-gateway.dia \ 26 | t38-terminal.dia \ 27 | t38_manual.xml \ 28 | wrapper.xsl \ 29 | t38_manual/css.css 30 | 31 | all: doxydocs t38_manual/index.html 32 | 33 | doxydocs: 34 | doxygen doxygen 35 | 36 | t38_manual/index.html: t38_manual.xml 37 | cd t38_manual ; xsltproc ../wrapper.xsl ../t38_manual.xml 38 | 39 | clean: 40 | cd t38_manual ; rm *.html ; cd ../api ; rm -rf html 41 | -------------------------------------------------------------------------------- /doc/t38-gateway.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/doc/t38-gateway.dia -------------------------------------------------------------------------------- /doc/t38-terminal.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/doc/t38-terminal.dia -------------------------------------------------------------------------------- /doc/t38_manual.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/doc/t38_manual.xml -------------------------------------------------------------------------------- /doc/wrapper.xsl: -------------------------------------------------------------------------------- 1 | 3 | 4 | css.css 5 | -------------------------------------------------------------------------------- /spandsp-sim/msvc/make_line_models.2008.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 27 | 30 | 33 | 36 | 39 | 42 | 55 | 58 | 61 | 64 | 71 | 74 | 77 | 80 | 83 | 86 | 89 | 93 | 94 | 95 | 96 | 97 | 98 | 103 | 106 | 107 | 110 | 111 | 112 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /spandsp-sim/msvc/msvcproj.foot: -------------------------------------------------------------------------------- 1 | 2 | # Begin Group "Resource Files" 3 | 4 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 5 | # End Group 6 | # End Target 7 | # End Project 8 | -------------------------------------------------------------------------------- /spandsp-sim/msvc/vc8proj.foot: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /spandsp-sim/msvc/vc8proj.head: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 27 | 42 | 52 | 53 | 62 | 73 | 85 | 86 | 87 | 88 | 89 | 90 | 95 | -------------------------------------------------------------------------------- /spandsp-sim/msvc/vc9proj.foot: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /spandsp-sim/spandsp-sim.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * spandsp-sim.h - The head guy amongst the simulator headers 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2007 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: spandsp-sim.h,v 1.5 2008/04/26 13:39:16 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_SPANDSP_SIM_H_) 31 | #define _SPANDSP_SIM_H_ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | #endif 45 | /*- End of file ------------------------------------------------------------*/ 46 | -------------------------------------------------------------------------------- /spandsp-sim/spandsp/line_models.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * line_model.h - Model a telephone line. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: line_models.h,v 1.3 2008/04/17 18:03:23 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_SPANDSP_LINE_MODELS_H_) 31 | #define _SPANDSP_LINE_MODELS_H_ 32 | 33 | extern float proakis_line_model[]; 34 | extern float ad_1_edd_1_model[]; 35 | extern float ad_1_edd_2_model[]; 36 | extern float ad_1_edd_3_model[]; 37 | extern float ad_5_edd_1_model[]; 38 | extern float ad_5_edd_2_model[]; 39 | extern float ad_5_edd_3_model[]; 40 | extern float ad_6_edd_1_model[]; 41 | extern float ad_6_edd_2_model[]; 42 | extern float ad_6_edd_3_model[]; 43 | extern float ad_7_edd_1_model[]; 44 | extern float ad_7_edd_2_model[]; 45 | extern float ad_7_edd_3_model[]; 46 | extern float ad_8_edd_1_model[]; 47 | extern float ad_8_edd_2_model[]; 48 | extern float ad_8_edd_3_model[]; 49 | extern float ad_9_edd_1_model[]; 50 | extern float ad_9_edd_2_model[]; 51 | extern float ad_9_edd_3_model[]; 52 | 53 | #ifdef __cplusplus 54 | extern "C" 55 | { 56 | #endif 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif 63 | /*- End of file ------------------------------------------------------------*/ 64 | -------------------------------------------------------------------------------- /spandsp-sim/spandsp/rfc2198_sim.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * rfc2198_sim.h - Simulate the behaviour of RFC2198 (or UDPTL) redundancy. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2007 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: rfc2198_sim.h,v 1.6 2009/05/31 14:47:10 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | /*! \page rfc2198_model_page RFC2198 simulation 31 | \section rfc2198_model_page_sec_1 What does it do? 32 | */ 33 | 34 | #if !defined(_RFC2198_SIM_H_) 35 | #define _RFC2198_SIM_H_ 36 | 37 | /*! The definition of an element in the packet queue */ 38 | typedef struct rfc2198_sim_queue_element_s 39 | { 40 | struct rfc2198_sim_queue_element_s *next; 41 | struct rfc2198_sim_queue_element_s *prev; 42 | int seq_no; 43 | double departure_time; 44 | double arrival_time; 45 | int len; 46 | uint8_t pkt[]; 47 | } rfc2198_sim_queue_element_t; 48 | 49 | /*! The model definition for a complete end-to-end path */ 50 | typedef struct 51 | { 52 | int redundancy_depth; 53 | int next_seq_no; 54 | g1050_state_t *g1050; 55 | rfc2198_sim_queue_element_t *first; 56 | rfc2198_sim_queue_element_t *last; 57 | uint8_t tx_pkt[32][1024]; 58 | int tx_pkt_len[32]; 59 | int tx_pkt_seq_no[32]; 60 | int next_pkt; 61 | uint8_t rx_pkt[32][1024]; 62 | int rx_pkt_len[32]; 63 | int rx_pkt_seq_no[32]; 64 | int rx_queued_pkts; 65 | } rfc2198_sim_state_t; 66 | 67 | #ifdef __cplusplus 68 | extern "C" 69 | { 70 | #endif 71 | 72 | SPAN_DECLARE(rfc2198_sim_state_t *) rfc2198_sim_init(int model, 73 | int speed_pattern, 74 | int packet_size, 75 | int packet_rate, 76 | int redundancy_depth); 77 | 78 | SPAN_DECLARE(int) rfc2198_sim_put(rfc2198_sim_state_t *s, 79 | const uint8_t buf[], 80 | int len, 81 | int seq_no, 82 | double departure_time); 83 | 84 | SPAN_DECLARE(int) rfc2198_sim_get(rfc2198_sim_state_t *s, 85 | uint8_t buf[], 86 | int max_len, 87 | double current_time, 88 | int *seq_no, 89 | double *departure_time, 90 | double *arrival_time); 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif 97 | /*- End of file ------------------------------------------------------------*/ 98 | -------------------------------------------------------------------------------- /spandsp-sim/spandsp/test_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * test_utils.h - Utility routines for module tests. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: test_utils.h,v 1.9 2009/05/31 14:47:10 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_TEST_UTILS_H_) 31 | #define _TEST_UTILS_H_ 32 | 33 | #include 34 | 35 | enum 36 | { 37 | MUNGE_CODEC_NONE = 0, 38 | MUNGE_CODEC_ALAW, 39 | MUNGE_CODEC_ULAW, 40 | MUNGE_CODEC_G726_40K, 41 | MUNGE_CODEC_G726_32K, 42 | MUNGE_CODEC_G726_24K, 43 | MUNGE_CODEC_G726_16K, 44 | }; 45 | 46 | typedef struct codec_munge_state_s codec_munge_state_t; 47 | 48 | typedef struct complexify_state_s complexify_state_t; 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | SPAN_DECLARE(complexify_state_t *) complexify_init(void); 55 | 56 | SPAN_DECLARE(void) complexify_release(complexify_state_t *s); 57 | 58 | SPAN_DECLARE(complexf_t) complexify(complexify_state_t *s, int16_t amp); 59 | 60 | SPAN_DECLARE(void) fft(complex_t data[], int len); 61 | 62 | SPAN_DECLARE(void) ifft(complex_t data[], int len); 63 | 64 | SPAN_DECLARE(codec_munge_state_t *) codec_munge_init(int codec, int info); 65 | 66 | SPAN_DECLARE(void) codec_munge_release(codec_munge_state_t *s); 67 | 68 | SPAN_DECLARE(void) codec_munge(codec_munge_state_t *s, int16_t amp[], int len); 69 | 70 | SPAN_DECLARE(SNDFILE *) sf_open_telephony_read(const char *name, int channels); 71 | 72 | SPAN_DECLARE(SNDFILE *) sf_open_telephony_write(const char *name, int channels); 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif 79 | /*- End of file ------------------------------------------------------------*/ 80 | -------------------------------------------------------------------------------- /spandsp.pc: -------------------------------------------------------------------------------- 1 | prefix=/usr 2 | exec_prefix=${prefix} 3 | libdir=$(exec_prefix)/lib64 4 | includedir=${prefix}/include 5 | 6 | Name: spandsp 7 | Description: A DSP library for telephony. 8 | Requires: 9 | Version: 0.0.6 10 | Libs: -L${libdir} -lspandsp -ltiff -lm 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /spandsp.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: spandsp 7 | Description: A DSP library for telephony. 8 | Requires: 9 | Version: @VERSION@ 10 | Libs: -L${libdir} -lspandsp -ltiff -lm 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /spandsp.spec: -------------------------------------------------------------------------------- 1 | Summary: A DSP library for telephony. 2 | Name: spandsp 3 | Version: 0.0.6 4 | Release: 1 5 | License: LGPL 6 | Group: System Environment/Libraries 7 | URL: http://www.soft-switch.org/spandsp 8 | BuildRoot: %{_tmppath}/%{name}-%{version}-root 9 | Source: http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.6.tar.gz 10 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 11 | 12 | BuildRequires: libtiff-devel 13 | BuildRequires: audiofile-devel 14 | BuildRequires: doxygen 15 | # for xsltproc: 16 | BuildRequires: libxslt 17 | 18 | %description 19 | SpanDSP is a library of DSP functions for telephony, in the 8000 20 | sample per second world of E1s, T1s, and higher order PCM channels. It 21 | contains low level functions, such as basic filters. It also contains 22 | higher level functions, such as cadenced supervisory tone detection, 23 | and a complete software FAX machine. The software has been designed to 24 | avoid intellectual property issues, using mature techniques where all 25 | relevant patents have expired. See the file DueDiligence for important 26 | information about these intellectual property issues. 27 | 28 | %package devel 29 | Summary: SpanDSP development files 30 | Group: Development/Libraries 31 | Requires: spandsp = %{version} 32 | Requires: libtiff-devel 33 | PreReq: /sbin/install-info 34 | 35 | %description devel 36 | SpanDSP development files. 37 | 38 | %prep 39 | %setup -q 40 | 41 | %build 42 | %configure --enable-doc --disable-static --disable-rpath 43 | make 44 | 45 | %install 46 | rm -rf %{buildroot} 47 | make install DESTDIR=%{buildroot} 48 | rm %{buildroot}%{_libdir}/libspandsp.la 49 | 50 | %clean 51 | rm -rf %{buildroot} 52 | 53 | %files 54 | %defattr(-,root,root,-) 55 | %doc DueDiligence ChangeLog AUTHORS COPYING NEWS README 56 | 57 | %{_libdir}/libspandsp.so.* 58 | 59 | %files devel 60 | %defattr(-,root,root,-) 61 | %doc doc/api 62 | %{_includedir}/spandsp.h 63 | %{_includedir}/spandsp 64 | %{_libdir}/libspandsp.so 65 | %{_libdir}/pkgconfig/spandsp.pc 66 | 67 | %post -p /sbin/ldconfig 68 | 69 | %postun -p /sbin/ldconfig 70 | 71 | %changelog 72 | * Wed Sep 24 2008 Tzafrir Cohen 0.0.5-1 73 | - Preparing for 0.0.5pre4 release 74 | - License: LGPL 75 | 76 | * Mon Jun 23 2008 Steve Underwood 0.0.5-1 77 | - Cleared out the dependency on libxml2 78 | 79 | * Sun Dec 31 2006 Steve Underwood 0.0.3-1 80 | - Preparing for 0.0.3 release 81 | 82 | * Sat Oct 16 2004 Steve Underwood 0.0.2-1 83 | - Preparing for 0.0.2 release 84 | 85 | * Thu Apr 15 2004 Steve Underwood 0.0.1-1 86 | - Initial version 87 | -------------------------------------------------------------------------------- /spandsp.spec.in: -------------------------------------------------------------------------------- 1 | Summary: A DSP library for telephony. 2 | Name: @PACKAGE@ 3 | Version: @VERSION@ 4 | Release: 1 5 | License: LGPL 6 | Group: System Environment/Libraries 7 | URL: http://www.soft-switch.org/spandsp 8 | BuildRoot: %{_tmppath}/%{name}-%{version}-root 9 | Source: http://www.soft-switch.org/downloads/spandsp/@PACKAGE@-@VERSION@.tar.gz 10 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 11 | 12 | BuildRequires: libtiff-devel 13 | BuildRequires: audiofile-devel 14 | BuildRequires: doxygen 15 | # for xsltproc: 16 | BuildRequires: libxslt 17 | 18 | %description 19 | SpanDSP is a library of DSP functions for telephony, in the 8000 20 | sample per second world of E1s, T1s, and higher order PCM channels. It 21 | contains low level functions, such as basic filters. It also contains 22 | higher level functions, such as cadenced supervisory tone detection, 23 | and a complete software FAX machine. The software has been designed to 24 | avoid intellectual property issues, using mature techniques where all 25 | relevant patents have expired. See the file DueDiligence for important 26 | information about these intellectual property issues. 27 | 28 | %package devel 29 | Summary: SpanDSP development files 30 | Group: Development/Libraries 31 | Requires: spandsp = %{version} 32 | Requires: libtiff-devel 33 | PreReq: /sbin/install-info 34 | 35 | %description devel 36 | SpanDSP development files. 37 | 38 | %prep 39 | %setup -q 40 | 41 | %build 42 | %configure --enable-doc --disable-static --disable-rpath 43 | make 44 | 45 | %install 46 | rm -rf %{buildroot} 47 | make install DESTDIR=%{buildroot} 48 | rm %{buildroot}%{_libdir}/libspandsp.la 49 | 50 | %clean 51 | rm -rf %{buildroot} 52 | 53 | %files 54 | %defattr(-,root,root,-) 55 | %doc DueDiligence ChangeLog AUTHORS COPYING NEWS README 56 | 57 | %{_libdir}/libspandsp.so.* 58 | 59 | %files devel 60 | %defattr(-,root,root,-) 61 | %doc doc/api 62 | %{_includedir}/spandsp.h 63 | %{_includedir}/spandsp 64 | %{_libdir}/libspandsp.so 65 | %{_libdir}/pkgconfig/spandsp.pc 66 | 67 | %post -p /sbin/ldconfig 68 | 69 | %postun -p /sbin/ldconfig 70 | 71 | %changelog 72 | * Wed Sep 24 2008 Tzafrir Cohen 0.0.5-1 73 | - Preparing for 0.0.5pre4 release 74 | - License: LGPL 75 | 76 | * Mon Jun 23 2008 Steve Underwood 0.0.5-1 77 | - Cleared out the dependency on libxml2 78 | 79 | * Sun Dec 31 2006 Steve Underwood 0.0.3-1 80 | - Preparing for 0.0.3 release 81 | 82 | * Sat Oct 16 2004 Steve Underwood 0.0.2-1 83 | - Preparing for 0.0.2 release 84 | 85 | * Thu Apr 15 2004 Steve Underwood 0.0.1-1 86 | - Initial version 87 | -------------------------------------------------------------------------------- /spandsp/fax-tests.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 46 | 47 | 48 | 52 | 53 | -------------------------------------------------------------------------------- /src/filter_tools.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * filter_tools.h - A collection of routines used for filter design. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2008 Steve Underwood 9 | * 10 | * Based on: 11 | * mkshape -- design raised cosine FIR filter 12 | * A.J. Fisher, University of York , November 1996 13 | * 14 | * All rights reserved. 15 | * 16 | * This program is free software; you can redistribute it and/or modify 17 | * it under the terms of the GNU Lesser General Public License version 2.1, 18 | * as published by the Free Software Foundation. 19 | * 20 | * This program is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public 26 | * License along with this program; if not, write to the Free Software 27 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 28 | * 29 | * $Id: filter_tools.h,v 1.3 2008/04/17 14:26:56 steveu Exp $ 30 | */ 31 | 32 | #if !defined(_FILTER_TOOLS_H_) 33 | #define _FILTER_TOOLS_H_ 34 | 35 | #if defined(__cplusplus) 36 | extern "C" 37 | { 38 | #endif 39 | 40 | void ifft(complex_t data[], int len); 41 | void apply_hamming_window(double coeffs[], int len); 42 | void truncate_coeffs(double coeffs[], int len, int bits, int hilbert); 43 | 44 | void compute_raised_cosine_filter(double coeffs[], 45 | int len, 46 | int root, 47 | int sinc_compensate, 48 | double alpha, 49 | double beta); 50 | 51 | void compute_hilbert_transform(double coeffs[], int len); 52 | 53 | 54 | #if defined(__cplusplus) 55 | } 56 | #endif 57 | 58 | #endif 59 | /*- End of file ------------------------------------------------------------*/ 60 | -------------------------------------------------------------------------------- /src/mmx_sse_decs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * mmx_sse_decs.h - Pull in the appropriate systems headers for the MMX/SSE settings. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2009 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: mmx_sse_decs.h,v 1.1 2009/07/12 09:23:09 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_MMX_SSE_DECS_H_) 29 | #define _MMX_SSE_DECS_H_ 30 | 31 | #if defined(SPANDSP_USE_MMX) 32 | #include 33 | #endif 34 | #if defined(SPANDSP_USE_SSE) 35 | #include 36 | #endif 37 | #if defined(SPANDSP_USE_SSE2) 38 | #include 39 | #endif 40 | #if defined(SPANDSP_USE_SSE3) 41 | #include 42 | #endif 43 | #if defined(SPANDSP_USE_SSSE3) 44 | #include 45 | #endif 46 | #if defined(SPANDSP_USE_SSE4_1) 47 | #include 48 | #endif 49 | #if defined(SPANDSP_USE_SSE4_2) 50 | #include 51 | #endif 52 | #if defined(SPANDSP_USE_SSE4A) 53 | #include 54 | #endif 55 | #if defined(SPANDSP_USE_SSE5) 56 | #include 57 | #endif 58 | 59 | #endif 60 | 61 | /*- End of include ---------------------------------------------------------*/ 62 | -------------------------------------------------------------------------------- /src/msvc/Download_TIFF.2005.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 38 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/msvc/Download_TIFF.2008.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 38 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/msvc/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * config.h - a fudge for MSVC, which lacks this header 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Michael Jerris 9 | * 10 | * 11 | * This file is released in the public domain. 12 | * 13 | * $Id: config.h,v 1.4 2009/02/25 15:30:21 steveu Exp $ 14 | */ 15 | 16 | #if !defined(_MSVC_CONFIG_H_) 17 | #define _MSVC_CONFIG_H_ 18 | 19 | #define HAVE_SINF 20 | #define HAVE_COSF 21 | #define HAVE_TANF 22 | #define HAVE_ASINF 23 | #define HAVE_ACOSF 24 | #define HAVE_ATANF 25 | #define HAVE_ATAN2F 26 | #define HAVE_CEILF 27 | #define HAVE_FLOORF 28 | #define HAVE_POWF 29 | #define HAVE_EXPF 30 | #define HAVE_LOGF 31 | #define HAVE_LOG10F 32 | #define HAVE_MATH_H 33 | #define HAVE_TGMATH_H 34 | 35 | #define HAVE_LONG_DOUBLE 36 | #define HAVE_LIBTIFF 37 | 38 | #define SPANDSP_USE_EXPORT_CAPABILITY 1 39 | 40 | #define PACKAGE "spandsp" 41 | #define VERSION "0.0.6" 42 | 43 | /* Win32/DevStudio compatibility stuff */ 44 | 45 | #ifdef _MSC_VER 46 | 47 | #if (_MSC_VER >= 1400) // VC8+ 48 | #ifndef _CRT_SECURE_NO_DEPRECATE 49 | #define _CRT_SECURE_NO_DEPRECATE 50 | #endif 51 | #ifndef _CRT_NONSTDC_NO_DEPRECATE 52 | #define _CRT_NONSTDC_NO_DEPRECATE 53 | #endif 54 | #ifndef _CRT_SECURE_NO_WARNINGS 55 | #define _CRT_SECURE_NO_WARNINGS 56 | #endif 57 | #endif // VC8+ 58 | 59 | // disable the following warnings 60 | #pragma warning(disable:4100) // The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored. 61 | #pragma warning(disable:4200) // Non standard extension C zero sized array 62 | #pragma warning(disable:4706) // assignment within conditional expression 63 | #pragma warning(disable:4244) // conversion from 'type1' to 'type2', possible loss of data 64 | #pragma warning(disable:4295) // array is too small to include a terminating null character 65 | #pragma warning(disable:4125) // decimal digit terminates octal escape sequence 66 | #pragma warning(disable:4305) // 'function' : truncation from 'double' to 'float' 67 | #pragma warning(disable:4018) // '<' : signed/unsigned mismatch 68 | #pragma warning(disable:4389) // '==' : signed/unsigned mismatch 69 | #pragma warning(disable:4245) // 'return' : conversion from 'int' to 'size_t', signed/unsigned mismatch 70 | 71 | #define strncasecmp _strnicmp 72 | #define strcasecmp _stricmp 73 | #define snprintf _snprintf 74 | #define inline __inline 75 | #define __inline__ __inline 76 | 77 | #define _MMX_H_ 78 | 79 | #include // To get alloca 80 | 81 | #endif 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /src/msvc/gettimeofday.c: -------------------------------------------------------------------------------- 1 | #ifdef _MSC_VER 2 | #pragma warning(disable:4100) 3 | #endif 4 | 5 | #include "windows.h" 6 | 7 | void gettimeofday(struct timeval *tv, void *tz) 8 | { 9 | long int l = GetTickCount(); 10 | 11 | tv->tv_sec = l / 1000; 12 | tv->tv_usec = (l % 1000) * 1000; 13 | return; 14 | } 15 | -------------------------------------------------------------------------------- /src/msvc/inttypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * inttypes.h - a fudge for MSVC, which lacks this header 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Michael Jerris 9 | * 10 | * 11 | * This file is released in the public domain. 12 | * 13 | */ 14 | 15 | #if !defined(_INTTYPES_H_) 16 | #define _INTTYPES_H_ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | typedef __int8 __int8_t; 23 | typedef __int16 __int16_t; 24 | typedef __int32 __int32_t; 25 | typedef __int64 __int64_t; 26 | 27 | typedef unsigned __int8 uint8_t; 28 | typedef unsigned __int16 uint16_t; 29 | typedef unsigned __int32 uint32_t; 30 | typedef unsigned __int64 uint64_t; 31 | typedef __int8 int8_t; 32 | typedef __int16 int16_t; 33 | typedef __int32 int32_t; 34 | typedef __int64 int64_t; 35 | 36 | #define INT16_MAX 0x7FFF 37 | #define INT16_MIN (-INT16_MAX - 1) 38 | 39 | #if !defined(INFINITY) 40 | #define INFINITY 0x7FFFFFFF 41 | #endif 42 | 43 | #define INT32_MAX (2147483647) 44 | #define INT32_MIN (-2147483647 - 1) 45 | 46 | #define PRId8 "d" 47 | #define PRId16 "d" 48 | #define PRId32 "ld" 49 | #define PRId64 "lld" 50 | 51 | #define PRIu8 "u" 52 | #define PRIu16 "u" 53 | #define PRIu32 "lu" 54 | #define PRIu64 "llu" 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/msvc/make_at_dictionary.2005.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 26 | 29 | 32 | 35 | 38 | 41 | 54 | 57 | 60 | 63 | 70 | 73 | 76 | 79 | 82 | 85 | 88 | 91 | 95 | 96 | 97 | 98 | 99 | 100 | 105 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /src/msvc/make_at_dictionary.2008.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 27 | 30 | 33 | 36 | 39 | 42 | 55 | 58 | 61 | 64 | 71 | 74 | 77 | 80 | 83 | 86 | 89 | 93 | 94 | 95 | 96 | 97 | 98 | 103 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /src/msvc/msvcproj.foot: -------------------------------------------------------------------------------- 1 | 2 | # Begin Group "Resource Files" 3 | 4 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 5 | # End Group 6 | # End Target 7 | # End Project 8 | -------------------------------------------------------------------------------- /src/msvc/sys/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * sys/time.h - a fudge for MSVC, which lacks this header 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Michael Jerris 9 | * 10 | * 11 | * This file is released in the public domain. 12 | * 13 | */ 14 | 15 | struct timeval 16 | { 17 | long int tv_sec; 18 | long int tv_usec; 19 | }; 20 | 21 | extern void gettimeofday(struct timeval *tv, void *tz); 22 | -------------------------------------------------------------------------------- /src/msvc/tgmath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * tgmath.h - a fudge for MSVC, which lacks this header 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Michael Jerris 9 | * 10 | * 11 | * This file is released in the public domain. 12 | * 13 | */ 14 | 15 | #if !defined(_TGMATH_H_) 16 | #define _TGMATH_H_ 17 | 18 | #include 19 | 20 | #if !defined(M_PI) 21 | /* C99 systems may not define M_PI */ 22 | #define M_PI 3.14159265358979323846264338327 23 | #endif 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/msvc/tiff/cleancount: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /src/msvc/unistd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * unistd.h - a fudge for MSVC, which lacks this header 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Michael Jerris 9 | * 10 | * 11 | * This file is released in the public domain. 12 | * 13 | */ 14 | 15 | #if !defined(_UNISTD_H_) 16 | #define _UNISTD_H_ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | // Declare this so we don't have to include winsock.h, it causes numerous conflicts. 23 | extern int __stdcall gethostname(char * name, int namelen); 24 | #pragma comment(lib, "ws2_32.lib") 25 | 26 | extern int getopt(int argc, char *argv[], char *opstring); 27 | 28 | extern char *optarg; 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/msvc/vc8proj.foot: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 14 | 15 | 18 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/msvc/vc8proj.head: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 27 | 42 | 52 | 53 | 62 | 73 | 85 | 86 | 87 | 88 | 89 | 90 | 95 | -------------------------------------------------------------------------------- /src/msvc/vc9proj.foot: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 14 | 15 | 18 | 24 | 25 | 28 | 34 | 35 | 38 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/spandsp/arctan2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * arctan2.h - A quick rough approximate arc tan 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2003 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: arctan2.h,v 1.13 2008/05/29 13:04:19 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_SPANDSP_ARCTAN2_H_) 31 | #define _SPANDSP_ARCTAN2_H_ 32 | 33 | /*! \page arctan2_page Fast approximate four quadrant arc-tangent 34 | \section arctan2_page_sec_1 What does it do? 35 | This module provides a fast approximate 4-quadrant arc tangent function, 36 | based on something at dspguru.com. The worst case error is about 4.07 degrees. 37 | This is fine for many "where am I" type evaluations in comms. work. 38 | 39 | \section arctan2_page_sec_2 How does it work? 40 | ???. 41 | */ 42 | 43 | #if defined(__cplusplus) 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /* This returns its answer as a signed 32 bit integer phase value. */ 49 | static __inline__ int32_t arctan2(float y, float x) 50 | { 51 | float abs_y; 52 | float angle; 53 | 54 | if (x == 0.0f || y == 0.0f) 55 | return 0; 56 | 57 | abs_y = fabsf(y); 58 | 59 | /* If we are in quadrant II or III, flip things around */ 60 | if (x < 0.0f) 61 | angle = 3.0f - (x + abs_y)/(abs_y - x); 62 | else 63 | angle = 1.0f - (x - abs_y)/(abs_y + x); 64 | angle *= 536870912.0f; 65 | 66 | /* If we are in quadrant III or IV, negate to return an 67 | answer in the range +-pi */ 68 | if (y < 0.0f) 69 | angle = -angle; 70 | return (int32_t) angle; 71 | } 72 | /*- End of function --------------------------------------------------------*/ 73 | 74 | #if 0 75 | /* This returns its answer in radians, in the range +-pi. */ 76 | static __inline__ float arctan2f(float y, float x) 77 | { 78 | float angle; 79 | float fx; 80 | float fy; 81 | 82 | if (x == 0.0f || y == 0.0f) 83 | return 0; 84 | fx = fabsf(x); 85 | fy = fabsf(y); 86 | /* Deal with the octants */ 87 | /* N.B. 0.28125 == (1/4 + 1/32) */ 88 | if (fy > fx) 89 | angle = 3.1415926f/2.0f - fx*fy/(y*y + 0.28125f*x*x); 90 | else 91 | angle = fy*fx/(x*x + 0.28125f*y*y); 92 | 93 | /* Deal with the quadrants, to bring the final answer to the range +-pi */ 94 | if (x < 0.0f) 95 | angle = 3.1415926f - angle; 96 | if (y < 0.0f) 97 | angle = -angle; 98 | return angle; 99 | } 100 | /*- End of function --------------------------------------------------------*/ 101 | #endif 102 | 103 | #if defined(__cplusplus) 104 | } 105 | #endif 106 | 107 | #endif 108 | /*- End of file ------------------------------------------------------------*/ 109 | -------------------------------------------------------------------------------- /src/spandsp/biquad.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * biquad.h - General telephony bi-quad section routines (currently this just 5 | * handles canonic/type 2 form) 6 | * 7 | * Written by Steve Underwood 8 | * 9 | * Copyright (C) 2001 Steve Underwood 10 | * 11 | * All rights reserved. 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU Lesser General Public License version 2.1, 15 | * as published by the Free Software Foundation. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Lesser General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Lesser General Public 23 | * License along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 | * 26 | * $Id: biquad.h,v 1.14 2008/04/17 14:26:59 steveu Exp $ 27 | */ 28 | 29 | /*! \page biquad_page Bi-quadratic filter sections 30 | \section biquad_page_sec_1 What does it do? 31 | ???. 32 | 33 | \section biquad_page_sec_2 How does it work? 34 | ???. 35 | */ 36 | 37 | #if !defined(_SPANDSP_BIQUAD_H_) 38 | #define _SPANDSP_BIQUAD_H_ 39 | 40 | typedef struct 41 | { 42 | int32_t gain; 43 | int32_t a1; 44 | int32_t a2; 45 | int32_t b1; 46 | int32_t b2; 47 | 48 | int32_t z1; 49 | int32_t z2; 50 | 51 | #if FIRST_ORDER_NOISE_SHAPING 52 | int32_t residue; 53 | #elif SECOND_ORDER_NOISE_SHAPING 54 | int32_t residue1; 55 | int32_t residue2; 56 | #endif 57 | } biquad2_state_t; 58 | 59 | #if defined(__cplusplus) 60 | extern "C" 61 | { 62 | #endif 63 | 64 | static __inline__ void biquad2_init(biquad2_state_t *bq, 65 | int32_t gain, 66 | int32_t a1, 67 | int32_t a2, 68 | int32_t b1, 69 | int32_t b2) 70 | { 71 | bq->gain = gain; 72 | bq->a1 = a1; 73 | bq->a2 = a2; 74 | bq->b1 = b1; 75 | bq->b2 = b2; 76 | 77 | bq->z1 = 0; 78 | bq->z2 = 0; 79 | 80 | #if FIRST_ORDER_NOISE_SHAPING 81 | bq->residue = 0; 82 | #elif SECOND_ORDER_NOISE_SHAPING 83 | bq->residue1 = 0; 84 | bq->residue2 = 0; 85 | #endif 86 | } 87 | /*- End of function --------------------------------------------------------*/ 88 | 89 | static __inline__ int16_t biquad2(biquad2_state_t *bq, int16_t sample) 90 | { 91 | int32_t y; 92 | int32_t z0; 93 | 94 | z0 = sample*bq->gain + bq->z1*bq->a1 + bq->z2*bq->a2; 95 | y = z0 + bq->z1*bq->b1 + bq->z2*bq->b2; 96 | 97 | bq->z2 = bq->z1; 98 | bq->z1 = z0 >> 15; 99 | #if FIRST_ORDER_NOISE_SHAPING 100 | y += bq->residue; 101 | bq->residue = y & 0x7FFF; 102 | #elif SECOND_ORDER_NOISE_SHAPING 103 | y += (2*bq->residue1 - bq->residue2); 104 | bq->residue2 = bq->residue1; 105 | bq->residue1 = y & 0x7FFF; 106 | #endif 107 | y >>= 15; 108 | return (int16_t) y; 109 | } 110 | /*- End of function --------------------------------------------------------*/ 111 | 112 | #if defined(__cplusplus) 113 | } 114 | #endif 115 | 116 | #endif 117 | /*- End of file ------------------------------------------------------------*/ 118 | -------------------------------------------------------------------------------- /src/spandsp/bitstream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * bitstream.h - Bitstream composition and decomposition routines. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: bitstream.h,v 1.14.4.1 2009/12/28 12:20:47 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_SPANDSP_BITSTREAM_H_) 31 | #define _SPANDSP_BITSTREAM_H_ 32 | 33 | /*! \page bitstream_page Bitstream composition and decomposition 34 | \section bitstream_page_sec_1 What does it do? 35 | 36 | \section bitstream_page_sec_2 How does it work? 37 | */ 38 | 39 | /*! Bitstream handler state */ 40 | typedef struct bitstream_state_s bitstream_state_t; 41 | 42 | #if defined(__cplusplus) 43 | extern "C" 44 | { 45 | #endif 46 | 47 | /*! \brief Put a chunk of bits into the output buffer. 48 | \param s A pointer to the bitstream context. 49 | \param c A pointer to the bitstream output buffer. 50 | \param value The value to be pushed into the output buffer. 51 | \param bits The number of bits of value to be pushed. 1 to 25 bits is valid. */ 52 | SPAN_DECLARE(void) bitstream_put(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits); 53 | 54 | /*! \brief Get a chunk of bits from the input buffer. 55 | \param s A pointer to the bitstream context. 56 | \param c A pointer to the bitstream input buffer. 57 | \param bits The number of bits of value to be grabbed. 1 to 25 bits is valid. 58 | \return The value retrieved from the input buffer. */ 59 | SPAN_DECLARE(uint32_t) bitstream_get(bitstream_state_t *s, const uint8_t **c, int bits); 60 | 61 | /*! \brief Flush any residual bit to the output buffer. 62 | \param s A pointer to the bitstream context. 63 | \param c A pointer to the bitstream output buffer. */ 64 | SPAN_DECLARE(void) bitstream_flush(bitstream_state_t *s, uint8_t **c); 65 | 66 | /*! \brief Initialise a bitstream context. 67 | \param s A pointer to the bitstream context. 68 | \param lsb_first TRUE if the bit stream is LSB first, else its MSB first. 69 | \return A pointer to the bitstream context. */ 70 | SPAN_DECLARE(bitstream_state_t *) bitstream_init(bitstream_state_t *s, int direction); 71 | 72 | SPAN_DECLARE(int) bitstream_release(bitstream_state_t *s); 73 | 74 | SPAN_DECLARE(int) bitstream_free(bitstream_state_t *s); 75 | 76 | #if defined(__cplusplus) 77 | } 78 | #endif 79 | 80 | #endif 81 | /*- End of file ------------------------------------------------------------*/ 82 | -------------------------------------------------------------------------------- /src/spandsp/complex_filters.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * complex_filters.h 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2003 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: complex_filters.h,v 1.14 2009/02/03 16:28:41 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_COMPLEX_FILTERS_H_) 29 | #define _SPANDSP_COMPLEX_FILTERS_H_ 30 | 31 | typedef struct filter_s filter_t; 32 | 33 | typedef float (*filter_step_func_t)(filter_t *fi, float x); 34 | 35 | /*! Filter state */ 36 | typedef struct 37 | { 38 | int nz; 39 | int np; 40 | filter_step_func_t fsf; 41 | } fspec_t; 42 | 43 | struct filter_s 44 | { 45 | fspec_t *fs; 46 | float sum; 47 | int ptr; /* Only for moving average filters */ 48 | float v[]; 49 | }; 50 | 51 | typedef struct 52 | { 53 | filter_t *ref; 54 | filter_t *imf; 55 | } cfilter_t; 56 | 57 | #if defined(__cplusplus) 58 | extern "C" 59 | { 60 | #endif 61 | 62 | SPAN_DECLARE(filter_t *) filter_create(fspec_t *fs); 63 | SPAN_DECLARE(void) filter_delete(filter_t *fi); 64 | SPAN_DECLARE(float) filter_step(filter_t *fi, float x); 65 | 66 | SPAN_DECLARE(cfilter_t *) cfilter_create(fspec_t *fs); 67 | SPAN_DECLARE(void) cfilter_delete(cfilter_t *cfi); 68 | SPAN_DECLARE(complexf_t) cfilter_step(cfilter_t *cfi, const complexf_t *z); 69 | 70 | #if defined(__cplusplus) 71 | } 72 | #endif 73 | 74 | #endif 75 | /*- End of file ------------------------------------------------------------*/ 76 | -------------------------------------------------------------------------------- /src/spandsp/dc_restore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * dc_restore.h - General telephony routines to restore the zero D.C. 5 | * level to audio which has a D.C. bias. 6 | * 7 | * Written by Steve Underwood 8 | * 9 | * Copyright (C) 2001 Steve Underwood 10 | * 11 | * All rights reserved. 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU Lesser General Public License version 2.1, 15 | * as published by the Free Software Foundation. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Lesser General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Lesser General Public 23 | * License along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 | * 26 | * $Id: dc_restore.h,v 1.24 2008/09/19 14:02:05 steveu Exp $ 27 | */ 28 | 29 | /*! \file */ 30 | 31 | #if !defined(_SPANDSP_DC_RESTORE_H_) 32 | #define _SPANDSP_DC_RESTORE_H_ 33 | 34 | /*! \page dc_restore_page Removing DC bias from a signal 35 | 36 | \section dc_restore_page_sec_1 What does it do? 37 | 38 | Telecoms signals often contain considerable DC, but DC upsets a lot of signal 39 | processing functions. Placing a zero DC restorer at the front of the processing 40 | chain can often simplify the downstream processing. 41 | 42 | \section dc_restore_page_sec_2 How does it work? 43 | 44 | The DC restorer uses a leaky integrator to provide a long-ish term estimate of 45 | the DC bias in the signal. A 32 bit estimate is used for the 16 bit audio, so 46 | the noise introduced by the estimation can be keep in the lower bits, and the 16 47 | bit DC value, which is subtracted from the signal, is fairly clean. The 48 | following code fragment shows the algorithm used. dc_bias is a 32 bit integer, 49 | while the sample and the resulting clean_sample are 16 bit integers. 50 | 51 | dc_bias += ((((int32_t) sample << 15) - dc_bias) >> 14); 52 | clean_sample = sample - (dc_bias >> 15); 53 | */ 54 | 55 | /*! 56 | Zero DC restoration descriptor. This defines the working state for a single 57 | instance of DC content filter. 58 | */ 59 | typedef struct 60 | { 61 | int32_t state; 62 | } dc_restore_state_t; 63 | 64 | #if defined(__cplusplus) 65 | extern "C" 66 | { 67 | #endif 68 | 69 | static __inline__ void dc_restore_init(dc_restore_state_t *dc) 70 | { 71 | dc->state = 0; 72 | } 73 | /*- End of function --------------------------------------------------------*/ 74 | 75 | static __inline__ int16_t dc_restore(dc_restore_state_t *dc, int16_t sample) 76 | { 77 | dc->state += ((((int32_t) sample << 15) - dc->state) >> 14); 78 | return (int16_t) (sample - (dc->state >> 15)); 79 | } 80 | /*- End of function --------------------------------------------------------*/ 81 | 82 | static __inline__ int16_t dc_restore_estimate(dc_restore_state_t *dc) 83 | { 84 | return (int16_t) (dc->state >> 15); 85 | } 86 | /*- End of function --------------------------------------------------------*/ 87 | 88 | #if defined(__cplusplus) 89 | } 90 | #endif 91 | 92 | #endif 93 | /*- End of file ------------------------------------------------------------*/ 94 | -------------------------------------------------------------------------------- /src/spandsp/expose.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * expose.h - Expose the internal structures of spandsp, for users who 5 | * really need that. 6 | * 7 | * Written by Steve Underwood 8 | * 9 | * Copyright (C) 2008 Steve Underwood 10 | * 11 | * All rights reserved. 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU Lesser General Public License version 2.1, 15 | * as published by the Free Software Foundation. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Lesser General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Lesser General Public 23 | * License along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 | * 26 | * $Id: expose.h,v 1.14.4.1 2009/12/19 09:47:56 steveu Exp $ 27 | */ 28 | 29 | /*! \file */ 30 | 31 | /* TRY TO ONLY INCLUDE THIS IF YOU REALLY REALLY HAVE TO */ 32 | 33 | #if !defined(_SPANDSP_EXPOSE_H_) 34 | #define _SPANDSP_EXPOSE_H_ 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | #include 84 | #include 85 | #include 86 | #include 87 | #include 88 | 89 | #endif 90 | /*- End of file ------------------------------------------------------------*/ 91 | -------------------------------------------------------------------------------- /src/spandsp/noise.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/src/spandsp/noise.h -------------------------------------------------------------------------------- /src/spandsp/private/README: -------------------------------------------------------------------------------- 1 | The header files in this directory should only be used by code tightly integrating itself with the 2 | spandsp library to maximise performance. To maximise compatibility with futures revisions of spandsp, 3 | most users should avoid using these headers, or probing into the spandsp data structures in other ways. -------------------------------------------------------------------------------- /src/spandsp/private/adsi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/adsi.h - Analogue display services interface and other call ID related handling. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2003 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: adsi.h,v 1.4 2009/04/12 04:20:01 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_SPANDSP_PRIVATE_ADSI_H_) 31 | #define _SPANDSP_PRIVATE_ADSI_H_ 32 | 33 | /*! 34 | ADSI transmitter descriptor. This contains all the state information for an ADSI 35 | (caller ID, CLASS, CLIP, ACLIP) transmit channel. 36 | */ 37 | struct adsi_tx_state_s 38 | { 39 | /*! */ 40 | int standard; 41 | 42 | /*! */ 43 | tone_gen_descriptor_t alert_tone_desc; 44 | /*! */ 45 | tone_gen_state_t alert_tone_gen; 46 | /*! */ 47 | fsk_tx_state_t fsktx; 48 | /*! */ 49 | dtmf_tx_state_t dtmftx; 50 | /*! */ 51 | async_tx_state_t asynctx; 52 | 53 | /*! */ 54 | int tx_signal_on; 55 | 56 | /*! */ 57 | int byte_no; 58 | /*! */ 59 | int bit_pos; 60 | /*! */ 61 | int bit_no; 62 | /*! */ 63 | uint8_t msg[256]; 64 | /*! */ 65 | int msg_len; 66 | /*! */ 67 | int preamble_len; 68 | /*! */ 69 | int preamble_ones_len; 70 | /*! */ 71 | int postamble_ones_len; 72 | /*! */ 73 | int stop_bits; 74 | /*! */ 75 | int baudot_shift; 76 | 77 | /*! */ 78 | logging_state_t logging; 79 | }; 80 | 81 | /*! 82 | ADSI receiver descriptor. This contains all the state information for an ADSI 83 | (caller ID, CLASS, CLIP, ACLIP, JCLIP) receive channel. 84 | */ 85 | struct adsi_rx_state_s 86 | { 87 | /*! */ 88 | int standard; 89 | /*! */ 90 | put_msg_func_t put_msg; 91 | /*! */ 92 | void *user_data; 93 | 94 | /*! */ 95 | fsk_rx_state_t fskrx; 96 | /*! */ 97 | dtmf_rx_state_t dtmfrx; 98 | 99 | /*! */ 100 | int consecutive_ones; 101 | /*! */ 102 | int bit_pos; 103 | /*! */ 104 | int in_progress; 105 | /*! */ 106 | uint8_t msg[256]; 107 | /*! */ 108 | int msg_len; 109 | /*! */ 110 | int baudot_shift; 111 | 112 | /*! A count of the framing errors. */ 113 | int framing_errors; 114 | 115 | /*! */ 116 | logging_state_t logging; 117 | }; 118 | 119 | #endif 120 | /*- End of file ------------------------------------------------------------*/ 121 | -------------------------------------------------------------------------------- /src/spandsp/private/async.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/async.h - Asynchronous serial bit stream encoding and decoding 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2003 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: async.h,v 1.1 2008/11/30 10:17:31 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_ASYNC_H_) 29 | #define _SPANDSP_PRIVATE_ASYNC_H_ 30 | 31 | /*! 32 | Asynchronous data transmit descriptor. This defines the state of a single 33 | working instance of a byte to asynchronous serial converter, for use 34 | in FSK modems. 35 | */ 36 | struct async_tx_state_s 37 | { 38 | /*! \brief The number of data bits per character. */ 39 | int data_bits; 40 | /*! \brief The type of parity. */ 41 | int parity; 42 | /*! \brief The number of stop bits per character. */ 43 | int stop_bits; 44 | /*! \brief A pointer to the callback routine used to get characters to be transmitted. */ 45 | get_byte_func_t get_byte; 46 | /*! \brief An opaque pointer passed when calling get_byte. */ 47 | void *user_data; 48 | 49 | /*! \brief A current, partially transmitted, character. */ 50 | int byte_in_progress; 51 | /*! \brief The current bit position within a partially transmitted character. */ 52 | int bitpos; 53 | /*! \brief Parity bit. */ 54 | int parity_bit; 55 | }; 56 | 57 | /*! 58 | Asynchronous data receive descriptor. This defines the state of a single 59 | working instance of an asynchronous serial to byte converter, for use 60 | in FSK modems. 61 | */ 62 | struct async_rx_state_s 63 | { 64 | /*! \brief The number of data bits per character. */ 65 | int data_bits; 66 | /*! \brief The type of parity. */ 67 | int parity; 68 | /*! \brief The number of stop bits per character. */ 69 | int stop_bits; 70 | /*! \brief TRUE if V.14 rate adaption processing should be performed. */ 71 | int use_v14; 72 | /*! \brief A pointer to the callback routine used to handle received characters. */ 73 | put_byte_func_t put_byte; 74 | /*! \brief An opaque pointer passed when calling put_byte. */ 75 | void *user_data; 76 | 77 | /*! \brief A current, partially complete, character. */ 78 | int byte_in_progress; 79 | /*! \brief The current bit position within a partially complete character. */ 80 | int bitpos; 81 | /*! \brief Parity bit. */ 82 | int parity_bit; 83 | 84 | /*! A count of the number of parity errors seen. */ 85 | int parity_errors; 86 | /*! A count of the number of character framing errors seen. */ 87 | int framing_errors; 88 | }; 89 | 90 | #endif 91 | /*- End of file ------------------------------------------------------------*/ 92 | -------------------------------------------------------------------------------- /src/spandsp/private/awgn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/awgn.h - An additive Gaussian white noise generator 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2001 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: awgn.h,v 1.1 2008/11/30 12:38:27 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_AWGN_H_) 29 | #define _SPANDSP_PRIVATE_AWGN_H_ 30 | 31 | /*! 32 | AWGN generator descriptor. This contains all the state information for an AWGN generator. 33 | */ 34 | struct awgn_state_s 35 | { 36 | double rms; 37 | long int ix1; 38 | long int ix2; 39 | long int ix3; 40 | double r[98]; 41 | double gset; 42 | int iset; 43 | }; 44 | 45 | #endif 46 | /*- End of file ------------------------------------------------------------*/ 47 | -------------------------------------------------------------------------------- /src/spandsp/private/bert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/bert.h - Bit error rate tests. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: bert.h,v 1.2 2009/04/14 16:04:54 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_BERT_H_) 29 | #define _SPANDSP_PRIVATE_BERT_H_ 30 | 31 | typedef struct 32 | { 33 | uint32_t reg; 34 | int step; 35 | int step_bit; 36 | int bits; 37 | int zeros; 38 | } bert_tx_state_t; 39 | 40 | typedef struct 41 | { 42 | uint32_t reg; 43 | uint32_t ref_reg; 44 | uint32_t master_reg; 45 | int step; 46 | int step_bit; 47 | int resync; 48 | int bits; 49 | int zeros; 50 | int resync_len; 51 | int resync_percent; 52 | int resync_bad_bits; 53 | int resync_cnt; 54 | int report_countdown; 55 | int measurement_step; 56 | } bert_rx_state_t; 57 | 58 | /*! 59 | Bit error rate tester (BERT) descriptor. This defines the working state for a 60 | single instance of the BERT. 61 | */ 62 | struct bert_state_s 63 | { 64 | int pattern; 65 | int pattern_class; 66 | bert_report_func_t reporter; 67 | void *user_data; 68 | int report_frequency; 69 | int limit; 70 | 71 | uint32_t mask; 72 | int shift; 73 | int shift2; 74 | int max_zeros; 75 | int invert; 76 | int resync_time; 77 | 78 | int decade_ptr[9]; 79 | int decade_bad[9][10]; 80 | int error_rate; 81 | 82 | bert_tx_state_t tx; 83 | bert_rx_state_t rx; 84 | 85 | bert_results_t results; 86 | 87 | /*! \brief Error and flow logging control */ 88 | logging_state_t logging; 89 | }; 90 | 91 | #endif 92 | /*- End of file ------------------------------------------------------------*/ 93 | -------------------------------------------------------------------------------- /src/spandsp/private/bitstream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/bitstream.h - Bitstream composition and decomposition routines. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: bitstream.h,v 1.1.4.1 2009/12/28 12:20:47 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_BITSTREAM_H_) 29 | #define _SPANDSP_PRIVATE_BITSTREAM_H_ 30 | 31 | /*! Bitstream handler state */ 32 | struct bitstream_state_s 33 | { 34 | /*! The bit stream. */ 35 | uint32_t bitstream; 36 | /*! The residual bits in bitstream. */ 37 | int residue; 38 | /*! TRUE if the stream is LSB first, else MSB first */ 39 | int lsb_first; 40 | }; 41 | 42 | 43 | #endif 44 | /*- End of file ------------------------------------------------------------*/ 45 | -------------------------------------------------------------------------------- /src/spandsp/private/echo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/echo.h - An echo cancellor, suitable for electrical and acoustic 5 | * cancellation. This code does not currently comply with 6 | * any relevant standards (e.g. G.164/5/7/8). 7 | * 8 | * Written by Steve Underwood 9 | * 10 | * Copyright (C) 2001 Steve Underwood 11 | * 12 | * All rights reserved. 13 | * 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU Lesser General Public License version 2.1, 16 | * as published by the Free Software Foundation. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU Lesser General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU Lesser General Public 24 | * License along with this program; if not, write to the Free Software 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 | * 27 | * $Id: echo.h,v 1.1 2009/09/22 13:11:04 steveu Exp $ 28 | */ 29 | 30 | /*! \file */ 31 | 32 | #if !defined(_SPANDSP_PRIVATE_ECHO_H_) 33 | #define _SPANDSP_PRIVATE_ECHO_H_ 34 | 35 | /*! 36 | G.168 echo canceller descriptor. This defines the working state for a line 37 | echo canceller. 38 | */ 39 | struct echo_can_state_s 40 | { 41 | int tx_power[4]; 42 | int rx_power[3]; 43 | int clean_rx_power; 44 | 45 | int rx_power_threshold; 46 | int nonupdate_dwell; 47 | 48 | int curr_pos; 49 | 50 | int taps; 51 | int tap_mask; 52 | int adaption_mode; 53 | 54 | int32_t supp_test1; 55 | int32_t supp_test2; 56 | int32_t supp1; 57 | int32_t supp2; 58 | int vad; 59 | int cng; 60 | 61 | int16_t geigel_max; 62 | int geigel_lag; 63 | int dtd_onset; 64 | int tap_set; 65 | int tap_rotate_counter; 66 | 67 | int32_t latest_correction; /* Indication of the magnitude of the latest 68 | adaption, or a code to indicate why adaption 69 | was skipped, for test purposes */ 70 | int32_t last_acf[28]; 71 | int narrowband_count; 72 | int narrowband_score; 73 | 74 | fir16_state_t fir_state; 75 | /*! Echo FIR taps (16 bit version) */ 76 | int16_t *fir_taps16[4]; 77 | /*! Echo FIR taps (32 bit version) */ 78 | int32_t *fir_taps32; 79 | 80 | /* DC and near DC blocking filter states */ 81 | int32_t tx_hpf[2]; 82 | int32_t rx_hpf[2]; 83 | 84 | /* Parameters for the optional Hoth noise generator */ 85 | int cng_level; 86 | int cng_rndnum; 87 | int cng_filter; 88 | 89 | /* Snapshot sample of coeffs used for development */ 90 | int16_t *snapshot; 91 | }; 92 | 93 | #endif 94 | /*- End of file ------------------------------------------------------------*/ 95 | -------------------------------------------------------------------------------- /src/spandsp/private/fax.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/fax.h - private definitions for analogue line ITU T.30 fax processing 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2005 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: fax.h,v 1.1 2008/10/13 13:14:01 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_SPANDSP_PRIVATE_FAX_H_) 31 | #define _SPANDSP_PRIVATE_FAX_H_ 32 | 33 | /*! 34 | Analogue line T.30 FAX channel descriptor. This defines the state of a single working 35 | instance of an analogue line soft-FAX machine. 36 | */ 37 | struct fax_state_s 38 | { 39 | /*! \brief The T.30 back-end */ 40 | t30_state_t t30; 41 | 42 | /*! \brief The analogue modem front-end */ 43 | fax_modems_state_t modems; 44 | 45 | /*! \brief Error and flow logging control */ 46 | logging_state_t logging; 47 | }; 48 | 49 | #endif 50 | /*- End of file ------------------------------------------------------------*/ 51 | -------------------------------------------------------------------------------- /src/spandsp/private/g711.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/g711.h - In line A-law and u-law conversion routines 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2001 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: g711.h,v 1.2 2009/04/12 09:12:11 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_G711_H_) 29 | #define _SPANDSP_PRIVATE_G711_H_ 30 | 31 | /*! 32 | G.711 state 33 | */ 34 | struct g711_state_s 35 | { 36 | /*! One of the G.711_xxx options */ 37 | int mode; 38 | }; 39 | 40 | #endif 41 | /*- End of file ------------------------------------------------------------*/ 42 | -------------------------------------------------------------------------------- /src/spandsp/private/g722.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/g722.h - The ITU G.722 codec. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2005 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * Based on a single channel G.722 codec which is: 26 | * 27 | ***** Copyright (c) CMU 1993 ***** 28 | * Computer Science, Speech Group 29 | * Chengxiang Lu and Alex Hauptmann 30 | * 31 | * $Id: g722.h,v 1.2 2009/04/12 09:12:11 steveu Exp $ 32 | */ 33 | 34 | 35 | /*! \file */ 36 | 37 | #if !defined(_SPANDSP_PRIVATE_G722_H_) 38 | #define _SPANDSP_PRIVATE_G722_H_ 39 | 40 | /*! The per band parameters for both encoding and decoding G.722 */ 41 | typedef struct 42 | { 43 | int16_t nb; 44 | int16_t det; 45 | int16_t s; 46 | int16_t sz; 47 | int16_t r; 48 | int16_t p[2]; 49 | int16_t a[2]; 50 | int16_t b[6]; 51 | int16_t d[7]; 52 | } g722_band_t; 53 | 54 | /*! 55 | G.722 encode state 56 | */ 57 | struct g722_encode_state_s 58 | { 59 | /*! TRUE if the operating in the special ITU test mode, with the band split filters 60 | disabled. */ 61 | int itu_test_mode; 62 | /*! TRUE if the G.722 data is packed */ 63 | int packed; 64 | /*! TRUE if encode from 8k samples/second */ 65 | int eight_k; 66 | /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */ 67 | int bits_per_sample; 68 | 69 | /*! Signal history for the QMF */ 70 | int16_t x[12]; 71 | int16_t y[12]; 72 | int ptr; 73 | 74 | g722_band_t band[2]; 75 | 76 | uint32_t in_buffer; 77 | int in_bits; 78 | uint32_t out_buffer; 79 | int out_bits; 80 | }; 81 | 82 | /*! 83 | G.722 decode state 84 | */ 85 | struct g722_decode_state_s 86 | { 87 | /*! TRUE if the operating in the special ITU test mode, with the band split filters 88 | disabled. */ 89 | int itu_test_mode; 90 | /*! TRUE if the G.722 data is packed */ 91 | int packed; 92 | /*! TRUE if decode to 8k samples/second */ 93 | int eight_k; 94 | /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */ 95 | int bits_per_sample; 96 | 97 | /*! Signal history for the QMF */ 98 | int16_t x[12]; 99 | int16_t y[12]; 100 | int ptr; 101 | 102 | g722_band_t band[2]; 103 | 104 | uint32_t in_buffer; 105 | int in_bits; 106 | uint32_t out_buffer; 107 | int out_bits; 108 | }; 109 | 110 | #endif 111 | /*- End of file ------------------------------------------------------------*/ 112 | -------------------------------------------------------------------------------- /src/spandsp/private/g726.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/g726.h - ITU G.726 codec. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: g726.h,v 1.4 2009/04/12 09:12:11 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_G726_H_) 29 | #define _SPANDSP_PRIVATE_G726_H_ 30 | 31 | /*! 32 | * The following is the definition of the state structure 33 | * used by the G.726 encoder and decoder to preserve their internal 34 | * state between successive calls. The meanings of the majority 35 | * of the state structure fields are explained in detail in the 36 | * ITU Recommendation G.726. The field names are essentially indentical 37 | * to variable names in the bit level description of the coding algorithm 38 | * included in this recommendation. 39 | */ 40 | struct g726_state_s 41 | { 42 | /*! The bit rate */ 43 | int rate; 44 | /*! The external coding, for tandem operation */ 45 | int ext_coding; 46 | /*! The number of bits per sample */ 47 | int bits_per_sample; 48 | /*! One of the G.726_PACKING_xxx options */ 49 | int packing; 50 | 51 | /*! Locked or steady state step size multiplier. */ 52 | int32_t yl; 53 | /*! Unlocked or non-steady state step size multiplier. */ 54 | int16_t yu; 55 | /*! int16_t term energy estimate. */ 56 | int16_t dms; 57 | /*! Long term energy estimate. */ 58 | int16_t dml; 59 | /*! Linear weighting coefficient of 'yl' and 'yu'. */ 60 | int16_t ap; 61 | 62 | /*! Coefficients of pole portion of prediction filter. */ 63 | int16_t a[2]; 64 | /*! Coefficients of zero portion of prediction filter. */ 65 | int16_t b[6]; 66 | /*! Signs of previous two samples of a partially reconstructed signal. */ 67 | int16_t pk[2]; 68 | /*! Previous 6 samples of the quantized difference signal represented in 69 | an internal floating point format. */ 70 | int16_t dq[6]; 71 | /*! Previous 2 samples of the quantized difference signal represented in an 72 | internal floating point format. */ 73 | int16_t sr[2]; 74 | /*! Delayed tone detect */ 75 | int td; 76 | 77 | /*! \brief The bit stream processing context. */ 78 | bitstream_state_t bs; 79 | 80 | /*! \brief The current encoder function. */ 81 | g726_encoder_func_t enc_func; 82 | /*! \brief The current decoder function. */ 83 | g726_decoder_func_t dec_func; 84 | }; 85 | 86 | #endif 87 | /*- End of file ------------------------------------------------------------*/ 88 | -------------------------------------------------------------------------------- /src/spandsp/private/gsm0610.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/gsm0610.h - GSM 06.10 full rate speech codec. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: gsm0610.h,v 1.2 2008/11/15 14:27:29 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_GSM0610_H_) 29 | #define _SPANDSP_PRIVATE_GSM0610_H_ 30 | 31 | /*! 32 | GSM 06.10 FR codec state descriptor. This defines the state of 33 | a single working instance of the GSM 06.10 FR encoder or decoder. 34 | */ 35 | struct gsm0610_state_s 36 | { 37 | /*! \brief One of the packing modes */ 38 | int packing; 39 | 40 | int16_t dp0[280]; 41 | 42 | /*! Preprocessing */ 43 | int16_t z1; 44 | int32_t L_z2; 45 | /*! Pre-emphasis */ 46 | int16_t mp; 47 | 48 | /*! Short term delay filter */ 49 | int16_t u[8]; 50 | int16_t LARpp[2][8]; 51 | int16_t j; 52 | 53 | /*! Long term synthesis */ 54 | int16_t nrp; 55 | /*! Short term synthesis */ 56 | int16_t v[9]; 57 | /*! Decoder postprocessing */ 58 | int16_t msr; 59 | 60 | /*! Encoder data */ 61 | int16_t e[50]; 62 | }; 63 | 64 | #endif 65 | /*- End of include ---------------------------------------------------------*/ 66 | -------------------------------------------------------------------------------- /src/spandsp/private/ima_adpcm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/ima_adpcm.c - Conversion routines between linear 16 bit PCM data 5 | * and IMA/DVI/Intel ADPCM format. 6 | * 7 | * Written by Steve Underwood 8 | * 9 | * Copyright (C) 2004 Steve Underwood 10 | * 11 | * All rights reserved. 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU Lesser General Public License version 2.1, 15 | * as published by the Free Software Foundation. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Lesser General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Lesser General Public 23 | * License along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 | * 26 | * Based on a bit from here, a bit from there, eye of toad, 27 | * ear of bat, etc - plus, of course, my own 2 cents. 28 | * 29 | * $Id: ima_adpcm.h,v 1.1 2008/11/30 10:17:31 steveu Exp $ 30 | */ 31 | 32 | #if !defined(_SPANDSP_PRIVATE_IMA_ADPCM_H_) 33 | #define _SPANDSP_PRIVATE_IMA_ADPCM_H_ 34 | 35 | /*! 36 | IMA (DVI/Intel) ADPCM conversion state descriptor. This defines the state of 37 | a single working instance of the IMA ADPCM converter. This is used for 38 | either linear to ADPCM or ADPCM to linear conversion. 39 | */ 40 | struct ima_adpcm_state_s 41 | { 42 | int variant; 43 | /*! \brief The size of a chunk, in samples. */ 44 | int chunk_size; 45 | /*! \brief The last state of the ADPCM algorithm. */ 46 | int last; 47 | /*! \brief Current index into the step size table. */ 48 | int step_index; 49 | /*! \brief The current IMA code byte in progress. */ 50 | uint16_t ima_byte; 51 | int bits; 52 | }; 53 | 54 | #endif 55 | /*- End of file ------------------------------------------------------------*/ 56 | -------------------------------------------------------------------------------- /src/spandsp/private/logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/logging.h - definitions for error and debug logging. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2005 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: logging.h,v 1.1 2008/11/30 13:44:35 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_LOGGING_H_) 29 | #define _SPANDSP_PRIVATE_LOGGING_H_ 30 | 31 | /*! 32 | Logging descriptor. This defines the working state for a single instance of 33 | the logging facility for spandsp. 34 | */ 35 | struct logging_state_s 36 | { 37 | int level; 38 | int samples_per_second; 39 | int64_t elapsed_samples; 40 | const char *tag; 41 | const char *protocol; 42 | 43 | message_handler_func_t span_message; 44 | error_handler_func_t span_error; 45 | }; 46 | 47 | #endif 48 | /*- End of file ------------------------------------------------------------*/ 49 | -------------------------------------------------------------------------------- /src/spandsp/private/modem_echo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/modem_echo.h - An echo cancellor, suitable for electrical echos in GSTN modems 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2001, 2004 Steve Underwood 9 | * 10 | * Based on a bit from here, a bit from there, eye of toad, 11 | * ear of bat, etc - plus, of course, my own 2 cents. 12 | * 13 | * All rights reserved. 14 | * 15 | * This program is free software; you can redistribute it and/or modify 16 | * it under the terms of the GNU Lesser General Public License version 2.1, 17 | * as published by the Free Software Foundation. 18 | * 19 | * This program is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU Lesser General Public License for more details. 23 | * 24 | * You should have received a copy of the GNU Lesser General Public 25 | * License along with this program; if not, write to the Free Software 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 27 | * 28 | * $Id: modem_echo.h,v 1.1 2009/09/22 13:11:04 steveu Exp $ 29 | */ 30 | 31 | /*! \file */ 32 | 33 | #if !defined(_SPANDSP_PRIVATE_MODEM_ECHO_H_) 34 | #define _SPANDSP_PRIVATE_MODEM_ECHO_H_ 35 | 36 | /*! 37 | Modem line echo canceller descriptor. This defines the working state for a line 38 | echo canceller. 39 | */ 40 | struct modem_echo_can_state_s 41 | { 42 | int adapt; 43 | int taps; 44 | 45 | fir16_state_t fir_state; 46 | /*! Echo FIR taps (16 bit version) */ 47 | int16_t *fir_taps16; 48 | /*! Echo FIR taps (32 bit version) */ 49 | int32_t *fir_taps32; 50 | 51 | int tx_power; 52 | int rx_power; 53 | 54 | int curr_pos; 55 | }; 56 | 57 | #endif 58 | /*- End of file ------------------------------------------------------------*/ 59 | -------------------------------------------------------------------------------- /src/spandsp/private/noise.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/noise.h - A low complexity audio noise generator, suitable for 5 | * real time generation (current just approx AWGN) 6 | * 7 | * Written by Steve Underwood 8 | * 9 | * Copyright (C) 2005 Steve Underwood 10 | * 11 | * All rights reserved. 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU Lesser General Public License version 2.1, 15 | * as published by the Free Software Foundation. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Lesser General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Lesser General Public 23 | * License along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 | * 26 | * $Id: noise.h,v 1.1 2008/11/30 12:45:09 steveu Exp $ 27 | */ 28 | 29 | /*! \file */ 30 | 31 | #if !defined(_SPANDSP_PRIVATE_NOISE_H_) 32 | #define _SPANDSP_PRIVATE_NOISE_H_ 33 | 34 | /*! 35 | Noise generator descriptor. This contains all the state information for an instance 36 | of the noise generator. 37 | */ 38 | struct noise_state_s 39 | { 40 | int class_of_noise; 41 | int quality; 42 | int32_t rms; 43 | uint32_t rndnum; 44 | int32_t state; 45 | }; 46 | 47 | #endif 48 | /*- End of file ------------------------------------------------------------*/ 49 | -------------------------------------------------------------------------------- /src/spandsp/private/oki_adpcm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/oki_adpcm.h - Conversion routines between linear 16 bit PCM data 5 | * and OKI (Dialogic) ADPCM format. 6 | * 7 | * Written by Steve Underwood 8 | * 9 | * Copyright (C) 2001 Steve Underwood 10 | * 11 | * All rights reserved. 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU Lesser General Public License version 2.1, 15 | * as published by the Free Software Foundation. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Lesser General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Lesser General Public 23 | * License along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 | * 26 | * $Id: oki_adpcm.h,v 1.1 2008/11/30 10:17:31 steveu Exp $ 27 | */ 28 | 29 | /*! \file */ 30 | 31 | #if !defined(_SPANDSP_PRIVATE_OKI_ADPCM_H_) 32 | #define _SPANDSP_PRIVATE_OKI_ADPCM_H_ 33 | 34 | /*! 35 | Oki (Dialogic) ADPCM conversion state descriptor. This defines the state of 36 | a single working instance of the Oki ADPCM converter. This is used for 37 | either linear to ADPCM or ADPCM to linear conversion. 38 | */ 39 | struct oki_adpcm_state_s 40 | { 41 | /*! \brief The bit rate - 24000 or 32000. */ 42 | int bit_rate; 43 | /*! \brief The last state of the ADPCM algorithm. */ 44 | int16_t last; 45 | /*! \brief Current index into the step size table. */ 46 | int16_t step_index; 47 | /*! \brief The compressed data byte in progress. */ 48 | uint8_t oki_byte; 49 | /*! \brief The signal history for the sample rate converter. */ 50 | int16_t history[32]; 51 | /*! \brief Pointer into the history buffer. */ 52 | int ptr; 53 | /*! \brief Odd/even sample counter. */ 54 | int mark; 55 | /*! \brief Phase accumulator for the sample rate converter. */ 56 | int phase; 57 | }; 58 | 59 | #endif 60 | /*- End of file ------------------------------------------------------------*/ 61 | -------------------------------------------------------------------------------- /src/spandsp/private/queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/queue.h - simple in process message queuing 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: queue.h,v 1.2 2009/01/31 08:48:11 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_QUEUE_H_) 29 | #define _SPANDSP_PRIVATE_QUEUE_H_ 30 | 31 | /*! 32 | Queue descriptor. This defines the working state for a single instance of 33 | a byte stream or message oriented queue. 34 | */ 35 | struct queue_state_s 36 | { 37 | /*! \brief Flags indicating the mode of the queue. */ 38 | int flags; 39 | /*! \brief The length of the data buffer. */ 40 | int len; 41 | /*! \brief The buffer input pointer. */ 42 | volatile int iptr; 43 | /*! \brief The buffer output pointer. */ 44 | volatile int optr; 45 | #if defined(SPANDSP_FULLY_DEFINE_QUEUE_STATE_T) 46 | /*! \brief The data buffer, sized at the time the structure is created. */ 47 | uint8_t data[]; 48 | #endif 49 | }; 50 | 51 | #endif 52 | /*- End of file ------------------------------------------------------------*/ 53 | -------------------------------------------------------------------------------- /src/spandsp/private/schedule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/schedule.h 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: schedule.h,v 1.1 2008/11/30 05:43:37 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_SCHEDULE_H_) 29 | #define _SPANDSP_PRIVATE_SCHEDULE_H_ 30 | 31 | /*! A scheduled event entry. */ 32 | struct span_sched_s 33 | { 34 | uint64_t when; 35 | span_sched_callback_func_t callback; 36 | void *user_data; 37 | }; 38 | 39 | /*! A scheduled event queue. */ 40 | struct span_sched_state_s 41 | { 42 | uint64_t ticker; 43 | int allocated; 44 | int max_to_date; 45 | span_sched_t *sched; 46 | logging_state_t logging; 47 | }; 48 | 49 | #endif 50 | /*- End of file ------------------------------------------------------------*/ 51 | -------------------------------------------------------------------------------- /src/spandsp/private/silence_gen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/silence_gen.c - A silence generator, for inserting timed silences. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2006 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: silence_gen.h,v 1.1 2009/04/12 03:29:58 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_SILENCE_GEN_H_) 29 | #define _SPANDSP_PRIVATE_SILENCE_GEN_H_ 30 | 31 | struct silence_gen_state_s 32 | { 33 | /*! \brief The callback function used to report status changes. */ 34 | modem_tx_status_func_t status_handler; 35 | /*! \brief A user specified opaque pointer passed to the status function. */ 36 | void *status_user_data; 37 | 38 | int remaining_samples; 39 | int total_samples; 40 | }; 41 | 42 | #endif 43 | /*- End of file ------------------------------------------------------------*/ 44 | -------------------------------------------------------------------------------- /src/spandsp/private/super_tone_rx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/super_tone_rx.h - Flexible telephony supervisory tone detection. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2003 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: super_tone_rx.h,v 1.1 2008/11/30 10:17:31 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_SUPER_TONE_RX_H_) 29 | #define _SPANDSP_PRIVATE_SUPER_TONE_RX_H_ 30 | 31 | #define BINS 128 32 | 33 | struct super_tone_rx_segment_s 34 | { 35 | int f1; 36 | int f2; 37 | int recognition_duration; 38 | int min_duration; 39 | int max_duration; 40 | }; 41 | 42 | struct super_tone_rx_descriptor_s 43 | { 44 | int used_frequencies; 45 | int monitored_frequencies; 46 | int pitches[BINS/2][2]; 47 | int tones; 48 | super_tone_rx_segment_t **tone_list; 49 | int *tone_segs; 50 | goertzel_descriptor_t *desc; 51 | }; 52 | 53 | struct super_tone_rx_state_s 54 | { 55 | super_tone_rx_descriptor_t *desc; 56 | float energy; 57 | int detected_tone; 58 | int rotation; 59 | tone_report_func_t tone_callback; 60 | void (*segment_callback)(void *data, int f1, int f2, int duration); 61 | void *callback_data; 62 | super_tone_rx_segment_t segments[11]; 63 | goertzel_state_t state[]; 64 | }; 65 | 66 | #endif 67 | /*- End of file ------------------------------------------------------------*/ 68 | -------------------------------------------------------------------------------- /src/spandsp/private/super_tone_tx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/super_tone_tx.h - Flexible telephony supervisory tone generation. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2001 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: super_tone_tx.h,v 1.1 2008/11/30 10:22:19 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_SUPER_TONE_TX_H_) 29 | #define _SPANDSP_PRIVATE_SUPER_TONE_TX_H_ 30 | 31 | struct super_tone_tx_step_s 32 | { 33 | tone_gen_tone_descriptor_t tone[4]; 34 | int tone_on; 35 | int length; 36 | int cycles; 37 | super_tone_tx_step_t *next; 38 | super_tone_tx_step_t *nest; 39 | }; 40 | 41 | struct super_tone_tx_state_s 42 | { 43 | tone_gen_tone_descriptor_t tone[4]; 44 | uint32_t phase[4]; 45 | int current_position; 46 | int level; 47 | super_tone_tx_step_t *levels[4]; 48 | int cycles[4]; 49 | }; 50 | 51 | #endif 52 | /*- End of file ------------------------------------------------------------*/ 53 | -------------------------------------------------------------------------------- /src/spandsp/private/swept_tone.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/swept_tone.h - Swept tone generation 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2009 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: swept_tone.h,v 1.1 2009/09/22 12:54:33 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_SWEPT_TONE_H_) 29 | #define _SPANDSP_PRIVATE_SWEPT_TONE_H_ 30 | 31 | struct swept_tone_state_s 32 | { 33 | int32_t starting_phase_inc; 34 | int32_t phase_inc_step; 35 | int scale; 36 | int duration; 37 | int repeating; 38 | int pos; 39 | int32_t current_phase_inc; 40 | uint32_t phase; 41 | }; 42 | 43 | #endif 44 | /*- End of file ------------------------------------------------------------*/ 45 | -------------------------------------------------------------------------------- /src/spandsp/private/t30_dis_dtc_dcs_bits.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/src/spandsp/private/t30_dis_dtc_dcs_bits.h -------------------------------------------------------------------------------- /src/spandsp/private/time_scale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/time_scale.h - Time scaling for linear speech data 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: time_scale.h,v 1.1 2008/11/15 14:27:29 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_TIME_SCALE_H_) 29 | #define _SPANDSP_PRIVATE_TIME_SCALE_H_ 30 | 31 | #define TIME_SCALE_MAX_SAMPLE_RATE 48000 32 | #define TIME_SCALE_MIN_PITCH 60 33 | #define TIME_SCALE_MAX_PITCH 250 34 | #define TIME_SCALE_BUF_LEN (2*TIME_SCALE_MAX_SAMPLE_RATE/TIME_SCALE_MIN_PITCH) 35 | 36 | /*! Audio time scaling descriptor. */ 37 | struct time_scale_state_s 38 | { 39 | int sample_rate; 40 | int min_pitch; 41 | int max_pitch; 42 | int buf_len; 43 | float playout_rate; 44 | double rcomp; 45 | double rate_nudge; 46 | int fill; 47 | int lcp; 48 | int16_t buf[TIME_SCALE_BUF_LEN]; 49 | }; 50 | 51 | #endif 52 | /*- End of file ------------------------------------------------------------*/ 53 | -------------------------------------------------------------------------------- /src/spandsp/private/tone_detect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/tone_detect.h - General telephony tone detection. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2001, 2005 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: tone_detect.h,v 1.1 2008/11/30 10:17:31 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_TONE_DETECT_H_) 29 | #define _SPANDSP_PRIVATE_TONE_DETECT_H_ 30 | 31 | #endif 32 | /*- End of file ------------------------------------------------------------*/ 33 | -------------------------------------------------------------------------------- /src/spandsp/private/tone_generate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/tone_generate.h - General telephony tone generation. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2001 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: tone_generate.h,v 1.1 2008/11/30 10:17:31 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_TONE_GENERATE_H_) 29 | #define _SPANDSP_PRIVATE_TONE_GENERATE_H_ 30 | 31 | struct tone_gen_tone_descriptor_s 32 | { 33 | int32_t phase_rate; 34 | #if defined(SPANDSP_USE_FIXED_POINT) 35 | int16_t gain; 36 | #else 37 | float gain; 38 | #endif 39 | }; 40 | 41 | /*! 42 | Cadenced multi-tone generator descriptor. 43 | */ 44 | struct tone_gen_descriptor_s 45 | { 46 | tone_gen_tone_descriptor_t tone[4]; 47 | int duration[4]; 48 | int repeat; 49 | }; 50 | 51 | /*! 52 | Cadenced multi-tone generator state descriptor. This defines the state of 53 | a single working instance of a generator. 54 | */ 55 | struct tone_gen_state_s 56 | { 57 | tone_gen_tone_descriptor_t tone[4]; 58 | 59 | uint32_t phase[4]; 60 | int duration[4]; 61 | int repeat; 62 | 63 | int current_section; 64 | int current_position; 65 | }; 66 | 67 | #endif 68 | /*- End of file ------------------------------------------------------------*/ 69 | -------------------------------------------------------------------------------- /src/spandsp/private/v18.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/v18.h - V.18 text telephony for the deaf. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004-2009 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: v18.h,v 1.5 2009/11/04 15:52:06 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_V18_H_) 29 | #define _SPANDSP_PRIVATE_V18_H_ 30 | 31 | struct v18_state_s 32 | { 33 | /*! \brief TRUE if we are the calling modem */ 34 | int calling_party; 35 | int mode; 36 | put_msg_func_t put_msg; 37 | void *user_data; 38 | 39 | union 40 | { 41 | queue_state_t queue; 42 | uint8_t buf[QUEUE_STATE_T_SIZE(128)]; 43 | } queue; 44 | tone_gen_descriptor_t alert_tone_desc; 45 | tone_gen_state_t alert_tone_gen; 46 | fsk_tx_state_t fsktx; 47 | dtmf_tx_state_t dtmftx; 48 | async_tx_state_t asynctx; 49 | int baudot_tx_shift; 50 | int tx_signal_on; 51 | int byte_no; 52 | 53 | fsk_rx_state_t fskrx; 54 | dtmf_rx_state_t dtmfrx; 55 | int baudot_rx_shift; 56 | int consecutive_ones; 57 | uint8_t rx_msg[256 + 1]; 58 | int rx_msg_len; 59 | int bit_pos; 60 | int in_progress; 61 | 62 | /*! \brief Error and flow logging control */ 63 | logging_state_t logging; 64 | }; 65 | 66 | #endif 67 | /*- End of file ------------------------------------------------------------*/ 68 | -------------------------------------------------------------------------------- /src/spandsp/private/v8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * private/v8.h - V.8 modem negotiation processing. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: v8.h,v 1.3.4.1 2009/12/28 12:20:47 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_PRIVATE_V8_H_) 29 | #define _SPANDSP_PRIVATE_V8_H_ 30 | 31 | struct v8_state_s 32 | { 33 | /*! \brief TRUE if we are the calling modem */ 34 | int calling_party; 35 | 36 | v8_result_handler_t *result_handler; 37 | void *result_handler_user_data; 38 | 39 | /*! \brief The current state of the V.8 protocol */ 40 | int state; 41 | int fsk_tx_on; 42 | int modem_connect_tone_tx_on; 43 | int negotiation_timer; 44 | int ci_timer; 45 | int ci_count; 46 | fsk_tx_state_t v21tx; 47 | fsk_rx_state_t v21rx; 48 | queue_state_t *tx_queue; 49 | modem_connect_tones_tx_state_t ansam_tx; 50 | modem_connect_tones_rx_state_t ansam_rx; 51 | 52 | /*! \brief Modulation schemes available at this end. */ 53 | unsigned int far_end_modulations; 54 | 55 | v8_parms_t parms; 56 | v8_parms_t result; 57 | 58 | /* V.8 data parsing */ 59 | uint32_t bit_stream; 60 | int bit_cnt; 61 | /* Indicates the type of message coming up */ 62 | int preamble_type; 63 | uint8_t rx_data[64]; 64 | int rx_data_ptr; 65 | 66 | /*! \brief a reference copy of the last CM or JM message, used when 67 | testing for matches. */ 68 | uint8_t cm_jm_data[64]; 69 | int cm_jm_len; 70 | int got_cm_jm; 71 | int got_cj; 72 | int zero_byte_count; 73 | /*! \brief Error and flow logging control */ 74 | logging_state_t logging; 75 | }; 76 | 77 | #endif 78 | /*- End of file ------------------------------------------------------------*/ 79 | -------------------------------------------------------------------------------- /src/spandsp/schedule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * schedule.h 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: schedule.h,v 1.20 2009/02/10 13:06:47 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | /*! \page schedule_page Scheduling 31 | \section schedule_page_sec_1 What does it do? 32 | ???. 33 | 34 | \section schedule_page_sec_2 How does it work? 35 | ???. 36 | */ 37 | 38 | #if !defined(_SPANDSP_SCHEDULE_H_) 39 | #define _SPANDSP_SCHEDULE_H_ 40 | 41 | /*! A scheduled event entry. */ 42 | typedef struct span_sched_s span_sched_t; 43 | 44 | /*! A scheduled event queue. */ 45 | typedef struct span_sched_state_s span_sched_state_t; 46 | 47 | typedef void (*span_sched_callback_func_t)(span_sched_state_t *s, void *user_data); 48 | 49 | #if defined(__cplusplus) 50 | extern "C" 51 | { 52 | #endif 53 | 54 | SPAN_DECLARE(uint64_t) span_schedule_next(span_sched_state_t *s); 55 | SPAN_DECLARE(uint64_t) span_schedule_time(span_sched_state_t *s); 56 | 57 | SPAN_DECLARE(int) span_schedule_event(span_sched_state_t *s, int us, span_sched_callback_func_t function, void *user_data); 58 | SPAN_DECLARE(void) span_schedule_update(span_sched_state_t *s, int us); 59 | SPAN_DECLARE(void) span_schedule_del(span_sched_state_t *s, int id); 60 | 61 | SPAN_DECLARE(span_sched_state_t *) span_schedule_init(span_sched_state_t *s); 62 | SPAN_DECLARE(int) span_schedule_release(span_sched_state_t *s); 63 | SPAN_DECLARE(int) span_schedule_free(span_sched_state_t *s); 64 | 65 | #if defined(__cplusplus) 66 | } 67 | #endif 68 | 69 | #endif 70 | /*- End of file ------------------------------------------------------------*/ 71 | -------------------------------------------------------------------------------- /src/spandsp/swept_tone.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * swept_tone.h - Swept tone generation 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2009 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: swept_tone.h,v 1.1 2009/09/22 12:54:33 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_SPANDSP_SWEPT_TONE_H_) 31 | #define _SPANDSP_SWEPT_TONE_H_ 32 | 33 | /*! \page swept_tone_page The swept tone generator 34 | \section swept_tone_page_sec_1 What does it do? 35 | */ 36 | 37 | typedef struct swept_tone_state_s swept_tone_state_t; 38 | 39 | #if defined(__cplusplus) 40 | extern "C" 41 | { 42 | #endif 43 | 44 | SPAN_DECLARE(swept_tone_state_t *) swept_tone_init(swept_tone_state_t *s, float start, float end, float level, int duration, int repeating); 45 | 46 | SPAN_DECLARE(int) swept_tone(swept_tone_state_t *s, int16_t amp[], int len); 47 | 48 | SPAN_DECLARE(float) swept_tone_current_frequency(swept_tone_state_t *s); 49 | 50 | SPAN_DECLARE(int) swept_tone_release(swept_tone_state_t *s); 51 | 52 | SPAN_DECLARE(int) swept_tone_free(swept_tone_state_t *s); 53 | 54 | #if defined(__cplusplus) 55 | } 56 | #endif 57 | 58 | #endif 59 | /*- End of file ------------------------------------------------------------*/ 60 | -------------------------------------------------------------------------------- /src/spandsp/t30_logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * t30_logging.h - definitions for T.30 fax processing 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2003 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: t30_logging.h,v 1.4 2009/02/03 16:28:41 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_SPANDSP_T30_LOGGING_H_) 31 | #define _SPANDSP_T30_LOGGING_H_ 32 | 33 | #if defined(__cplusplus) 34 | extern "C" 35 | { 36 | #endif 37 | 38 | /*! Return a text name for a T.30 frame type. 39 | \brief Return a text name for a T.30 frame type. 40 | \param x The frametype octet. 41 | \return A pointer to the text name for the frame type. If the frame type is 42 | not value, the string "???" is returned. */ 43 | SPAN_DECLARE(const char *) t30_frametype(uint8_t x); 44 | 45 | /*! Decode a DIS, DTC or DCS frame, and log the contents. 46 | \brief Decode a DIS, DTC or DCS frame, and log the contents. 47 | \param s The T.30 context. 48 | \param dis A pointer to the frame to be decoded. 49 | \param len The length of the frame. */ 50 | SPAN_DECLARE(void) t30_decode_dis_dtc_dcs(t30_state_t *s, const uint8_t *dis, int len); 51 | 52 | /*! Convert a phase E completion code to a short text description. 53 | \brief Convert a phase E completion code to a short text description. 54 | \param result The result code. 55 | \return A pointer to the description. */ 56 | SPAN_DECLARE(const char *) t30_completion_code_to_str(int result); 57 | 58 | #if defined(__cplusplus) 59 | } 60 | #endif 61 | 62 | #endif 63 | /*- End of file ------------------------------------------------------------*/ 64 | -------------------------------------------------------------------------------- /src/spandsp/t35.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * t35.h - ITU T.35 FAX non-standard facility processing. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2003 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: t35.h,v 1.15 2009/01/31 08:48:11 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_SPANDSP_T35_H_) 31 | #define _SPANDSP_T35_H_ 32 | 33 | /*! \page t35_page T.35 manufacturer specific processing for FAX machines 34 | \section t35_page_sec_1 What does it do? 35 | ???. 36 | 37 | \section t35_page_sec_2 How does it work? 38 | ???. 39 | */ 40 | 41 | /*! A table of the country names associated with each possible value of the T.35 country code 42 | selector octet. */ 43 | extern const char *t35_country_codes[256]; 44 | 45 | #if defined(__cplusplus) 46 | extern "C" 47 | { 48 | #endif 49 | 50 | /*! Decode an NSF field to try to determine the make and model of the 51 | remote machine. 52 | \brief Decode an NSF field. 53 | \param msg The NSF message. 54 | \param len The length of the NSF message. 55 | \param country A pointer which will be pointed to the identified country of origin. 56 | If a NULL pointer is given, the country of origin will not be returned. 57 | If the country of origin is not identified, NULL will be returned. 58 | \param vendor A pointer which will be pointed to the identified vendor. 59 | If a NULL pointer is given, the vendor ID will not be returned. 60 | If the vendor is not identified, NULL will be returned. 61 | \param model A pointer which will be pointed to the identified model. 62 | If a NULL pointer is given, the model will not be returned. 63 | If the model is not identified, NULL will be returned. 64 | \return TRUE if the machine was identified, otherwise FALSE. 65 | */ 66 | SPAN_DECLARE(int) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model); 67 | 68 | #if defined(__cplusplus) 69 | } 70 | #endif 71 | 72 | #endif 73 | /*- End of file ------------------------------------------------------------*/ 74 | -------------------------------------------------------------------------------- /src/spandsp/timing.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * timing.h - Provide access to the Pentium/Athlon TSC timer register 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2001 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: timing.h,v 1.14 2009/09/04 14:38:47 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_TIMING_H_) 29 | #define _SPANDSP_TIMING_H_ 30 | 31 | #if defined(__cplusplus) 32 | extern "C" 33 | { 34 | #endif 35 | 36 | #if defined(__MSVC__) 37 | __declspec(naked) unsigned __int64 __cdecl rdtscll(void) 38 | { 39 | __asm 40 | { 41 | rdtsc 42 | ret ; return value at EDX:EAX 43 | } 44 | } 45 | /*- End of function --------------------------------------------------------*/ 46 | #elif defined(__GNUC__) 47 | #if defined(__i386__) 48 | static __inline__ uint64_t rdtscll(void) 49 | { 50 | uint64_t now; 51 | 52 | __asm__ __volatile__(" rdtsc\n" : "=A" (now)); 53 | return now; 54 | } 55 | /*- End of function --------------------------------------------------------*/ 56 | #elif defined(__x86_64__) 57 | static __inline__ uint64_t rdtscll(void) 58 | { 59 | uint32_t a; 60 | uint32_t d; 61 | 62 | /* For x86_64 we need to merge the result in 2 32 bit registers 63 | into one clean 64 bit result. */ 64 | __asm__ __volatile__(" rdtsc\n" : "=a" (a), "=d" (d)); 65 | return ((uint64_t) a) | (((uint64_t) d) << 32); 66 | } 67 | /*- End of function --------------------------------------------------------*/ 68 | #else 69 | static __inline__ uint64_t rdtscll(void) 70 | { 71 | /* This architecture doesn't have a suitable timer */ 72 | return 0llu; 73 | } 74 | /*- End of function --------------------------------------------------------*/ 75 | #endif 76 | #endif 77 | 78 | #if defined(__cplusplus) 79 | } 80 | #endif 81 | 82 | #endif 83 | /*- End of file ------------------------------------------------------------*/ 84 | -------------------------------------------------------------------------------- /src/spandsp/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * version.h - A tag file, so the exact installed revision can be assertained. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2007 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: version.h.in,v 1.3.4.1 2009/12/19 09:47:56 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_VERSION_H_) 29 | #define _SPANDSP_VERSION_H_ 30 | 31 | /* The date and time of the version are in UTC form. */ 32 | 33 | #define SPANDSP_RELEASE_DATE 20091228 34 | #define SPANDSP_RELEASE_TIME 123351 35 | #define SPANDSP_RELEASE_DATETIME_STRING "20091228 123351" 36 | 37 | #endif 38 | /*- End of file ------------------------------------------------------------*/ 39 | -------------------------------------------------------------------------------- /src/spandsp/version.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * version.h - A tag file, so the exact installed revision can be assertained. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2007 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: version.h.in,v 1.3.4.1 2009/12/19 09:47:56 steveu Exp $ 26 | */ 27 | 28 | #if !defined(_SPANDSP_VERSION_H_) 29 | #define _SPANDSP_VERSION_H_ 30 | 31 | /* The date and time of the version are in UTC form. */ 32 | 33 | #define SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_DATE 34 | #define SPANDSP_RELEASE_TIME $SPANDSP_RELEASE_TIME 35 | #define SPANDSP_RELEASE_DATETIME_STRING "$SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_TIME" 36 | 37 | #endif 38 | /*- End of file ------------------------------------------------------------*/ 39 | -------------------------------------------------------------------------------- /src/t30_local.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * t30_local.h - definitions for T.30 fax processing 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2003 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU Lesser General Public License version 2.1, 14 | * as published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: t30_local.h,v 1.2 2008/04/17 14:26:57 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_T30_LOCAL_H_) 31 | #define _T30_LOCAL_H_ 32 | 33 | #if defined(__cplusplus) 34 | extern "C" 35 | { 36 | #endif 37 | 38 | int t30_build_dis_or_dtc(t30_state_t *s); 39 | 40 | #if defined(__cplusplus) 41 | } 42 | #endif 43 | 44 | #endif 45 | /*- End of file ------------------------------------------------------------*/ 46 | -------------------------------------------------------------------------------- /src/v18.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/src/v18.c -------------------------------------------------------------------------------- /src/v29tx_constellation_maps.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * v29tx_constellation_maps.h - ITU V.29 modem transmit part. 5 | * Constellation mapping. 6 | * 7 | * Written by Steve Underwood 8 | * 9 | * Copyright (C) 2008 Steve Underwood 10 | * 11 | * All rights reserved. 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU Lesser General Public License version 2.1, 15 | * as published by the Free Software Foundation. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU Lesser General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Lesser General Public 23 | * License along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 | * 26 | * $Id: v29tx_constellation_maps.h,v 1.2 2008/09/04 14:40:05 steveu Exp $ 27 | */ 28 | 29 | #if defined(SPANDSP_USE_FIXED_POINT) 30 | static const complexi16_t v29_abab_constellation[6] = 31 | #else 32 | static const complexf_t v29_abab_constellation[6] = 33 | #endif 34 | { 35 | { 3, -3}, /* 315deg high 9600 */ 36 | {-3, 0}, /* 180deg low */ 37 | { 1, -1}, /* 315deg low 7200 */ 38 | {-3, 0}, /* 180deg low */ 39 | { 0, -3}, /* 270deg low 4800 */ 40 | {-3, 0} /* 180deg low */ 41 | }; 42 | 43 | #if defined(SPANDSP_USE_FIXED_POINT) 44 | static const complexi16_t v29_cdcd_constellation[6] = 45 | #else 46 | static const complexf_t v29_cdcd_constellation[6] = 47 | #endif 48 | { 49 | { 3, 0}, /* 0deg low 9600 */ 50 | {-3, 3}, /* 135deg high */ 51 | { 3, 0}, /* 0deg low 7200 */ 52 | {-1, 1}, /* 135deg low */ 53 | { 3, 0}, /* 0deg low 4800 */ 54 | { 0, 3} /* 90deg low */ 55 | }; 56 | 57 | #if defined(SPANDSP_USE_FIXED_POINT) 58 | static const complexi16_t v29_9600_constellation[16] = 59 | #else 60 | static const complexf_t v29_9600_constellation[16] = 61 | #endif 62 | { 63 | { 3, 0}, /* 0deg low */ 64 | { 1, 1}, /* 45deg low */ 65 | { 0, 3}, /* 90deg low */ 66 | {-1, 1}, /* 135deg low */ 67 | {-3, 0}, /* 180deg low */ 68 | {-1, -1}, /* 225deg low */ 69 | { 0, -3}, /* 270deg low */ 70 | { 1, -1}, /* 315deg low */ 71 | { 5, 0}, /* 0deg high */ 72 | { 3, 3}, /* 45deg high */ 73 | { 0, 5}, /* 90deg high */ 74 | {-3, 3}, /* 135deg high */ 75 | {-5, 0}, /* 180deg high */ 76 | {-3, -3}, /* 225deg high */ 77 | { 0, -5}, /* 270deg high */ 78 | { 3, -3} /* 315deg high */ 79 | }; 80 | 81 | /*- End of file ------------------------------------------------------------*/ 82 | -------------------------------------------------------------------------------- /test-data/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## SpanDSP - a series of DSP components for telephony 3 | ## 4 | ## Makefile.am - Process this file with automake to produce Makefile.in 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU Lesser General Public License version 2.1, 8 | ## as published by the Free Software Foundation. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU Lesser General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Lesser General Public 16 | ## License along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ## 19 | ## $Id: Makefile.am,v 1.3 2008/07/10 12:44:54 steveu Exp $ 20 | 21 | SUBDIRS = itu etsi 22 | 23 | DIST_SUBDIRS = itu etsi local 24 | 25 | all: 26 | 27 | clean: 28 | 29 | -------------------------------------------------------------------------------- /test-data/etsi/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## SpanDSP - a series of DSP components for telephony 3 | ## 4 | ## Makefile.am -- Process this file with automake to produce Makefile.in 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU Lesser General Public License version 2.1, 8 | ## as published by the Free Software Foundation. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU Lesser General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Lesser General Public 16 | ## License along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ## 19 | ## $Id: Makefile.am,v 1.4 2008/07/10 12:44:54 steveu Exp $ 20 | 21 | SUBDIRS = fax 22 | 23 | DIST_SUBDIRS = fax 24 | 25 | all: 26 | 27 | clean: 28 | 29 | -------------------------------------------------------------------------------- /test-data/etsi/fax/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## SpanDSP - a series of DSP components for telephony 3 | ## 4 | ## Makefile.am -- Process this file with automake to produce Makefile.in 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License version 2, as 8 | ## published by the Free Software Foundation. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU General Public License 16 | ## along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ## 19 | ## $Id: Makefile.am,v 1.4 2009/02/25 17:52:51 steveu Exp $ 20 | 21 | AM_CFLAGS = $(COMP_VENDOR_CFLAGS) 22 | 23 | PBM2G3 = pbmtog3 24 | FAX2TIFF = fax2tiff 25 | TIFFCP = tiffcp 26 | 27 | ETSI_TEST_PAGES = etsi_300_242_a4_diago1.tif \ 28 | etsi_300_242_a4_diago2.tif \ 29 | etsi_300_242_a4_duration1.tif \ 30 | etsi_300_242_a4_duration2.tif \ 31 | etsi_300_242_a4_error.tif \ 32 | etsi_300_242_a4_impress.tif \ 33 | etsi_300_242_a4_impress_white.tif \ 34 | etsi_300_242_a4_stairstep.tif \ 35 | etsi_300_242_a4_white.tif \ 36 | etsi_300_242_a4_white_2p.tif 37 | 38 | EXTRA_DIST = 39 | 40 | MAINTAINERCLEANFILES = Makefile.in 41 | 42 | LIBDIR = -L$(top_builddir)/src 43 | 44 | nobase_data_DATA = ${ETSI_TEST_PAGES} 45 | 46 | noinst_PROGRAMS = generate_etsi_300_242_pages 47 | 48 | generate_etsi_300_242_pages_SOURCES = generate_etsi_300_242_pages.c 49 | generate_etsi_300_242_pages_LDADD = $(LIBDIR) -lspandsp -ltiff 50 | 51 | clean: 52 | rm -f *.tif *.g3 53 | 54 | .g3.tif: 55 | ${FAX2TIFF} -M -o $*.tif $*.g3 56 | 57 | .pbm.g3: 58 | ${PBM2G3} $*.pbm >$*.g3 59 | 60 | ${ETSI_TEST_PAGES}: generate_etsi_300_242_pages$(EXEEXT) 61 | ./generate_etsi_300_242_pages$(EXEEXT) 62 | -------------------------------------------------------------------------------- /test-data/itu/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## SpanDSP - a series of DSP components for telephony 3 | ## 4 | ## Makefile.am - Process this file with automake to produce Makefile.in 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU Lesser General Public License version 2.1, 8 | ## as published by the Free Software Foundation. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU Lesser General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Lesser General Public 16 | ## License along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ## 19 | ## $Id: Makefile.am,v 1.3 2008/05/03 10:26:15 steveu Exp $ 20 | 21 | SUBDIRS = fax 22 | 23 | DIST_SUBDIRS = fax 24 | 25 | all: 26 | 27 | clean: 28 | 29 | -------------------------------------------------------------------------------- /test-data/itu/fax/itu1.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/itu1.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/itu2.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/itu2.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/itu3.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/itu3.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/itu4.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/itu4.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/itu5.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/itu5.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/itu6.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/itu6.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/itu7.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/itu7.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/itu8.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/itu8.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/test1.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/test1.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/test2.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/test2.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/test3.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/test3.pbm -------------------------------------------------------------------------------- /test-data/itu/fax/test4.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/itu/fax/test4.pbm -------------------------------------------------------------------------------- /test-data/local/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## SpanDSP - a series of DSP components for telephony 3 | ## 4 | ## Makefile.am - Process this file with automake to produce Makefile.in 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU Lesser General Public License version 2.1, 8 | ## as published by the Free Software Foundation. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU Lesser General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Lesser General Public 16 | ## License along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ## 19 | ## $Id: Makefile.am,v 1.1 2008/05/03 07:30:19 steveu Exp $ 20 | 21 | SUBDIRS = 22 | 23 | DIST_SUBDIRS = 24 | 25 | EXTRA_DIST = dam9_lpc55.wav \ 26 | dam9.wav \ 27 | short_nb_voice.wav \ 28 | short_wb_voice.wav 29 | 30 | all: 31 | 32 | clean: 33 | -------------------------------------------------------------------------------- /test-data/local/dam9.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/local/dam9.wav -------------------------------------------------------------------------------- /test-data/local/dam9_lpc55.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/local/dam9_lpc55.wav -------------------------------------------------------------------------------- /test-data/local/short_nb_voice.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/local/short_nb_voice.wav -------------------------------------------------------------------------------- /test-data/local/short_wb_voice.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/test-data/local/short_wb_voice.wav -------------------------------------------------------------------------------- /tests/complex_tests.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * complex.c 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2008 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: complex_tests.c,v 1.2 2009/01/28 03:41:27 steveu Exp $ 26 | */ 27 | 28 | /*! \page complex_tests_page Complex arithmetic tests 29 | \section complex_tests_page_sec_1 What does it do? 30 | 31 | \section complex_tests_page_sec_2 How is it used? 32 | */ 33 | 34 | #if defined(HAVE_CONFIG_H) 35 | #include "config.h" 36 | #endif 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #if defined(HAVE_TGMATH_H) 43 | #include 44 | #endif 45 | #if defined(HAVE_MATH_H) 46 | #include 47 | #endif 48 | #include "floating_fudge.h" 49 | #include 50 | 51 | #include "spandsp.h" 52 | 53 | int main(int argc, char *argv[]) 54 | { 55 | complexf_t fa; 56 | complexf_t fb; 57 | complexf_t fz; 58 | complexi16_t i16a; 59 | complexi16_t i16b; 60 | complexi16_t i16z; 61 | #if 0 62 | complexi32_t i32a; 63 | complexi32_t i32b; 64 | complexi32_t i32z; 65 | #endif 66 | 67 | fa = complex_setf(0.5f, 0.25f); 68 | fb = complex_setf(0.25f, 0.5f); 69 | fz = complex_mulf(&fa, &fb); 70 | printf("(%f, %f) * (%f, %f) => (%f, %f)\n", fa.re, fa.im, fb.re, fb.im, fz.re, fz.im); 71 | 72 | i16a = complex_seti16(16383, 8191); 73 | i16b = complex_seti16(8191, 16383); 74 | i16z = complex_mul_q1_15(&i16a, &i16b); 75 | printf("(%f, %f) * (%f, %f) => (%f, %f)\n", i16a.re/32768.0, i16a.im/32768.0, i16b.re/32768.0, i16b.im/32768.0, i16z.re/32768.0, i16z.im/32768.0); 76 | 77 | printf("Tests passed.\n"); 78 | return 0; 79 | } 80 | /*- End of function --------------------------------------------------------*/ 81 | /*- End of file ------------------------------------------------------------*/ 82 | -------------------------------------------------------------------------------- /tests/dc_restore_tests.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * dc_restore_tests.c - Tests for the dc_restore functions. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2001 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: dc_restore_tests.c,v 1.24 2008/11/30 12:38:27 steveu Exp $ 26 | */ 27 | 28 | /*! \page dc_restore_tests_page DC restoration tests 29 | \section dc_restore_tests_page_sec_1 What does it do? 30 | */ 31 | 32 | #if defined(HAVE_CONFIG_H) 33 | #include "config.h" 34 | #endif 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | //#if defined(WITH_SPANDSP_INTERNALS) 42 | #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES 43 | //#endif 44 | 45 | #include "spandsp.h" 46 | 47 | int main (int argc, char *argv[]) 48 | { 49 | awgn_state_t noise_source; 50 | dc_restore_state_t dc_state; 51 | int i; 52 | int idum = 1234567; 53 | int16_t dirty; 54 | int16_t clean; 55 | int estimate; 56 | int min; 57 | int max; 58 | int dc_offset; 59 | 60 | dc_offset = 5000; 61 | awgn_init_dbm0(&noise_source, idum, -10.0); 62 | dc_restore_init(&dc_state); 63 | for (i = 0; i < 100000; i++) 64 | { 65 | dirty = awgn(&noise_source) + dc_offset; 66 | clean = dc_restore(&dc_state, dirty); 67 | if ((i % 1000) == 0) 68 | { 69 | printf("Sample %6d: %d (expect %d)\n", 70 | i, 71 | dc_restore_estimate(&dc_state), 72 | dc_offset); 73 | } 74 | } 75 | /* We should have settled by now. Look at the variation we get */ 76 | min = 99999; 77 | max = -99999; 78 | for (i = 0; i < 100000; i++) 79 | { 80 | dirty = awgn(&noise_source) + dc_offset; 81 | clean = dc_restore(&dc_state, dirty); 82 | estimate = dc_restore_estimate(&dc_state); 83 | if (estimate < min) 84 | min = estimate; 85 | if (estimate > max) 86 | max = estimate; 87 | } 88 | printf("Spread of DC estimate for an offset of %d was %d to %d\n", dc_offset, min, max); 89 | if (min < dc_offset - 50 || max > dc_offset + 50) 90 | { 91 | printf("Test failed.\n"); 92 | exit(2); 93 | } 94 | printf("Test passed.\n"); 95 | return 0; 96 | } 97 | /*- End of function --------------------------------------------------------*/ 98 | /*- End of file ------------------------------------------------------------*/ 99 | -------------------------------------------------------------------------------- /tests/echo_monitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * echo_monitor.h - Display echo canceller status, using the FLTK toolkit. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: echo_monitor.h,v 1.12 2008/04/26 13:39:16 steveu Exp $ 26 | */ 27 | 28 | /*! \page echo_monitor_page Echo canceller performance monitoring 29 | \section echo_monitor_page_sec_1 What does it do? 30 | This code controls a GUI window, which provides monitoring of the internal status 31 | of a time domain echo canceller. It shows, graphically: 32 | 33 | - the spectrum of the received signal. 34 | - the line model in use (when a known line model is being used). 35 | - the adapted coefficients of the canceller. 36 | 37 | \section echo_monitor_page_sec_2 How does it work? 38 | This code uses the FLTK cross platform GUI toolkit. It works on X11 and Windows platforms. 39 | In addition to the basic FLTK toolkit, fltk_cartesian is also required. 40 | */ 41 | 42 | #if !defined(_ECHO_MONITOR_H_) 43 | #define _ECHO_MONITOR_H_ 44 | 45 | #if defined(__cplusplus) 46 | extern "C" 47 | { 48 | #endif 49 | 50 | int start_echo_can_monitor(int len); 51 | int echo_can_monitor_can_update(const int16_t *coeffs, int len); 52 | int echo_can_monitor_line_model_update(const int32_t *coeffs, int len); 53 | int echo_can_monitor_line_spectrum_update(const int16_t amp[], int len); 54 | void echo_can_monitor_wait_to_end(void); 55 | void echo_can_monitor_update_display(void); 56 | 57 | #if defined(__cplusplus) 58 | } 59 | #endif 60 | 61 | #endif 62 | /*- End of file ------------------------------------------------------------*/ 63 | -------------------------------------------------------------------------------- /tests/fax_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * fax_utils.h 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2009 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: fax_utils.h,v 1.1 2009/02/20 12:34:20 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if !defined(_SPANDSP_FAX_UTILS_H_) 31 | #define _SPANDSP_FAX_UTILS_H_ 32 | 33 | #if defined(__cplusplus) 34 | extern "C" 35 | { 36 | #endif 37 | 38 | void log_tx_parameters(t30_state_t *s, const char *tag); 39 | 40 | void log_rx_parameters(t30_state_t *s, const char *tag); 41 | 42 | void log_transfer_statistics(t30_state_t *s, const char *tag); 43 | 44 | #if defined(__cplusplus) 45 | } 46 | #endif 47 | 48 | #endif 49 | /*- End of file ------------------------------------------------------------*/ 50 | -------------------------------------------------------------------------------- /tests/g726_tests.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/tests/g726_tests.c -------------------------------------------------------------------------------- /tests/line_model_monitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * line_model_monitor.h - Model activity in a telephone line model, using the FLTK toolkit. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: line_model_monitor.h,v 1.7 2008/04/26 13:39:17 steveu Exp $ 26 | */ 27 | 28 | /*! \page line_model_monitor_page Telephone line model monitoring 29 | \section line_model_monitor_page_sec_1 What does it do? 30 | This code controls a GUI window, which provides monitoring of the internal status 31 | of a telephone line modem. It shows, graphically: 32 | 33 | - the spectrum of the received signal. 34 | - the line model in use (when a known line model is being used). 35 | - the adapted coefficients of the canceller. 36 | 37 | \section line_model_monitor_page_sec_2 How does it work? 38 | This code uses the FLTK cross platform GUI toolkit. It works on X11 and Windows platforms. 39 | In addition to the basic FLTK toolkit, fltk_cartesian is also required. 40 | */ 41 | 42 | #if !defined(_LINE_MODEL_MONITOR_H_) 43 | #define _LINE_MODEL_MONITOR_H_ 44 | 45 | #if defined(__cplusplus) 46 | extern "C" 47 | { 48 | #endif 49 | 50 | int start_line_model_monitor(int len); 51 | int line_model_monitor_can_update(const float *coeffs, int len); 52 | int line_model_monitor_line_model_update(const float *coeffs, int len); 53 | int line_model_monitor_line_spectrum_update(const int16_t amp[], int len); 54 | void line_model_monitor_wait_to_end(void); 55 | void line_model_monitor_update_display(void); 56 | 57 | #if defined(__cplusplus) 58 | } 59 | #endif 60 | 61 | #endif 62 | /*- End of file ------------------------------------------------------------*/ 63 | -------------------------------------------------------------------------------- /tests/media_monitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * media_monitor.h - Display IP streaming media status, using the FLTK toolkit. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2007 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: media_monitor.h,v 1.6 2008/04/26 13:39:17 steveu Exp $ 26 | */ 27 | 28 | /*! \page media_monitor_page IP streaming media performance monitoring 29 | \section media_monitor_page_sec_1 What does it do? 30 | This code controls a GUI window, which provides monitoring of the status 31 | of an IP media stream. It shows, graphically: 32 | 33 | \section media_monitor_page_sec_2 How does it work? 34 | This code uses the FLTK cross platform GUI toolkit. It works on X11 and Windows platforms. 35 | In addition to the basic FLTK toolkit, fltk_cartesian is also required. 36 | */ 37 | 38 | #if !defined(_MEDIA_MONITOR_H_) 39 | #define _MEDIA_MONITOR_H_ 40 | 41 | #if defined(__cplusplus) 42 | extern "C" 43 | { 44 | #endif 45 | 46 | int start_media_monitor(void); 47 | void media_monitor_rx(int seq_no, double departure_time, double arrival_time); 48 | void media_monitor_wait_to_end(void); 49 | void media_monitor_update_display(void); 50 | 51 | #if defined(__cplusplus) 52 | } 53 | #endif 54 | 55 | #endif 56 | /*- End of file ------------------------------------------------------------*/ 57 | -------------------------------------------------------------------------------- /tests/modem_monitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * constel.h - Display QAM constellations, using the FLTK toolkit. 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2004 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: modem_monitor.h,v 1.16 2008/09/03 13:41:42 steveu Exp $ 26 | */ 27 | 28 | /*! \page constel_page Modem performance monitoring 29 | \section constel_page_sec_1 What does it do? 30 | This code controls a GUI window, which provides monitoring of the internal status 31 | of a modem. It shows, graphically: 32 | 33 | - the constellation, for PSK, QAM and other similar modulations. 34 | - the equalizer status, for modems with adaptive equalizers. 35 | - the carrier frequency. 36 | - the symbol timing correction. 37 | 38 | \section constel_page_sec_2 How does it work? 39 | This code uses the FLTK cross platform GUI toolkit. It works on X11 and Windows platforms. 40 | In addition to the basic FLTK toolkit, fltk_cartesian is also required. 41 | */ 42 | 43 | #if !defined(_MODEM_MONITOR_H_) 44 | #define _MODEM_MONITOR_H_ 45 | 46 | struct qam_monitor_s; 47 | 48 | typedef struct qam_monitor_s qam_monitor_t; 49 | 50 | #if defined(__cplusplus) 51 | extern "C" 52 | { 53 | #endif 54 | 55 | qam_monitor_t *qam_monitor_init(float constel_width, const char *tag); 56 | int qam_monitor_clear_constel(qam_monitor_t *s); 57 | int qam_monitor_update_constel(qam_monitor_t *s, const complexf_t *pt); 58 | int qam_monitor_update_equalizer(qam_monitor_t *s, const complexf_t *coeffs, int len); 59 | int qam_monitor_update_int_equalizer(qam_monitor_t *s, const complexi16_t *coeffs, int len); 60 | int qam_monitor_update_symbol_tracking(qam_monitor_t *s, float total_correction); 61 | int qam_monitor_update_carrier_tracking(qam_monitor_t *s, float carrier); 62 | int qam_monitor_update_audio_level(qam_monitor_t *s, const int16_t amp[], int len); 63 | void qam_wait_to_end(qam_monitor_t *s); 64 | 65 | #if defined(__cplusplus) 66 | } 67 | #endif 68 | 69 | #endif 70 | /*- End of file ------------------------------------------------------------*/ 71 | -------------------------------------------------------------------------------- /tests/swept_tone_tests.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * swept_tone_tests.c 5 | * 6 | * Written by Steve Underwood 7 | * 8 | * Copyright (C) 2009 Steve Underwood 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | * $Id: swept_tone_tests.c,v 1.2 2009/09/22 13:28:18 steveu Exp $ 26 | */ 27 | 28 | /*! \file */ 29 | 30 | #if defined(HAVE_CONFIG_H) 31 | #include "config.h" 32 | #endif 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include "spandsp.h" 41 | #include "spandsp-sim.h" 42 | 43 | #define OUTPUT_FILE_NAME "swept_tone.wav" 44 | 45 | #define BLOCK_LEN 160 46 | 47 | int main(int argc, char *argv[]) 48 | { 49 | int i; 50 | int j; 51 | int outframes; 52 | int len; 53 | SNDFILE *outhandle; 54 | power_meter_t meter; 55 | swept_tone_state_t *s; 56 | int16_t buf[BLOCK_LEN]; 57 | 58 | power_meter_init(&meter, 10); 59 | 60 | if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) 61 | { 62 | fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME); 63 | exit(2); 64 | } 65 | 66 | printf("Test with swept tone.\n"); 67 | s = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 60*SAMPLE_RATE, 1); 68 | for (j = 0; j < 60*SAMPLE_RATE; j += BLOCK_LEN) 69 | { 70 | len = swept_tone(s, buf, BLOCK_LEN); 71 | for (i = 0; i < len; i++) 72 | power_meter_update(&meter, buf[i]); 73 | outframes = sf_writef_short(outhandle, buf, len); 74 | if (outframes != len) 75 | { 76 | fprintf(stderr, " Error writing audio file\n"); 77 | exit(2); 78 | } 79 | #if 0 80 | printf("Current freq %.1fHz, Level is %fdBOv/%fdBm0\n", 81 | swept_tone_current_frequency(s), 82 | power_meter_current_dbov(&meter), 83 | power_meter_current_dbm0(&meter)); 84 | #else 85 | printf("%.1f %f\n", 86 | swept_tone_current_frequency(s), 87 | power_meter_current_dbm0(&meter)); 88 | #endif 89 | } 90 | 91 | if (sf_close(outhandle) != 0) 92 | { 93 | fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); 94 | exit(2); 95 | } 96 | 97 | printf("Tests passed.\n"); 98 | return 0; 99 | } 100 | /*- End of function --------------------------------------------------------*/ 101 | /*- End of file ------------------------------------------------------------*/ 102 | -------------------------------------------------------------------------------- /tests/v18_tests.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jart/spandsp/6de1983b251806d59bb3149b7a2d7ebc99ace5aa/tests/v18_tests.c -------------------------------------------------------------------------------- /unpack_g722_data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # SpanDSP - a series of DSP components for telephony 4 | # 5 | # unpack_g722_data.sh 6 | # 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU Lesser General Public License version 2.1, 9 | # as published by the Free Software Foundation. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | # 20 | # $Id: unpack_g722_data.sh,v 1.5 2008/05/03 07:55:04 steveu Exp $ 21 | # 22 | 23 | ITUDATA="../../../T-REC-G.722-198703-I!AppII!ZPF-E.zip" 24 | 25 | cd test-data/itu 26 | if [ -d g722 ] 27 | then 28 | cd g722 29 | else 30 | mkdir g722 31 | RETVAL=$? 32 | if [ $RETVAL != 0 ] 33 | then 34 | echo Cannot create test-data/itu/g722! 35 | exit $RETVAL 36 | fi 37 | cd g722 38 | fi 39 | 40 | rm -rf T* 41 | rm -rf software 42 | unzip ${ITUDATA} >/dev/null 43 | RETVAL=$? 44 | if [ $RETVAL != 0 ] 45 | then 46 | echo Cannot unpack the ITU test vectors for G.722! 47 | exit $RETVAL 48 | fi 49 | #rm ${ITUDATA} 50 | unzip ./software/G722ap2/G722E/Software.zip >/dev/null 51 | RETVAL=$? 52 | if [ $RETVAL != 0 ] 53 | then 54 | echo Cannot unpack the ITU test vectors for G.722! 55 | exit $RETVAL 56 | fi 57 | mv ./software/G722ap2/G722E/T* . 58 | rm -rf software 59 | echo The ITU test vectors for G.722 should now be in the g722 directory 60 | -------------------------------------------------------------------------------- /unpack_g726_data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # SpanDSP - a series of DSP components for telephony 4 | # 5 | # unpack_g726_data.sh 6 | # 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU Lesser General Public License version 2.1, 9 | # as published by the Free Software Foundation. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | # 20 | # $Id: unpack_g726_data.sh,v 1.6 2008/05/03 07:55:04 steveu Exp $ 21 | # 22 | 23 | ITUDATA="../../../T-REC-G.726-199103-I!AppII!SOFT-ZST-E.zip" 24 | 25 | cd test-data/itu 26 | if [ -d g726 ] 27 | then 28 | cd g726 29 | else 30 | mkdir g726 31 | RETVAL=$? 32 | if [ $RETVAL != 0 ] 33 | then 34 | echo Cannot create test-data/itu/g726! 35 | exit $RETVAL 36 | fi 37 | cd g726 38 | fi 39 | 40 | rm -rf DISK1 41 | rm -rf DISK2 42 | rm -rf G726piiE.WW7.doc 43 | rm -rf Software.zip 44 | unzip ${ITUDATA} >/dev/null 45 | RETVAL=$? 46 | if [ $RETVAL != 0 ] 47 | then 48 | echo Cannot unpack the ITU test vectors for G.726! 49 | exit $RETVAL 50 | fi 51 | #rm $(ITUDATA} 52 | rm G726piiE.WW7.doc 53 | unzip Software.zip >/dev/null 54 | RETVAL=$? 55 | if [ $RETVAL != 0 ] 56 | then 57 | echo Cannot unpack the ITU test vectors for G.726! 58 | exit $RETVAL 59 | fi 60 | rm Software.zip 61 | mv ./software/G726ap2/G726ap2e/DISK1 . 62 | mv ./software/G726ap2/G726ap2e/DISK2 . 63 | rm -rf ./software 64 | echo The ITU test vectors for G.726 should now be in the g726 directory 65 | -------------------------------------------------------------------------------- /unpack_v56ter_data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # SpanDSP - a series of DSP components for telephony 4 | # 5 | # unpack_v56ter_data.sh 6 | # 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU Lesser General Public License version 2.1, 9 | # as published by the Free Software Foundation. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | # 20 | # $Id: unpack_v56ter_data.sh,v 1.5 2008/05/03 07:55:04 steveu Exp $ 21 | # 22 | 23 | ITUDATA="../../../T-REC-V.56ter-199608-I!!ZPF-E.zip" 24 | 25 | cd test-data/itu 26 | if [ -d v56ter ] 27 | then 28 | cd v56ter 29 | else 30 | mkdir v56ter 31 | RETVAL=$? 32 | if [ $RETVAL != 0 ] 33 | then 34 | echo Cannot create test-data/itu/v56ter! 35 | exit $RETVAL 36 | fi 37 | cd v56ter 38 | fi 39 | 40 | rm -rf software 41 | rm -rf *.TST 42 | unzip ${ITUDATA} >/dev/null 43 | RETVAL=$? 44 | if [ $RETVAL != 0 ] 45 | then 46 | echo Cannot unpack the ITU test vectors for V.56ter! 47 | exit $RETVAL 48 | fi 49 | #rm ${ITUDATA} 50 | unzip software/V56ter/V56tere/Software.zip >/dev/null 51 | RETVAL=$? 52 | if [ $RETVAL != 0 ] 53 | then 54 | echo Cannot unpack the ITU test vectors for V.56ter! 55 | exit $RETVAL 56 | fi 57 | mv ./software/V56ter/V56tere/*.TST . 58 | chmod 644 *.TST 59 | rm -rf software 60 | echo The ITU test vectors for V.56ter should now be in the v56ter directory 61 | -------------------------------------------------------------------------------- /wrapper.xsl: -------------------------------------------------------------------------------- 1 | 3 | 4 | css.css 5 | --------------------------------------------------------------------------------