libspandsp 0.0.4

fsk.h File Reference

Go to the source code of this file.

Classes

struct  fsk_spec_t
struct  fsk_tx_state_t
struct  fsk_rx_state_t

Defines

#define FSK_MAX_WINDOW_LEN   128

Enumerations

enum  {
  FSK_V21CH1 = 0, FSK_V21CH2, FSK_V23CH1, FSK_V23CH2,
  FSK_BELL103CH1, FSK_BELL103CH2, FSK_BELL202, FSK_WEITBRECHT
}

Functions

fsk_tx_state_tfsk_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.
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)
int fsk_tx (fsk_tx_state_t *s, int16_t *amp, int len)
 Generate a block of FSK modem audio samples.
float fsk_rx_signal_power (fsk_rx_state_t *s)
void fsk_rx_signal_cutoff (fsk_rx_state_t *s, float cutoff)
 Adjust an FSK modem receive context's carrier detect power threshold.
fsk_rx_state_tfsk_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.
void fsk_rx_set_put_bit (fsk_rx_state_t *s, put_bit_func_t put_bit, void *user_data)

Variables

const fsk_spec_t preset_fsk_specs []

Detailed Description


Function Documentation

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.

Parameters:
sThe modem context.
ampThe audio sample buffer.
lenThe number of samples in the buffer.
Returns:
The number of samples unprocessed.

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.

Parameters:
sThe modem context.
specThe specification of the modem tones and rate.
sync_modeTRUE for synchronous modem. FALSE for asynchronous mode.
put_bitThe callback routine used to put the received data.
user_dataAn opaque pointer.
Returns:
A pointer to the modem context, or NULL if there was a problem.

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.

Parameters:
sThe modem context.
cutoffThe 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.

Parameters:
sThe modem context.
Returns:
The signal power, in dBm0.

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.

Parameters:
sThe modem context.
ampThe audio sample buffer.
lenThe number of samples to be generated.
Returns:
The number of samples actually generated.

References dds_mod(), and PUTBIT_END_OF_DATA.

Referenced by adsi_tx(), and v8_tx().

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.

Parameters:
sThe modem context.
specThe specification of the modem tones and rate.
get_bitThe callback routine used to get the data to be transmitted.
user_dataAn opaque pointer.
Returns:
A pointer to the modem context, or NULL if there was a problem.

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.

Parameters:
sThe modem context.
powerThe power level, in dBm0

References dds_scaling_dbm0().