libspandsp 0.0.4
|
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#include <assert.h>
#include "spandsp/telephony.h"
#include "spandsp/complex.h"
#include "spandsp/dds.h"
#include "spandsp/power_meter.h"
#include "spandsp/async.h"
#include "spandsp/fsk.h"
Functions | |
fsk_tx_state_t * | fsk_tx_init (fsk_tx_state_t *s, const fsk_spec_t *spec, get_bit_func_t get_bit, void *user_data) |
Initialise an FSK modem transmit context. | |
int | fsk_tx (fsk_tx_state_t *s, int16_t *amp, int len) |
Generate a block of FSK modem audio samples. | |
void | fsk_tx_power (fsk_tx_state_t *s, float power) |
Adjust an FSK modem transmit context's power output. | |
void | fsk_tx_set_get_bit (fsk_tx_state_t *s, get_bit_func_t get_bit, void *user_data) |
void | fsk_rx_signal_cutoff (fsk_rx_state_t *s, float cutoff) |
Adjust an FSK modem receive context's carrier detect power threshold. | |
float | fsk_rx_signal_power (fsk_rx_state_t *s) |
void | fsk_rx_set_put_bit (fsk_rx_state_t *s, put_bit_func_t put_bit, void *user_data) |
fsk_rx_state_t * | fsk_rx_init (fsk_rx_state_t *s, const fsk_spec_t *spec, int sync_mode, put_bit_func_t put_bit, void *user_data) |
Initialise an FSK modem receive context. | |
int | fsk_rx (fsk_rx_state_t *s, const int16_t *amp, int len) |
Process a block of received FSK modem audio samples. | |
Variables | |
const fsk_spec_t | preset_fsk_specs [] |
int fsk_rx | ( | fsk_rx_state_t * | s, |
const int16_t * | amp, | ||
int | len | ||
) |
Process a block of received FSK modem audio samples.
Process a block of received FSK modem audio samples.
s | The modem context. |
amp | The audio sample buffer. |
len | The number of samples in the buffer. |
References dds_complexi(), complexi_t::im, complexi32_t::im, fsk_rx_state_t::last_sample, power_meter_update(), PUTBIT_CARRIER_DOWN, PUTBIT_CARRIER_UP, complexi_t::re, complexi32_t::re, and fsk_rx_state_t::signal_present.
Referenced by adsi_rx(), modem_connect_tones_rx(), and v8_rx().
fsk_rx_state_t* fsk_rx_init | ( | fsk_rx_state_t * | s, |
const fsk_spec_t * | spec, | ||
int | sync_mode, | ||
put_bit_func_t | put_bit, | ||
void * | user_data | ||
) |
Initialise an FSK modem receive context.
Initialise an FSK modem receive context.
s | The modem context. |
spec | The specification of the modem tones and rate. |
sync_mode | TRUE for synchronous modem. FALSE for asynchronous mode. |
put_bit | The callback routine used to put the received data. |
user_data | An opaque pointer. |
References fsk_spec_t::baud_rate, dds_phase_rate(), fsk_spec_t::freq_one, fsk_spec_t::freq_zero, fsk_rx_signal_cutoff(), fsk_rx_state_t::last_sample, fsk_spec_t::min_level, power_meter_init(), and fsk_rx_state_t::signal_present.
Referenced by adsi_rx_init(), fax_init(), and modem_connect_tones_rx_init().
void fsk_rx_signal_cutoff | ( | fsk_rx_state_t * | s, |
float | cutoff | ||
) |
Adjust an FSK modem receive context's carrier detect power threshold.
Adjust an FSK modem receive context's carrier detect power threshold.
s | The modem context. |
cutoff | The power level, in dBm0 |
References power_meter_level_dbm0().
Referenced by fax_init(), fsk_rx_init(), and modem_connect_tones_rx_init().
float fsk_rx_signal_power | ( | fsk_rx_state_t * | s | ) |
Get the current received signal power.
s | The modem context. |
References power_meter_current_dbm0().
int fsk_tx | ( | fsk_tx_state_t * | s, |
int16_t * | amp, | ||
int | len | ||
) |
Generate a block of FSK modem audio samples.
Generate a block of FSK modem audio samples.
s | The modem context. |
amp | The audio sample buffer. |
len | The number of samples to be generated. |
References dds_mod(), and PUTBIT_END_OF_DATA.
fsk_tx_state_t* fsk_tx_init | ( | fsk_tx_state_t * | s, |
const fsk_spec_t * | spec, | ||
get_bit_func_t | get_bit, | ||
void * | user_data | ||
) |
Initialise an FSK modem transmit context.
Initialise an FSK modem transmit context.
s | The modem context. |
spec | The specification of the modem tones and rate. |
get_bit | The callback routine used to get the data to be transmitted. |
user_data | An opaque pointer. |
References fsk_spec_t::baud_rate, dds_phase_rate(), dds_scaling_dbm0(), fsk_spec_t::freq_one, fsk_spec_t::freq_zero, and fsk_spec_t::tx_level.
Referenced by fax_init(), and v8_rx().
void fsk_tx_power | ( | fsk_tx_state_t * | s, |
float | power | ||
) |
Adjust an FSK modem transmit context's power output.
Adjust an FSK modem transmit context's power output.
s | The modem context. |
power | The power level, in dBm0 |
References dds_scaling_dbm0().