/* * cfcore.c * Channel filter - filter method (core C-code). * Shared by MATLAB C-MEX function, SIMULINK C-MEX S-Function, and TLC. * * Copyright 1996-2005 The MathWorks, Inc. * $Revision: 1.1.6.1 $ $Date: 2004/12/10 19:23:09 $ */ #include #include "cfcore.h" void corechannelfilter( const cArray x, /* Input signal */ const cArray z, /* Complex path gains */ cArray y, /* Output signal */ cArray zStore, /* Complex path gains - store */ boolean_T storePathGains, /* Flag denoting to store path gains in zStore */ int_T NS, /* Number of input/output samples */ int_T NP, /* Number of paths */ int_T NG, /* Number of channel filter gains */ real_T *alphaMatrix, /* Matrix for transforming gains */ int_T *alphaIndices, /* Matrix indices for transform */ cArray u, /* Input state vector */ cArray w) /* Work vector */ { int_T m, n, k; /* Loop indices */ if (storePathGains) { for (n=0; n= alphaIndices[k]-1) mi = m+1; else mi = alphaIndices[k]-1; Re(w, k) = Im(w, k) = 0.0; for (n=alphaIndices[k]-1; n<=m && n=NS; n--) { int_T iu = n-NS; Re(u, n) = Re(u, iu); Im(u, n) = Im(u, iu); } for (n=0; n