/* * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab * Copyright (C) 2008 - INRIA - Allan SIMON * * This file must be used under the terms of the CeCILL. * This source file is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ #include "ifft_internal.h" #include /* ** radix 8 iteration subroutine */ /* this function do in one turn the same computation that do radix 2 in three turns */ void ir8tx ( int nxtlt,int nthpo,int lengt, doubleComplex* cc0,doubleComplex* cc1,doubleComplex* cc2,doubleComplex* cc3, doubleComplex* cc4,doubleComplex* cc5,doubleComplex* cc6,doubleComplex* cc7) { int j , kk; double dblP7 = 1 / sqrt(2.0) ; double dblPi2 = 8 * atan(1.0); double scale, arg; double c1,c2,c3,c4,c5,c6,c7; double s1,s2,s3,s4,s5,s6,s7; doubleComplex Atemp0,Atemp1,Atemp2,Atemp3,Atemp4,Atemp5,Atemp6,Atemp7; doubleComplex Btemp0,Btemp1,Btemp2,Btemp3,Btemp4,Btemp5,Btemp6,Btemp7; doubleComplex temp ; scale = dblPi2/lengt; for(j=0;j0) { cc1[kk] = DoubleComplex ( (c4 * (zreals(Btemp0) - zreals(Btemp1))) - (s4 * (zimags(Btemp0) - zimags(Btemp1))), c4 * (zimags(Btemp0) - zimags(Btemp1)) + s4 * (zreals(Btemp0) - zreals(Btemp1))); cc2[kk] = DoubleComplex ( c2 * (zreals(Btemp2) - zimags(Btemp3)) - s2 * (zimags(Btemp2) + zreals(Btemp3)) , c2 * (zimags(Btemp2) + zreals(Btemp3)) + s2 * (zreals(Btemp2) - zimags(Btemp3))); cc3[kk] = DoubleComplex ( c6 * (zreals(Btemp2) + zimags(Btemp3)) - s6 * (zimags(Btemp2) - zreals(Btemp3)) , c6 * (zimags(Btemp2) - zreals(Btemp3)) + s6 * (zreals(Btemp2) + zimags(Btemp3))); temp = DoubleComplex ( dblP7*(zreals ( Btemp5 ) - zimags( Btemp5 )) , dblP7*(zreals ( Btemp5 ) + zimags( Btemp5 )) ); cc4[kk] = DoubleComplex ( c1 * (zreals (Btemp4) + zreals(temp)) - s1 * (zimags (Btemp4) + zimags(temp)) , c1 * (zimags (Btemp4) + zimags(temp)) + s1 * (zreals (Btemp4) + zreals(temp))); cc5[kk] = DoubleComplex ( c5 * (zreals (Btemp4) - zreals(temp)) - s5 * (zimags (Btemp4) - zimags(temp)) , c5 * (zimags (Btemp4) - zimags(temp)) + s5 * (zreals (Btemp4) - zreals(temp))); temp = DoubleComplex ( - dblP7*(zreals ( Btemp7 ) + zimags( Btemp7 )) , dblP7*(zreals ( Btemp7 ) - zimags( Btemp7 )) ); cc6[kk] = DoubleComplex ( c3 * (zreals (Btemp6) + zreals(temp)) - s3 * (zimags (Btemp6) + zimags(temp)) , c3 * (zimags (Btemp6) + zimags(temp)) + s3 * (zreals (Btemp6) + zreals(temp))); cc7[kk] = DoubleComplex ( c7 * (zreals (Btemp6) - zreals(temp)) - s7 * (zimags (Btemp6) - zimags(temp)) , c7 * (zimags (Btemp6) - zimags(temp)) + s7 * (zreals (Btemp6) - zreals(temp))); } else { cc1[kk] = zdiffs ( Btemp0 , Btemp1 ); cc2[kk] = DoubleComplex ( zreals ( Btemp2 ) - zimags( Btemp3 ) , zimags ( Btemp2 ) + zreals( Btemp3 ) ); cc3[kk] = DoubleComplex ( zreals ( Btemp2 ) + zimags( Btemp3 ) , zimags ( Btemp2 ) - zreals( Btemp3 ) ); temp = DoubleComplex ( dblP7*(zreals ( Btemp5 ) - zimags( Btemp5 )) , dblP7*(zreals ( Btemp5 ) + zimags( Btemp5 )) ); cc4[kk] = zadds ( Btemp4 , temp ); cc5[kk] = zdiffs ( Btemp4 , temp ); temp = DoubleComplex ( - dblP7*(zreals ( Btemp7 ) + zimags( Btemp7 )) , dblP7*(zreals ( Btemp7 ) - zimags( Btemp7 )) ); cc6[kk] = zadds ( Btemp6 , temp ); cc7[kk] = zdiffs ( Btemp6 , temp ); } } } }