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