spandsp 0.0.6

fsk.h File Reference

Go to the source code of this file.

## Classes
struct | fsk_spec_t

## Macros
#define | FSK_MAX_WINDOW_LEN 128

## Typedefs
typedef struct fsk_tx_state_s | fsk_tx_state_t
typedef struct fsk_rx_state_s | fsk_rx_state_t

## Enumerations
enum | { FSK_V21CH1 = 0 , FSK_V21CH2 , FSK_V23CH1 , FSK_V23CH2 , FSK_BELL103CH1 , FSK_BELL103CH2 , FSK_BELL202 , FSK_WEITBRECHT , FSK_WEITBRECHT50 , FSK_V21CH1_110 }
enum | { FSK_FRAME_MODE_ASYNC = 0 , FSK_FRAME_MODE_SYNC = 1 , FSK_FRAME_MODE_5N1_FRAMES = 7 , FSK_FRAME_MODE_7N1_FRAMES = 9 , FSK_FRAME_MODE_7E1_FRAMES = 10 , FSK_FRAME_MODE_7E2_FRAMES = 11 }

## 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_restart (fsk_tx_state_t *s, const fsk_spec_t *spec)
int | fsk_tx_release (fsk_tx_state_t *s)
int | fsk_tx_free (fsk_tx_state_t *s)
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_status_func_t handler, void *user_data)
| Change the modem status report function associated with an FSK modem transmit context.
| SPAN_DECLARE_NONSTD (int) fsk_tx(fsk_tx_state_t *s
| 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_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_restart (fsk_rx_state_t *s, const fsk_spec_t *spec, int framing_mode)
int | fsk_rx_release (fsk_rx_state_t *s)
int | fsk_rx_free (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_status_func_t handler, void *user_data)
| Change the modem status report function associated with an FSK modem receive context.

## Variables
SPAN_DECLARE_DATA const fsk_spec_t | preset_fsk_specs []
int16_t | amp []
int16_t int | len

## Typedef Documentation

## ◆ fsk_rx_state_t

typedef struct fsk_rx_state_s fsk_rx_state_t

FSK modem receive descriptor. This defines the state of a single working instance of an FSK modem receiver.

## ◆ fsk_tx_state_t

typedef struct fsk_tx_state_s fsk_tx_state_t

FSK modem transmit descriptor. This defines the state of a single working instance of an FSK modem transmitter.

## Function Documentation

## ◆ fsk_rx_init()

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.

Parameters

  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.

Returns
  A pointer to the modem context, or NULL if there was a problem.

References fsk_rx_state_s::put_bit, and fsk_rx_state_s::put_bit_user_data.

Referenced by adsi_rx_init(), modem_connect_tones_rx_init(), and v18_init().

## ◆ fsk_rx_set_modem_status_handler()

void fsk_rx_set_modem_status_handler | ( | fsk_rx_state_t * | s,
|  | modem_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.

Parameters

  s | The modem context.
  handler | The callback routine used to report modem status changes.
  user_data | An opaque pointer.

References fsk_rx_state_s::status_handler, and fsk_rx_state_s::status_user_data.

## ◆ fsk_rx_signal_cutoff()

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

  s | The modem context.
  cutoff | The power level, in dBm0

References power_meter_level_dbm0().

Referenced by modem_connect_tones_rx_init().

## ◆ fsk_rx_signal_power()

float fsk_rx_signal_power | ( | fsk_rx_state_t * | s | ) |

Get the current received signal power.

Parameters

  s | The modem context.

Returns
  The signal power, in dBm0.

References power_meter_current_dbm0().

## ◆ fsk_tx_init()

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

  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.

Returns
  A pointer to the modem context, or NULL if there was a problem.

References fsk_tx_state_s::get_bit, and fsk_tx_state_s::get_bit_user_data.

Referenced by v18_init().

## ◆ fsk_tx_power()

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

  s | The modem context.
  power | The power level, in dBm0

References dds_scaling_dbm0().

## ◆ fsk_tx_set_modem_status_handler()

void fsk_tx_set_modem_status_handler | ( | fsk_tx_state_t * | s,
|  | modem_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.

Parameters

  s | The modem context.
  handler | The callback routine used to report modem status changes.
  user_data | An opaque pointer.

References fsk_tx_state_s::status_handler, and fsk_tx_state_s::status_user_data.

## ◆ SPAN_DECLARE_NONSTD()

SPAN_DECLARE_NONSTD | ( | int |  | ) |

Generate a block of FSK modem audio samples.

Get the next bit of data from a T.38 rate adapting non-ECM buffer context.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Fake processing of a missing block of received FSK modem audio samples.

Process a block of received FSK modem audio samples.

Generate a block of FSK modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples to be generated.

Returns
  The number of samples actually generated.

Process a block of received FSK modem audio samples.

Parameters

  s | The modem context.
  amp | The audio sample buffer.
  len | The number of samples in the buffer.

Returns
  The number of samples unprocessed.

Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss).

Parameters

  s | The modem context.
  len | The number of samples to fake.

Returns
  The number of samples unprocessed.