permuta.c

来自「java-fft-demo,用java开发的实现fft的平台」· C语言 代码 · 共 39 行

C
39
字号
/********************************************************/   
/*Permuta						              */   
/*Maritza Rodr韌uez Mart韓ez				        */   
/*Computational Signal Processing Group - march-98   	  */   
/*CSPG - Dr. Domingo Rodr韌uez - Coordinator         	  */   
/*Description:          	                  	  */   
/*The effect of function perm(n,m) is equivalent to 	  */   
/*multiply an m-stride permutation.This means that the  */   
/*elements of x will be permuted. In this function, the */   
/*permutation,that is, the m-stride permutation  matrix */   
/*is not generated.					        */      
/********************************************************/       
     
COMPLEX **Permuta(int N,int s)    
{    

	COMPLEX **per;   
    
	int k, inicio=0;   
	int pos=inicio;   
	per = getComplexMatrix(N);    
   
   	
for( k=0; k < N; ++k){    
   per[k][pos].real=1;   
   pos=pos+s;    
   if(pos >= N){    
    
      pos=inicio+1;      
      inicio=inicio+1;       
   }     
   
}   
return per;   
}   
   


   

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?