Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
DSPLIB - Signal generation

All the signal generation functions currently supported by the DSP library.


Sinusoidal

signal_generation_sinusoidal.gif

This function generates a sinusoidal signal with a specified frequency, sampling frequency and phase.

Note
The amplitude of the signal fits in the range [-1; 1].
The phase is scaled to fit in the range [-1; 1], where -1 corresponds to -pi and 1 to pi.

Relative functions:


Cosinusoidal

signal_generation_cosinusoidal.gif

This function generates a cosinusoidal signal with a specified frequency, sampling frequency and phase.

Note
The amplitude of the signal fits in the range [-1; 1].
The phase is scaled to fit in the range [-1; 1], where -1 corresponds to -pi and 1 to pi.

Relative functions:


Noise

signal_generation_noise.gif

This function generates a noise with a specified amplitude.

Note
The amplitude of the signal fits in the range [-1; 1].

Relative functions:


Rectangular

signal_generation_rectangular.gif

This function generates a rectangular signal.

Note
The amplitude of the signal fits in the range [-1; 1].

Relative functions:


Square

signal_generation_square.gif

This function generates a square signal.

Note
The amplitude of the signal fits in the range [-1; 1].

Relative functions:


Saw tooth

signal_generation_saw_tooth.gif

This function generates a saw tooth signal.

Note
The amplitude of the signal fits in the range [-1; 1].

Relative functions:


Dirac comb

signal_generation_dirac_comb.gif

This function generates a dirac comb signal.

Note
The amplitude of the signal fits in the range [0; 1].

Relative functions:


Ramp

signal_generation_ramp.gif

This function generates a ramp.

Note
The amplitude of the signal fits in the range [0; 1].

Relative functions:


Step

signal_generation_step.gif

This function generates a step.

Relative functions:


Dirac

signal_generation_dirac.gif

This function generates a dirac.

Note
The amplitude of the signal fits in the range [0; 1].

Relative functions:


Functions

dsp16_t dsp16_gen_cos (dsp16_t *vect1, int size, int f, int fs, dsp16_t phase)
 16-bit fixed point version of the cosinusoidal signal generation. More...
 
void dsp16_gen_dcomb (dsp16_t *vect1, int size, int f, int fs, dsp16_t delay)
 16-bit fixed point version of the dirac comb signal generation. More...
 
void dsp16_gen_dirac (dsp16_t *vect1, int size, int dirac_index)
 16-bit fixed point version of the dirac comb signal generation. More...
 
void dsp16_gen_noise (dsp16_t *vect1, int size, dsp16_t amp)
 16-bit fixed point version of the noise generation. More...
 
void dsp16_gen_ramp (dsp16_t *vect1, int size, dsp16_t increment)
 16-bit fixed point version of the ramp signal generation. More...
 
void dsp16_gen_rect (dsp16_t *vect1, int size, int f, int fs, dsp16_t duty, dsp16_t delay)
 16-bit fixed point version of the rectangular signal generation. More...
 
dsp16_t dsp16_gen_saw (dsp16_t *vect1, int size, int f, int fs, dsp16_t duty, dsp16_t delay)
 16-bit fixed point version of the saw tooth signal generation. More...
 
dsp16_t dsp16_gen_sin (dsp16_t *vect1, int size, int f, int fs, dsp16_t phase)
 16-bit fixed point version of the sinusoidal signal generation. More...
 
static void dsp16_gen_sqr (dsp16_t *vect1, int size, int f, int fs, dsp16_t delay)
 16-bit fixed point version of the square signal generation. More...
 
void dsp16_gen_step (dsp16_t *vect1, int size, dsp16_t intial_value, dsp16_t final_value, int step_index)
 16-bit fixed point version of the dirac comb signal generation. More...
 
dsp32_t dsp32_gen_cos (dsp32_t *vect1, int size, int f, int fs, dsp32_t phase)
 32-bit fixed point version of the cosinusoidal signal generation. More...
 
void dsp32_gen_dcomb (dsp32_t *vect1, int size, int f, int fs, dsp32_t delay)
 32-bit fixed point version of the dirac comb signal generation. More...
 
void dsp32_gen_dirac (dsp32_t *vect1, int size, int dirac_index)
 32-bit fixed point version of the dirac comb signal generation. More...
 
void dsp32_gen_noise (dsp32_t *vect1, int size, dsp32_t amp)
 32-bit fixed point version of the noise generation. More...
 
void dsp32_gen_ramp (dsp32_t *vect1, int size, dsp32_t increment)
 32-bit fixed point version of the ramp signal generation. More...
 
