function w = taper % Cosine bell tapering % Based on discussion in Time Sequence Analysis in Geophysics % by E.R. Kanasewich. % To be used with cross-correlation routine. Works correctly % for fraction < 0.1 . % % by D. Holmgren, June 20 94. holmgren@phobos.astro.uwo.ca % input total length of taper, and fraction of which % is to be a cosine bell... n = input('Length of taper = '); f = input('Fraction to taper = '); m = f*n; l = n - m; w = ones(n,1); % compute taper... for i = 1:m w(i) = 0.5 * (1 + cos(pi*(i+l)/m)); w(n-i+1) = 0.5 * (1 + cos(pi*(i-l)/m)); end