📄 ikront.c
字号:
/********************************************************/
/*IkronT */
/*Maritza Rodr韌uez Mart韓ez */
/*Computational Signal Processing Group - march-98 */
/*CSPG - Dr. Domingo Rodr韌uez - Coordinator */
/* */
/*Description: */
/*This function ikront performs the product between the */
/*tensor product of the matrices IM and TN,S, where IM */
/*is the identity matrix of order M, and TN,S is the */
/*stride matrix of order S. The parameter of this */
/*function are M, Nand S. */
/********************************************************/
COMPLEX **IkronT(int M,int N,int S)
{
COMPLEX **tride,**IkronT_VAR;
int R=N/S,MN = M*N, temp,auxR=0,auxS=0,l=0,m,k,i,j;
tride = getComplexMatrix(N);
IkronT_VAR = getComplexMatrix(MN);
for(i = 0; i < N; i++)
for(j = 0; j < N; j++){
if(j == i){
tride[i][j].real = cos((2*PI*auxR*auxS)/N);
tride[i][j].imag = -sin((2*PI*auxR*auxS)/N);
++auxR;
if(auxR==R){ auxR=0; auxS=1;}
}
else{
tride[i][j].real=0.0;
tride[i][j].imag=0.0;
}
}
l=0;
for(m = 0; m < (M*N); ++m) /* este es el valor de filas *columnas*/
{
k=0;
if (m % N ==0 & m!=0 ) /* el valor para comparar m debe ser el num de columnas de B*/
l++;
temp = M;
for (i = 0; i < temp; ++i)/* numero de filas o columnas mayor entre A y B*/
{
for ( j = 0; j < N; ++j)/* numero de filas o columnas de B*/
{
if((l % M)== i){
IkronT_VAR[m][k].real = tride[m % N][j].real; /* m%filas o columnas de B*/
IkronT_VAR[m][k].imag = tride[m % N][j].imag;
k++;
}
else{
IkronT_VAR[m][k].real =0.0;
IkronT_VAR[m][k].imag =0.0;
k++;
}
}
}
}free(tride);
return IkronT_VAR;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -