dds_int.c File Reference

#include <inttypes.h>
#include "spandsp/telephony.h"
#include "spandsp/dds.h"

Defines

#define M_PI   3.14159265358979323846
#define SLENK   7
#define DDS_STEPS   (1 << SLENK)
#define DDS_SHIFT   (32 - 2 - SLENK)

Functions

int32_t dds_phase_rate (float frequency)
 Find the phase rate value to achieve a particular frequency.
float dds_frequency (int32_t phase_rate)
int dds_scaling_dbm0 (float level)
 Find the scaling factor needed to achieve a specified level in dBm0.
int dds_scaling_dbov (float level)
int16_t dds_lookup (uint32_t phase)
 Find the amplitude for a particular phase.
int16_t dds_offset (uint32_t phase_acc, int32_t phase_offset)
 Find the amplitude for a particular phase offset from an accumulated phase.
int16_t dds (uint32_t *phase_acc, int32_t phase_rate)
 Generate an integer tone sample.
int16_t dds_mod (uint32_t *phase_acc, int32_t phase_rate, int scale, int32_t phase)
 Generate an integer tone sample, with modulation.
complexi_t dds_complexi (uint32_t *phase_acc, int32_t phase_rate)
 Generate a complex integer tone sample.
complexi_t dds_complexi_mod (uint32_t *phase_acc, int32_t phase_rate, int scale, int32_t phase)
 Generate a complex integer tone sample, with modulation.

Detailed Description


Function Documentation

int16_t dds ( uint32_t *  phase_acc,
int32_t  phase_rate 
)

Generate an integer tone sample.

Parameters:
phase_acc A pointer to a phase accumulator value.
phase_rate The phase increment to be applied.
Returns:
The signal amplitude, between -32767 and 32767.

complexi_t dds_complexi ( uint32_t *  phase_acc,
int32_t  phase_rate 
)

Generate a complex integer tone sample.

Parameters:
phase_acc A pointer to a phase accumulator value.
phase_rate The phase increment to be applied.
Returns:
The complex signal amplitude, between -32767 and 32767.

complexi_t dds_complexi_mod ( uint32_t *  phase_acc,
int32_t  phase_rate,
int  scale,
int32_t  phase 
)

Generate a complex integer tone sample, with modulation.

Parameters:
phase_acc A pointer to a phase accumulator value.
phase_rate The phase increment to be applied.
scale The scaling factor.
phase The phase offset.
Returns:
The complex signal amplitude.

int16_t dds_lookup ( uint32_t  phase  ) 

Find the amplitude for a particular phase.

Parameters:
phase The desired phase 32 bit phase.
Returns:
The signal amplitude.

int16_t dds_mod ( uint32_t *  phase_acc,
int32_t  phase_rate,
int  scale,
int32_t  phase 
)

Generate an integer tone sample, with modulation.

Parameters:
phase_acc A pointer to a phase accumulator value.
phase_rate The phase increment to be applied.
scale The scaling factor.
phase The phase offset.
Returns:
The signal amplitude.

int16_t dds_offset ( uint32_t  phase_acc,
int32_t  phase_offset 
)

Find the amplitude for a particular phase offset from an accumulated phase.

Parameters:
phase_acc The accumulated phase.
phase_offset The phase offset.
Returns:
The signal amplitude.

int32_t dds_phase_rate ( float  frequency  ) 

Find the phase rate value to achieve a particular frequency.

Parameters:
frequency The desired frequency, in Hertz.
Returns:
The phase rate which while achieve the desired frequency.

int dds_scaling_dbm0 ( float  level  ) 

Find the scaling factor needed to achieve a specified level in dBm0.

Parameters:
level The desired signal level, in dBm0.
Returns:
The scaling factor.


Generated on Tue Jul 24 11:29:29 2007 for libspandsp by  doxygen 1.5.2