home *** CD-ROM | disk | FTP | other *** search
- smoth(u,n,w,m,l,smooth)
-
- /* the purpose of this function is to smooth the time series a */
- /* by weight w. */
-
- int l,m,n;
- float u[],w[],smooth[];
-
- {
- int i,j,k,kp,lf,lh,ll;
-
- for(i = 0; i <= n-1; i++)
- smooth[i] = 0.;
- lf = l * (m-1) / 2;
- ll = lf + 1;
- lh = n - lf;
-
- for(i = ll; i <= lh; i++)
- {
- k = i - ll + 1;
- for(j = 1; j <= m; j++)
- {
- kp = (j * l) - l + k;
- smooth[i-1] = u[kp-1] * w[j-1] + smooth[i-1];
- }
- }
- }