#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#include "floating_fudge.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"
#include "spandsp/private/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_release (fsk_tx_state_t *s) |
int | fsk_tx_free (fsk_tx_state_t *s) |
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_tx_set_modem_status_handler (fsk_tx_state_t *s, modem_tx_status_func_t handler, void *user_data) |
Change the modem status report function associated with an FSK modem transmit context. | |
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) |
void | fsk_rx_set_modem_status_handler (fsk_rx_state_t *s, modem_tx_status_func_t handler, void *user_data) |
Change the modem status report function associated with an FSK modem receive context. | |
fsk_rx_state_t * | fsk_rx_init (fsk_rx_state_t *s, const fsk_spec_t *spec, int framing_mode, put_bit_func_t put_bit, void *user_data) |
Initialise an FSK modem receive context. | |
int | fsk_rx_release (fsk_rx_state_t *s) |
int | fsk_rx_free (fsk_rx_state_t *s) |
int | fsk_rx (fsk_rx_state_t *s, const int16_t *amp, int len) |
Process a block of received FSK modem audio samples. | |
int | fsk_rx_fillin (fsk_rx_state_t *s, int len) |
Fake processing of a missing 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, power_meter_update(), complexi_t::re, SIG_STATUS_CARRIER_DOWN, and SIG_STATUS_CARRIER_UP.
Referenced by adsi_rx(), modem_connect_tones_rx(), v18_rx(), and v8_rx().
int fsk_rx_fillin | ( | fsk_rx_state_t * | s, | |
int | len | |||
) |
Fake processing of a missing block of received FSK modem audio samples.
Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss).
s | The modem context. | |
len | The number of samples to fake. |
Referenced by fax_rx_fillin(), and t31_rx_fillin().
fsk_rx_state_t* fsk_rx_init | ( | fsk_rx_state_t * | s, | |
const fsk_spec_t * | spec, | |||
int | framing_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. | |
framing_mode | 0 for fully asynchronous mode. 1 for synchronous mode. >1 for this many bits per asynchronous character frame. | |
put_bit | The callback routine used to put the received data. | |
user_data | An opaque pointer. |
References dds_phase_rate(), fsk_rx_signal_cutoff(), and power_meter_init().
Referenced by adsi_rx_init(), modem_connect_tones_rx_init(), and v18_init().
void fsk_rx_set_modem_status_handler | ( | fsk_rx_state_t * | s, | |
modem_rx_status_func_t | handler, | |||
void * | user_data | |||
) |
Change the modem status report function associated with an FSK modem receive context.
Change the modem status report function associated with an FSK modem receive context.
s | The modem context. | |
handler | The callback routine used to report modem status changes. | |
user_data | An opaque pointer. |
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 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(), SIG_STATUS_END_OF_DATA, and SIG_STATUS_SHUTDOWN_COMPLETE.
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 dds_phase_rate(), and dds_scaling_dbm0().
Referenced by v18_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().
void fsk_tx_set_modem_status_handler | ( | fsk_tx_state_t * | s, | |
modem_tx_status_func_t | handler, | |||
void * | user_data | |||
) |
Change the modem status report function associated with an FSK modem transmit context.
Change the modem status report function associated with an FSK modem transmit context.
s | The modem context. | |
handler | The callback routine used to report modem status changes. | |
user_data | An opaque pointer. |