v22bis_rx.c File Reference

#include <inttypes.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "spandsp/telephony.h"
#include "spandsp/logging.h"
#include "spandsp/async.h"
#include "spandsp/power_meter.h"
#include "spandsp/arctan2.h"
#include "spandsp/complex.h"
#include "spandsp/dds.h"
#include "spandsp/complex_filters.h"
#include "spandsp/v29rx.h"
#include "spandsp/v22bis.h"

Defines

#define ms_to_symbols(t)   (((t)*600)/1000)
#define PULSESHAPER_GAIN   39.98830768
#define PULSESHAPER_COEFF_SETS   12

Enumerations

enum  {
  V22BIS_TRAINING_STAGE_NORMAL_OPERATION, V22BIS_TRAINING_STAGE_SYMBOL_ACQUISITION, V22BIS_TRAINING_STAGE_LOG_PHASE, V22BIS_TRAINING_STAGE_UNSCRAMBLED_ONES,
  V22BIS_TRAINING_STAGE_UNSCRAMBLED_0011, V22BIS_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200, V22BIS_TRAINING_STAGE_SCRAMBLED_ONES_AT_2400, V22BIS_TRAINING_STAGE_WAIT_FOR_START_1,
  V22BIS_TRAINING_STAGE_WAIT_FOR_START_2, V22BIS_TRAINING_STAGE_PARKED
}

Functions

float v22bis_rx_carrier_frequency (v22bis_state_t *s)
float v22bis_rx_symbol_timing_correction (v22bis_state_t *s)
float v22bis_rx_signal_power (v22bis_state_t *s)
int v22bis_rx_equalizer_state (v22bis_state_t *s, complex_t **coeffs)
 Get a snapshot of the current equalizer coefficients.
int v22bis_rx (v22bis_state_t *s, const int16_t *amp, int len)
 Process a block of received V.22bis modem audio samples.
int v22bis_rx_restart (v22bis_state_t *s, int bit_rate)
 Reinitialise an existing V.22bis modem receive context.
void v22bis_rx_set_qam_report_handler (v22bis_state_t *s, qam_report_handler_t *handler, void *user_data)

Detailed Description


Function Documentation

int v22bis_rx ( v22bis_state_t s,
const int16_t *  amp,
int  len 
)

Process a block of received V.22bis modem audio samples.

Process a block of received V.22bis 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.

float v22bis_rx_carrier_frequency ( v22bis_state_t s  ) 

Get the current received carrier frequency.

Parameters:
s The modem context.
Returns:
The frequency, in Hertz.

int v22bis_rx_equalizer_state ( v22bis_state_t s,
complex_t **  coeffs 
)

Get a snapshot of the current equalizer coefficients.

Get a snapshot of the current equalizer coefficients.

Parameters:
coeffs The vector of complex coefficients.
Returns:
The number of coefficients in the vector.

int v22bis_rx_restart ( v22bis_state_t s,
int  bit_rate 
)

Reinitialise an existing V.22bis modem receive context.

Reinitialise an existing V.22bis modem receive context.

Parameters:
s The modem context.
rate The bit rate of the modem. Valid values are 1200 and 2400.
Returns:
0 for OK, -1 for bad parameter

void v22bis_rx_set_qam_report_handler ( v22bis_state_t s,
qam_report_handler_t *  handler,
void *  user_data 
)

Set a handler routine to process QAM status reports

Parameters:
s The modem context.
handler The handler routine.
user_data An opaque pointer passed to the handler routine.

float v22bis_rx_signal_power ( v22bis_state_t s  ) 

Get a current received signal power.

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

float v22bis_rx_symbol_timing_correction ( v22bis_state_t s  ) 

Get the current symbol timing correction since startup.

Parameters:
s The modem context.
Returns:
The correction.


Generated on Fri Nov 10 09:40:25 2006 for libspandsp by  doxygen 1.5.1