void dsp32_gen_rect (dsp32_t *vect1, int size, int f, int fs, dsp32_t duty, dsp32_t delay)
 32-bit fixed point version of the rectangular signal generation. More...
 
dsp32_t dsp32_gen_saw (dsp32_t *vect1, int size, int f, int fs, dsp32_t duty, dsp32_t delay)
 32-bit fixed point version of the saw tooth signal generation. More...
 
dsp32_t dsp32_gen_sin (dsp32_t *vect1, int size, int f, int fs, dsp32_t phase)
 32-bit fixed point version of the sinusoidal signal generation. More...
 
static void dsp32_gen_sqr (dsp32_t *vect1, int size, int f, int fs, dsp32_t delay)
 32-bit fixed point version of the square signal generation. More...
 
void dsp32_gen_step (dsp32_t *vect1, int size, dsp32_t intial_value, dsp32_t final_value, int step_index)
 32-bit fixed point version of the dirac comb signal generation. More...
 

dsp16_t dsp16_gen_cos ( dsp16_t vect1,
int  size,
int  f,
int  fs,
dsp16_t  phase 
)

16-bit fixed point version of the cosinusoidal signal generation.

Parameters
vect1A pointer on a 16-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
phaseThe phase of the output signal.
Returns
The phase of the signal generated.

References dsp16_op_cos(), and DSP16_QB.

void dsp16_gen_dcomb ( dsp16_t vect1,
int  size,
int  f,
int  fs,
dsp16_t  delay 
)

16-bit fixed point version of the dirac comb signal generation.

Parameters
vect1A pointer on a 16-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
delayThe delay of the periodic waveform. The delay must feet in the range [0; 1] where 1 to T.

References DSP16_Q, DSP16_QB, and MIN.

void dsp16_gen_dirac ( dsp16_t vect1,
int  size,
int  dirac_index 
)

16-bit fixed point version of the dirac comb signal generation.

Parameters
vect1A pointer on a 16-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
dirac_indexThe index in the buffer, where the dirac appears.

References DSP16_Q, and dsp16_vect_zeropad().

void dsp16_gen_noise ( dsp16_t vect1,
int  size,
dsp16_t  amp 
)

16-bit fixed point version of the noise generation.

Parameters
vect1A pointer on a 16-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
ampThe amplitude of the signal.

References dsp16_op_rand(), DSP16_Q, and DSP16_QB.

void dsp16_gen_ramp ( dsp16_t vect1,
int  size,
dsp16_t  increment 
)

16-bit fixed point version of the ramp signal generation.

Parameters
vect1A pointer on a 16-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
incrementThe incrementation of the signal per vector's element.

References DSP16_Q.

void dsp16_gen_rect ( dsp16_t vect1,
int  size,
int  f,
int  fs,
dsp16_t  duty,
dsp16_t  delay 
)

16-bit fixed point version of the rectangular signal generation.

Parameters
vect1A pointer on a 16-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
dutyThe duty cycle of the output signal. The duty cycle is a number in the range ]0; 1] which is the ratio between the pulse duration and the period of the waveform.
delayThe delay of the periodic waveform. The delay must feet in the range [0; 1] where 1 to T.

References DSP16_Q, DSP16_QB, and MIN.

Referenced by dsp16_gen_sqr().

dsp16_t dsp16_gen_saw ( dsp16_t vect1,
int  size,
int  f,
int  fs,
dsp16_t  duty,
dsp16_t  delay 
)

16-bit fixed point version of the saw tooth signal generation.

Parameters
vect1A pointer on a 16-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
dutyThe duty cycle of the output signal. The duty cycle is a number in the range ]0; 1] which is the ratio between the pulse duration and the period of the waveform.
delayThe delay of the periodic waveform. The delay must feet in the range [0; 1] where 1 to T.
Returns
The phase of the signal generated.

References DSP16_Q, DSP16_QB, Max, and Min.

dsp16_t dsp16_gen_sin ( dsp16_t vect1,
int  size,
int  f,
int  fs,
dsp16_t  phase 
)

16-bit fixed point version of the sinusoidal signal generation.

Parameters
vect1A pointer on a 16-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
phaseThe phase of the output signal.
Returns
The phase of the signal generated.

References dsp16_op_sin(), and DSP16_QB.

Referenced by main().

static void dsp16_gen_sqr ( dsp16_t vect1,
int  size,
int  f,
int  fs,
dsp16_t  delay 
)
inlinestatic

16-bit fixed point version of the square signal generation.

Parameters
vect1A pointer on a 16-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
delayThe delay of the periodic waveform. The delay must feet in the range [0; 1] where 1 to T.

References dsp16_gen_rect(), and DSP16_Q.

