Logo
MSP DSP Library
DSPLib_utility.h
1 #ifndef __DSPLIB_UTILITY_H__
2 #define __DSPLIB_UTILITY_H__
3 
4 //******************************************************************************
5 //
13 //
14 //******************************************************************************
15 
16 //******************************************************************************
17 //
18 // If building with a C++ compiler, make all of the definitions in this header
19 // have a C binding.
20 //
21 //******************************************************************************
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
27 //******************************************************************************
28 //
32 //
33 //******************************************************************************
34 typedef struct msp_q15_to_iq31_params {
36  uint16_t length;
38 
39 //******************************************************************************
40 //
44 //
45 //******************************************************************************
46 typedef struct msp_iq31_to_q15_params {
48  uint16_t length;
50 
51 //******************************************************************************
52 //
57 //
58 //******************************************************************************
59 typedef struct msp_cmplx_q15_params {
61  uint16_t length;
63 
64 //******************************************************************************
65 //
70 //
71 //******************************************************************************
72 typedef struct msp_cmplx_iq31_params {
74  uint16_t length;
76 
77 //******************************************************************************
78 //
82 //
83 //******************************************************************************
84 typedef struct msp_copy_q15_params {
86  uint16_t length;
88 
89 //******************************************************************************
90 //
94 //
95 //******************************************************************************
96 typedef struct msp_copy_iq31_params {
98  uint16_t length;
100 
101 //******************************************************************************
102 //
106 //
107 //******************************************************************************
108 typedef struct msp_fill_q15_params {
110  uint16_t length;
114 
115 //******************************************************************************
116 //
120 //
121 //******************************************************************************
122 typedef struct msp_fill_iq31_params {
124  uint16_t length;
128 
129 //******************************************************************************
130 //
134 //
135 //******************************************************************************
138  uint16_t length;
144 
145 //******************************************************************************
146 //
150 //
151 //******************************************************************************
154  uint16_t length;
160 
161 //******************************************************************************
162 //
166 //
167 //******************************************************************************
170  uint16_t length;
172  uint16_t channel;
174  uint16_t numChannels;
176 
177 //******************************************************************************
178 //
182 //
183 //******************************************************************************
186  uint16_t length;
188  uint16_t channel;
190  uint16_t numChannels;
192 
193 //******************************************************************************
194 //
198 //
199 //******************************************************************************
202  uint16_t length;
204  uint16_t channel;
206  uint16_t numChannels;
208 
209 //******************************************************************************
210 //
214 //
215 //******************************************************************************
218  uint16_t length;
220  uint16_t channel;
222  uint16_t numChannels;
224 
225 //******************************************************************************
226 //
230 //
231 //******************************************************************************
232 typedef struct msp_sinusoid_q15_params {
234  uint16_t length;
250 
251 //******************************************************************************
252 //
269 //
270 //******************************************************************************
272  const _q15 *src,
273  _iq31 *dst);
274 
275 //******************************************************************************
276 //
293 //
294 //******************************************************************************
296  const _iq31 *src,
297  _q15 *dst);
298 
299 //******************************************************************************
300 //
318 //
319 //******************************************************************************
320 extern msp_status msp_cmplx_q15(const msp_cmplx_q15_params *params,
321  const _q15 *real,
322  const _q15 *imag,
323  _q15 *dst);
324 
325 //******************************************************************************
326 //
345 //
346 //******************************************************************************
347 extern msp_status msp_cmplx_iq31(const msp_cmplx_iq31_params *params,
348  const _iq31 *real,
349  const _iq31 *imag,
350  _iq31 *dst);
351 
352 //******************************************************************************
353 //
370 //
371 //******************************************************************************
372 extern msp_status msp_copy_q15(const msp_copy_q15_params *params,
373  const _q15 *src,
374  _q15 *dst);
375 
376 //******************************************************************************
377 //
394 //
395 //******************************************************************************
396 extern msp_status msp_copy_iq31(const msp_copy_iq31_params *params,
397  const _iq31 *src,
398  _iq31 *dst);
399 
400 //******************************************************************************
401 //
417 //
418 //******************************************************************************
419 extern msp_status msp_fill_q15(const msp_fill_q15_params *params, _q15 *dst);
420 
421 //******************************************************************************
422 //
438 //
439 //******************************************************************************
440 extern msp_status msp_fill_iq31(const msp_fill_iq31_params *params, _iq31 *dst);
441 
442 //******************************************************************************
443 //
460 //
461 //******************************************************************************
463  _q15 *dst);
464 
465 //******************************************************************************
466 //
483 //
484 //******************************************************************************
486  _iq31 *dst);
487 
488 //******************************************************************************
489 //
511 //
512 //******************************************************************************
514  const _q15 *src,
515  _q15 *dst);
516 
517 //******************************************************************************
518 //
540 //
541 //******************************************************************************
543  const _iq31 *src,
544  _iq31 *dst);
545 
546 //******************************************************************************
547 //
568 //
569 //******************************************************************************
571  const msp_deinterleave_q15_params *params,
572  const _q15 *src,
573  _q15 *dst);
574 
575 //******************************************************************************
576 //
597 //
598 //******************************************************************************
600  const msp_deinterleave_iq31_params *params,
601  const _iq31 *src,
602  _iq31 *dst);
603 
604 //******************************************************************************
605 //
622 //
623 //******************************************************************************
625  _q15 *dst);
626 
627 //*****************************************************************************
628 //
629 // Mark the end of the C bindings section for C++ compilers.
630 //
631 //*****************************************************************************
632 #ifdef __cplusplus
633 }
634 #endif
635 
636 #endif //__DSPLIB_UTILITY_H__
uint16_t numChannels
Number of channels being separated.
Definition: DSPLib_utility.h:222
Parameters for IQ31 real vector fill.
Definition: DSPLib_utility.h:122
uint16_t length
Length of each channel.
Definition: DSPLib_utility.h:218
Parameters for IQ31 vector interleave.
Definition: DSPLib_utility.h:184
Parameters for Q15 real vector fill.
Definition: DSPLib_utility.h:108
uint16_t numChannels
Number of channels being separated.
Definition: DSPLib_utility.h:206
int32_t _iq31
Signed fixed point data type with 1 integer bit and 31 fractional bits.
Definition: DSPLib_types.h:100
uint16_t length
Length of the source data.
Definition: DSPLib_utility.h:74
uint16_t length
Length of the source data, must be a multiple of two.
Definition: DSPLib_utility.h:110
Parameters for Q15 vector deinterleave.
Definition: DSPLib_utility.h:200
msp_status msp_copy_iq31(const msp_copy_iq31_params *params, const _iq31 *src, _iq31 *dst)
Real IQ31 vector copy.
uint16_t channel
Specific zero-indexed channel to insert source into.
Definition: DSPLib_utility.h:188
msp_status
Enumerated type to return the status of an operation.
Definition: DSPLib_types.h:119
msp_status msp_deinterleave_q15(const msp_deinterleave_q15_params *params, const _q15 *src, _q15 *dst)
Extract a single channel from multiple-channel source.
_q15 imagValue
Imaginary constant value to fill imaginary indices with.
Definition: DSPLib_utility.h:142
_iq31 realValue
Real constant value to fill real indices with.
Definition: DSPLib_utility.h:156
msp_status msp_copy_q15(const msp_copy_q15_params *params, const _q15 *src, _q15 *dst)
Real Q15 vector copy.
uint16_t length
Length of the source data.
Definition: DSPLib_utility.h:98
uint16_t numChannels
Number of channels in destination vector.
Definition: DSPLib_utility.h:174
uint16_t length
Length of the source data.
Definition: DSPLib_utility.h:124
msp_status msp_interleave_iq31(const msp_interleave_iq31_params *params, const _iq31 *src, _iq31 *dst)
Insert a single channel into a multiple-channel destination.
msp_status msp_fill_iq31(const msp_fill_iq31_params *params, _iq31 *dst)
Real IQ31 vector fill with constant.
_q15 value
Scalar constant to fill the destination vector with.
Definition: DSPLib_utility.h:112
_q15 amplitude
Amplitude of the generated sinusoid.
Definition: DSPLib_utility.h:236
msp_status msp_cmplx_fill_iq31(const msp_cmplx_fill_iq31_params *params, _iq31 *dst)
Complex IQ31 vector fill with constant.
uint16_t length
Length of the source data, must be a multiple of two.
Definition: DSPLib_utility.h:48
msp_status msp_cmplx_q15(const msp_cmplx_q15_params *params, const _q15 *real, const _q15 *imag, _q15 *dst)
Create Q15 complex vector from real and imaginary vectors.
uint16_t channel
Specific zero-indexed channel to insert source into.
Definition: DSPLib_utility.h:172
_iq31 imagValue
Imaginary constant value to fill imaginary indices with.
Definition: DSPLib_utility.h:158
uint16_t channel
Specific zero-indexed channel to pull from source.
Definition: DSPLib_utility.h:204
int16_t _q15
Signed fixed point data type with 1 integer bit and 15 fractional bits.
Definition: DSPLib_types.h:79
uint16_t length
Length of the generated sinusoid, must be a multiple of two.
Definition: DSPLib_utility.h:234
Parameters for Q15 sinusoid generation.
Definition: DSPLib_utility.h:232
Parameters for creating IQ31 complex vector from real and imaginary vectors.
Definition: DSPLib_utility.h:72
Parameters for IQ31 vector copy function.
Definition: DSPLib_utility.h:96
uint16_t length
Length of the source data, must be a multiple of two.
Definition: DSPLib_utility.h:138
Parameters for Q15 complex vector fill.
Definition: DSPLib_utility.h:136
_q15 sinOmega
Definition: DSPLib_utility.h:248
Parameters for IQ31 to Q15 conversion.
Definition: DSPLib_utility.h:46
_iq31 value
Scalar constant to fill the destination vector with.
Definition: DSPLib_utility.h:126
msp_status msp_sinusoid_q15(const msp_sinusoid_q15_params *params, _q15 *dst)
Generate a sinusoid with specified amplitude and frequency.
uint16_t length
Length of each channel, must be a multiple of two.
Definition: DSPLib_utility.h:170
Parameters for IQ31 complex vector fill.
Definition: DSPLib_utility.h:152
uint16_t length
Length of the source data, must be a multiple of two.
Definition: DSPLib_utility.h:36
uint16_t length
Length of each channel.
Definition: DSPLib_utility.h:186
msp_status msp_cmplx_iq31(const msp_cmplx_iq31_params *params, const _iq31 *real, const _iq31 *imag, _iq31 *dst)
Create IQ31 complex vector from real and imaginary vectors.
uint16_t length
Length of each channel, must be a multiple of two.
Definition: DSPLib_utility.h:202
_q15 cosOmega
Definition: DSPLib_utility.h:242
msp_status msp_interleave_q15(const msp_interleave_q15_params *params, const _q15 *src, _q15 *dst)
Insert a single channel into a multiple-channel destination.
Parameters for creating Q15 complex vector from real and imaginary vectors.
Definition: DSPLib_utility.h:59
msp_status msp_cmplx_fill_q15(const msp_cmplx_fill_q15_params *params, _q15 *dst)
Complex Q15 vector fill with constant.
_q15 realValue
Real constant value to fill real indices with.
Definition: DSPLib_utility.h:140
msp_status msp_iq31_to_q15(const msp_iq31_to_q15_params *params, const _iq31 *src, _q15 *dst)
Convert IQ31 vector to Q15 format.
msp_status msp_q15_to_iq31(const msp_q15_to_iq31_params *params, const _q15 *src, _iq31 *dst)
Convert Q15 vector to IQ31 format.
Parameters for Q15 to IQ31 conversion.
Definition: DSPLib_utility.h:34
uint16_t length
Length of the source data.
Definition: DSPLib_utility.h:61
uint16_t length
Length of the source data.
Definition: DSPLib_utility.h:154
Parameters for Q15 vector copy function.
Definition: DSPLib_utility.h:84
Parameters for Q15 vector interleave.
Definition: DSPLib_utility.h:168
uint16_t length
Length of the source data, must be a multiple of two.
Definition: DSPLib_utility.h:86
msp_status msp_fill_q15(const msp_fill_q15_params *params, _q15 *dst)
Real Q15 vector fill with constant.
Parameters for IQ31 vector deinterleave.
Definition: DSPLib_utility.h:216
uint16_t numChannels
Number of channels in destination vector.
Definition: DSPLib_utility.h:190
uint16_t channel
Specific zero-indexed channel to pull from source.
Definition: DSPLib_utility.h:220
msp_status msp_deinterleave_iq31(const msp_deinterleave_iq31_params *params, const _iq31 *src, _iq31 *dst)
Extract a single channel from multiple-channel source.