Logo
MSP DSP Library
DSPLib_transform.h
1 #ifndef __DSPLIB_TRANSFORM_H__
2 #define __DSPLIB_TRANSFORM_H__
3 
4 //******************************************************************************
5 //
41 //
42 //******************************************************************************
43 
44 //******************************************************************************
45 //
46 // If building with a C++ compiler, make all of the definitions in this header
47 // have a C binding.
48 //
49 //******************************************************************************
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif
54 
55 //******************************************************************************
56 //
61 //
62 //******************************************************************************
63 #define MSP_ALIGN_FFT_Q15(n) (n*2)
64 
65 //******************************************************************************
66 //
71 //
72 //******************************************************************************
73 #define MSP_ALIGN_FFT_IQ31(n) (n*4)
74 
75 //******************************************************************************
76 //
81 //
82 //******************************************************************************
83 #define MSP_ALIGN_CMPLX_FFT_Q15(n) (n*4)
84 
85 //******************************************************************************
86 //
91 //
92 //******************************************************************************
93 #define MSP_ALIGN_CMPLX_FFT_IQ31(n) (n*8)
94 
95 //******************************************************************************
96 //
100 //
101 //******************************************************************************
105  uint16_t length;
107 
108 //******************************************************************************
109 //
113 //
114 //******************************************************************************
118  uint16_t length;
120 
121 //******************************************************************************
122 //
126 //
127 //******************************************************************************
128 typedef struct msp_split_q15_params {
131  uint16_t length;
137 
138 //******************************************************************************
139 //
143 //
144 //******************************************************************************
145 typedef struct msp_split_iq31_params {
148  uint16_t length;
154 
155 //******************************************************************************
156 //
160 //
161 //******************************************************************************
162 typedef struct msp_fft_q15_params {
165  uint16_t length;
177 
178 //******************************************************************************
179 //
183 //
184 //******************************************************************************
185 typedef struct msp_fft_iq31_params {
188  uint16_t length;
200 
201 //******************************************************************************
202 //
206 //
207 //******************************************************************************
208 typedef struct msp_cmplx_fft_q15_params {
211  uint16_t length;
223 
224 //******************************************************************************
225 //
229 //
230 //******************************************************************************
234  uint16_t length;
246 
247 //******************************************************************************
248 //
268 //
269 //******************************************************************************
271  const msp_cmplx_bitrev_q15_params *params,
272  int16_t *src);
273 
274 //******************************************************************************
275 //
295 //
296 //******************************************************************************
298  const msp_cmplx_bitrev_iq31_params *params,
299  int32_t *src);
300 
301 //******************************************************************************
302 //
325 //
326 //******************************************************************************
327 extern msp_status msp_split_q15(const msp_split_q15_params *params,
328  int16_t *src);
329 
330 //******************************************************************************
331 //
354 //
355 //******************************************************************************
356 extern msp_status msp_split_iq31(const msp_split_iq31_params *params,
357  int32_t *src);
358 
359 //******************************************************************************
360 //
398 //
399 //******************************************************************************
400 extern msp_status msp_fft_auto_q15(const msp_fft_q15_params *params,
401  int16_t *src,
402  uint16_t *shift);
403 
404 //******************************************************************************
405 //
475 //
476 //******************************************************************************
477 extern msp_status msp_fft_fixed_q15(const msp_fft_q15_params *params,
478  int16_t *src);
479 
480 //******************************************************************************
481 //
508 //
509 //******************************************************************************
510 
511 extern msp_status msp_fft_iq31(const msp_fft_iq31_params *params,
512  int32_t *src);
513 
514 //******************************************************************************
515 //
544 //
545 //******************************************************************************
546 extern msp_status msp_ifft_auto_q15(const msp_fft_q15_params *params,
547  int16_t *src,
548  uint16_t shift);
549 
550 //******************************************************************************
551 //
600 //
601 //******************************************************************************
603  int16_t *src);
604 
605 //******************************************************************************
606 //
634 //
635 //******************************************************************************
636 extern msp_status msp_ifft_iq31(const msp_fft_iq31_params *params,
637  int32_t *src);
638 
639 //******************************************************************************
640 //
672 //
673 //******************************************************************************
675  int16_t *src,
676  uint16_t *shift);
677 
678 //******************************************************************************
679 //
742 //
743 //******************************************************************************
745  const msp_cmplx_fft_q15_params *params,
746  int16_t *src);
747 
748 //******************************************************************************
749 //
770 //
771 //******************************************************************************
773 int32_t *src);
774 
775 //******************************************************************************
776 //
801 //
802 //******************************************************************************
804  const msp_cmplx_fft_q15_params *params,
805  int16_t *src,
806  uint16_t shift);
807 
808 //******************************************************************************
809 //
851 //
852 //******************************************************************************
854  const msp_cmplx_fft_q15_params *params,
855  int16_t *src);
856 
857 //******************************************************************************
858 //
880 //
881 //******************************************************************************
883  int32_t *src);
884 
885 //******************************************************************************
886 //
890 //
891 //******************************************************************************
892 extern const uint8_t msp_cmplx_bitrev_table_ui8[256];
893 
894 #if defined(MSP_USE_LEASC)
895 
896 // Define as null pointers when using LEASC
897 #define msp_cmplx_twiddle_table_16_q15 0
898 #define msp_cmplx_twiddle_table_32_q15 0
899 #define msp_cmplx_twiddle_table_64_q15 0
900 #define msp_cmplx_twiddle_table_128_q15 0
901 #define msp_cmplx_twiddle_table_256_q15 0
902 #define msp_cmplx_twiddle_table_512_q15 0
903 #define msp_cmplx_twiddle_table_1024_q15 0
904 #define msp_cmplx_twiddle_table_2048_q15 0
905 #define msp_cmplx_twiddle_table_4096_q15 0
906 
907 #else //MSP_USE_LEASC
908 
909 //******************************************************************************
910 //
914 //
915 //******************************************************************************
917 
918 //******************************************************************************
919 //
923 //
924 //******************************************************************************
926 
927 //******************************************************************************
928 //
932 //
933 //******************************************************************************
935 
936 //******************************************************************************
937 //
941 //
942 //******************************************************************************
944 
945 //******************************************************************************
946 //
950 //
951 //******************************************************************************
953 
954 //******************************************************************************
955 //
959 //
960 //******************************************************************************
962 
963 //******************************************************************************
964 //
968 //
969 //******************************************************************************
971 
972 //******************************************************************************
973 //
977 //
978 //******************************************************************************
980 
981 //******************************************************************************
982 //
986 //
987 //******************************************************************************
989 
990 #endif //MSP_USE_LEASC
991 
992 //*****************************************************************************
993 //
994 // Mark the end of the C bindings section for C++ compilers.
995 //
996 //*****************************************************************************
997 #ifdef __cplusplus
998 }
999 #endif
1000 
1001 #endif //__DSPLIB_TRANSFORM_H__
Parameter structure for Q15 split operation.
Definition: DSPLib_transform.h:128
msp_status msp_cmplx_fft_iq31(const msp_cmplx_fft_iq31_params *params, int32_t *src)
Complex forward FFT function without scaling.
uint16_t length
Definition: DSPLib_transform.h:165
bool bitReverse
Definition: DSPLib_transform.h:240
const _q15 msp_cmplx_twiddle_table_64_q15[DSPLIB_TABLE_OFFSET+64]
Twiddle factor table for FFT of size 64.
bool bitReverse
Definition: DSPLib_transform.h:194
uint16_t length
Definition: DSPLib_transform.h:188
msp_status msp_fft_fixed_q15(const msp_fft_q15_params *params, int16_t *src)
Real forward FFT function with fixed scaling by two at each stage.
msp_status
Enumerated type to return the status of an operation.
Definition: DSPLib_types.h:78
uint16_t length
Definition: DSPLib_transform.h:211
bool bitReverse
Definition: DSPLib_transform.h:171
const _q15 * twiddleTable
Definition: DSPLib_transform.h:221
const _q15 msp_cmplx_twiddle_table_4096_q15[DSPLIB_TABLE_OFFSET+4096]
Twiddle factor table for FFT of size 4096.
const _q15 msp_cmplx_twiddle_table_512_q15[DSPLIB_TABLE_OFFSET+512]
Twiddle factor table for FFT of size 512.
const _q15 * twiddleTable
Definition: DSPLib_transform.h:244
const _q15 * twiddleTable
Definition: DSPLib_transform.h:175
Parameter structure for IQ31 split operation.
Definition: DSPLib_transform.h:145
const _q15 msp_cmplx_twiddle_table_32_q15[DSPLIB_TABLE_OFFSET+32]
Twiddle factor table for FFT of size 32.
Parameter structure for IQ31 real FFT functions.
Definition: DSPLib_transform.h:185
const _q15 * twiddleTable
Definition: DSPLib_transform.h:198
bool bitReverse
Definition: DSPLib_transform.h:217
msp_status msp_ifft_fixed_q15(const msp_fft_q15_params *params, int16_t *src)
Real result inverse FFT function with fixed scaling by two at each stage.
msp_status msp_cmplx_bitrev_iq31(const msp_cmplx_bitrev_iq31_params *params, int32_t *src)
Complex bit-reversal function.
msp_status msp_split_q15(const msp_split_q15_params *params, int16_t *src)
Split operation for performing the final step of a real FFT.
const _q15 msp_cmplx_twiddle_table_256_q15[DSPLIB_TABLE_OFFSET+256]
Twiddle factor table for FFT of size 256.
const _q15 msp_cmplx_twiddle_table_128_q15[DSPLIB_TABLE_OFFSET+128]
Twiddle factor table for FFT of size 128.
int16_t _q15
Signed fixed point data type with 1 integer bit and 15 fractional bits.
Definition: DSPLib_types.h:38
msp_status msp_ifft_iq31(const msp_fft_iq31_params *params, int32_t *src)
Real result inverse FFT function without scaling.
msp_status msp_cmplx_fft_auto_q15(const msp_cmplx_fft_q15_params *params, int16_t *src, uint16_t *shift)
Complex forward FFT function with auto-scaling.
msp_status msp_ifft_auto_q15(const msp_fft_q15_params *params, int16_t *src, uint16_t shift)
Real result inverse FFT function with auto-scaling.
msp_status msp_cmplx_ifft_iq31(const msp_cmplx_fft_iq31_params *params, int32_t *src)
Complex inverse FFT function without scaling.
const _q15 msp_cmplx_twiddle_table_1024_q15[DSPLIB_TABLE_OFFSET+1024]
Twiddle factor table for FFT of size 1024.
Parameter structure for IQ31 complex bit-reversal.
Definition: DSPLib_transform.h:115
msp_status msp_cmplx_ifft_fixed_q15(const msp_cmplx_fft_q15_params *params, int16_t *src)
Complex inverse FFT function with fixed scaling by two at each stage.
const _q15 msp_cmplx_twiddle_table_16_q15[DSPLIB_TABLE_OFFSET+16]
Twiddle factor table for FFT of size 16.
msp_status msp_fft_auto_q15(const msp_fft_q15_params *params, int16_t *src, uint16_t *shift)
Real forward FFT function with auto-scaling.
const _q15 * twiddleTable
Definition: DSPLib_transform.h:135
msp_status msp_cmplx_bitrev_q15(const msp_cmplx_bitrev_q15_params *params, int16_t *src)
Complex bit-reversal function.
msp_status msp_cmplx_ifft_auto_q15(const msp_cmplx_fft_q15_params *params, int16_t *src, uint16_t shift)
Complex inverse FFT function with auto-scaling.
uint16_t length
Definition: DSPLib_transform.h:234
uint16_t length
Definition: DSPLib_transform.h:118
msp_status msp_split_iq31(const msp_split_iq31_params *params, int32_t *src)
Split operation for performing the final step of a real FFT.
Parameter structure for Q15 complex bit-reversal.
Definition: DSPLib_transform.h:102
Parameter structure for Q15 complex FFT functions.
Definition: DSPLib_transform.h:208
msp_status msp_cmplx_fft_fixed_q15(const msp_cmplx_fft_q15_params *params, int16_t *src)
Complex forward FFT function with fixed scaling by two at each stage.
#define DSPLIB_TABLE_OFFSET
Offset used to store table size.
Definition: DSPLib_support.h:44
const uint8_t msp_cmplx_bitrev_table_ui8[256]
Bit reversal lookup table.
msp_status msp_fft_iq31(const msp_fft_iq31_params *params, int32_t *src)
Real forward FFT function without scaling.
const _q15 * twiddleTable
Definition: DSPLib_transform.h:152
uint16_t length
Definition: DSPLib_transform.h:131
uint16_t length
Definition: DSPLib_transform.h:105
Parameter structure for IQ31 complex FFT functions.
Definition: DSPLib_transform.h:231
uint16_t length
Definition: DSPLib_transform.h:148
const _q15 msp_cmplx_twiddle_table_2048_q15[DSPLIB_TABLE_OFFSET+2048]
Twiddle factor table for FFT of size 2048.
Parameter structure for Q15 real FFT functions.
Definition: DSPLib_transform.h:162