Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bitreversal.c « TransformFunctions « src « RefLibs « DSP_Lib_TestSuite « DSP « CMSIS « Drivers - github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1f2be89fd738854eed04e1250eda943455c2c8d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "ref.h"


;/*    
;* @brief  In-place bit reversal function.   
;* @param[in, out] *pSrc        points to the in-place buffer of unknown 32-bit data type. 
;* @param[in]      bitRevLen    bit reversal table length
;* @param[in]      *pBitRevTab  points to bit reversal table.   
;* @return none.   
;*/
void arm_bitreversal_32(uint32_t *pSrc, uint32_t bitRevLen, uint32_t *pBitRevTab)
{
	uint32_t a,b,i,tmp;
	
	for(i=0; i<bitRevLen; i++) 
	{
		 a = pBitRevTab[2*i];
		 b = pBitRevTab[2*i + 1];

	//real
		 tmp = pSrc[a];
		 pSrc[a] = pSrc[b];
		 pSrc[b] = tmp;

	//complex
		 tmp = pSrc[a+1];
		 pSrc[a+1] = pSrc[b+1];
		 pSrc[b+1] = tmp;
	}
}