void dsp16_gen_step ( dsp16_t vect1,
int  size,
dsp16_t  intial_value,
dsp16_t  final_value,
int  step_index 
)

16-bit fixed point version of the dirac comb signal generation.

Parameters
vect1A pointer on a 16-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
intial_valueThe initial value of the signal.
final_valueThe final value of the signal.
step_indexThe index in the buffer, where the step appears.
dsp32_t dsp32_gen_cos ( dsp32_t vect1,
int  size,
int  f,
int  fs,
dsp32_t  phase 
)

32-bit fixed point version of the cosinusoidal signal generation.

Parameters
vect1A pointer on a 32-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
phaseThe phase of the output signal.
Returns
The phase of the signal generated.

References dsp32_op_cos(), and DSP32_QB.

void dsp32_gen_dcomb ( dsp32_t vect1,
int  size,
int  f,
int  fs,
dsp32_t  delay 
)

32-bit fixed point version of the dirac comb signal generation.

Parameters
vect1A pointer on a 32-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
delayThe delay of the periodic waveform. The delay must feet in the range [0; 1] where 1 to T.

References DSP32_Q, DSP32_QB, and MIN.

void dsp32_gen_dirac ( dsp32_t vect1,
int  size,
int  dirac_index 
)

32-bit fixed point version of the dirac comb signal generation.

Parameters
vect1A pointer on a 32-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
dirac_indexThe index in the buffer, where the dirac appears.

References DSP32_Q, and dsp32_vect_zeropad().

void dsp32_gen_noise ( dsp32_t vect1,
int  size,
dsp32_t  amp 
)

32-bit fixed point version of the noise generation.

Parameters
vect1A pointer on a 32-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
ampThe amplitude of the signal.

References dsp32_op_rand(), DSP32_Q, and DSP32_QB.

void dsp32_gen_ramp ( dsp32_t vect1,
int  size,
dsp32_t  increment 
)

32-bit fixed point version of the ramp signal generation.

Parameters
vect1A pointer on a 32-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
incrementThe incrementation of the signal per vector's element.

References DSP32_Q.

void dsp32_gen_rect ( dsp32_t vect1,
int  size,
int  f,
int  fs,
dsp32_t  duty,
dsp32_t  delay 
)

32-bit fixed point version of the rectangular signal generation.

Parameters
vect1A pointer on a 32-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
dutyThe duty cycle of the output signal. The duty cycle is a number in the range ]0; 1] which is the ratio between the pulse duration and the period of the waveform.
delayThe delay of the periodic waveform. The delay must feet in the range [0; 1] where 1 to T.

References DSP32_Q, DSP32_QB, and MIN.

Referenced by dsp32_gen_sqr().

dsp32_t dsp32_gen_saw ( dsp32_t vect1,
int  size,
int  f,
int  fs,
dsp32_t  duty,
dsp32_t  delay 
)

32-bit fixed point version of the saw tooth signal generation.

Parameters
vect1A pointer on a 32-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
dutyThe duty cycle of the output signal. The duty cycle is a number in the range ]0; 1] which is the ratio between the pulse duration and the period of the waveform.
delayThe delay of the periodic waveform. The delay must feet in the range [0; 1] where 1 to T.
Returns
The phase of the signal generated.

References DSP32_Q, DSP32_QB, Max, and Min.

dsp32_t dsp32_gen_sin ( dsp32_t vect1,
int  size,
int  f,
int  fs,
dsp32_t  phase 
)

32-bit fixed point version of the sinusoidal signal generation.

Parameters
vect1A pointer on a 32-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
phaseThe phase of the output signal.
Returns
The phase of the signal generated.

References dsp32_op_sin(), and DSP32_QB.

static void dsp32_gen_sqr ( dsp32_t vect1,
int  size,
int  f,
int  fs,
dsp32_t  delay 
)
inlinestatic

32-bit fixed point version of the square signal generation.

Parameters
vect1A pointer on a 32-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
fThe frequency of the output signal.
fsThe sampling frequency of the output signal.
delayThe delay of the periodic waveform. The delay must feet in the range [0; 1] where 1 to T.

References dsp32_gen_rect(), and DSP32_Q.

void dsp32_gen_step ( dsp32_t vect1,
int  size,
dsp32_t  intial_value,
dsp32_t  final_value,
int  step_index 
)

32-bit fixed point version of the dirac comb signal generation.

Parameters
vect1A pointer on a 32-bit vector which is the output buffer of this function.
sizeThe number of elements of the output vector.
intial_valueThe initial value of the signal.
final_valueThe final value of the signal.
step_indexThe index in the buffer, where the step appears.