spandsp  0.0.6
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 <steveu@coppice.org>
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 
26 #if !defined(_SPANDSP_PRIVATE_TONE_GENERATE_H_)
27 #define _SPANDSP_PRIVATE_TONE_GENERATE_H_
28 
30 {
31  int32_t phase_rate;
32 #if defined(SPANDSP_USE_FIXED_POINT)
33  int16_t gain;
34 #else
35  float gain;
36 #endif
37 };
38 
39 /*!
40  Cadenced multi-tone generator descriptor.
41 */
43 {
45  int duration[4];
46  int repeat;
47 };
48 
49 /*!
50  Cadenced multi-tone generator state descriptor. This defines the state of
51  a single working instance of a generator.
52 */
54 {
56 
57  uint32_t phase[4];
58  int duration[4];
59  int repeat;
60 
61  int current_section;
62  int current_position;
63 };
64 
65 #endif
66 /*- End of file ------------------------------------------------------------*/
periodogram_generate_phase_offset
float periodogram_generate_phase_offset(complexf_t *offset, float freq, int sample_rate, int interval)
Definition: tone_detect.c:277
tone_generate.h
dds_mod
int16_t dds_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase)
Generate an integer tone sample, with modulation.
Definition: dds_int.c:378
complexf_t
Definition: complex.h:42
dds_phase_rate
int32_t dds_phase_rate(float frequency)
Find the phase rate value to achieve a particular frequency.
Definition: dds_int.c:316
dds_phase_ratef
int32_t dds_phase_ratef(float frequency)
Find the phase rate equivalent to a frequency, in Hz.
Definition: dds_float.c:2109
dds_scaling_dbm0
int16_t dds_scaling_dbm0(float level)
Find the scaling factor needed to achieve a specified level in dBm0.
Definition: dds_int.c:328
dds_complexf
complexf_t dds_complexf(uint32_t *phase_acc, int32_t phase_rate)
Generate a complex floating point tone sample.
Definition: dds_float.c:2165
tone_gen_descriptor_init
tone_gen_descriptor_t * tone_gen_descriptor_init(tone_gen_descriptor_t *s, int f1, int l1, int f2, int l2, int d1, int d2, int d3, int d4, int repeat)
Create a tone generator descriptor.
Definition: tone_generate.c:60
awgn_state_s
Definition: private/awgn.h:32
SPAN_DECLARE_NONSTD
SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data)
Get the next bit of a transmitted serial bit stream.
complex.h
complexf_t::im
float im
Imaginary part.
Definition: complex.h:47
tone_gen_descriptor_s
Definition: private/tone_generate.h:42
tone_gen_tone_descriptor_s
Definition: private/tone_generate.h:29
dc_restore.h
dds_modf
float dds_modf(uint32_t *phase_acc, int32_t phase_rate, float scale, int32_t phase)
Generate a floating point tone sample, with modulation.
Definition: dds_float.c:2155
periodogram
complexf_t periodogram(const complexf_t coeffs[], const complexf_t amp[], int len)
Definition: tone_detect.c:201
periodogram_generate_coeffs
int periodogram_generate_coeffs(complexf_t coeffs[], float freq, int sample_rate, int window_len)
Definition: tone_detect.c:248
complexf_t::re
float re
Real part.
Definition: complex.h:45
periodogram_freq_error
float periodogram_freq_error(const complexf_t *phase_offset, float scale, const complexf_t *last_result, const complexf_t *result)
Definition: tone_detect.c:289
tone_gen_state_s
Definition: private/tone_generate.h:53
dds_scaling_dbm0f
float dds_scaling_dbm0f(float level)
Find the scaling factor equivalent to a dBm0 value.
Definition: dds_float.c:2121
dds.h