2000 Evans M. Harrell II and James V. Herod.
Note: This application uses Maple to clearly communicate filtering and signal processing concepts to students in an educational setting.
Introduction:
An intuitive way to understand the projections of functions is to consider the application in signal processing for filtering. The word filtering refers to an attempt to extract the important part of some data, while eliminating random contributions referred to as noise, or to remove other unwanted features which obscure the signal.
To illustrate the procedure, we choose a simple selection of features that are regarded as good and bad , to create low-pass and high-pass filters. Suppose that we have a signal f(t) which contains some pure frequencies in which we are interested. That is, we suppose the signal consists of some interesting part corresponding to pure vibratory functions represented as multiples and sums of
sin(2 x), sin(4 x), ... , sin(20 x), 1, cos(2 x), cos(4 x), ... , cos(20 x),
and some noise. A concise way to write this is
(*) f(t) = + + + .
We take the twenty terms as defining .
Note that we might be able to omit the term if the signal oscillates around the average zero. More than anything else, such a condition might be a convention.
As we explained in Chapter 2, the projection formula tells us the best choice for these coefficients, in the sense that the root mean square error is minimum:
| f(t) - - - |
This is analogus to the projection of a vector into a plane being the planar vector whose distance from the original vector is as small as possible. From the perspective of freshman, multidimensional calculus, the above formula is a projection into a space with dimension 21.
The projection formula for the orthogonal set (*) above on the interval [0, 1] provides a formula for and . Notice that if we put these terms together, we see that the filtering is accomplished by an integral operator of the separable type:
=
where
k(x, t) = 2 + 2 .
Example F.1. Changing a noisy signal to a clear signal.
In this example, we pick out a clear signal from a noisy signal.
> Noisy:=x->piecewise(x<1/4,4*x, x>1/4 and x < 1/2,-4*x+2, x>1/2 and x < 3/4, 4*x-2, -4*x+4)+sin(30*Pi*x)/10-1/2;
> plot(Noisy(x),x=0..1);
> k:=(x,t)->2*sum(cos(2*Pi*m*x)*cos(2*Pi*m*t),m=1..10) + 2*sum(sin(2*Pi*m*x)*sin(2*Pi*m*t),m=1..10);
> int(k(x,t)*Noisy(t),t=0..1):
> signal:=unapply(%,x):
>
> plot(signal(x),x=0..1);
Example 2. Separating out the first three frequencies.
In this second example, we filter out frequencies greater than 3. First we draw the signal
> Noisy:=x->sin(1/(x+1/20));
> a0:=evalf(Int(Noisy(t),t=0..1)); a1:=evalf(Int(cos(2*Pi*t)*Noisy(t),t=0..1)); a2:=evalf(Int(cos(4*Pi*t)*Noisy(t),t=0..1)); a3:=evalf(Int(cos(6*Pi*t)*Noisy(t),t=0..1)); b1:=evalf(Int(sin(2*Pi*t)*Noisy(t),t=0..1)); b2:=evalf(Int(sin(4*Pi*t)*Noisy(t),t=0..1)); b3:=evalf(Int(sin(6*Pi*t)*Noisy(t),t=0..1));
> signal:=x->a0 + 2*(a1*cos(2*Pi*x)+a2*cos(4*Pi*x)+a3*cos(6*Pi*x)) + 2*(b1*sin(2*Pi*x)+b2*sin(4*Pi*x)+b3*sin(6*Pi*x));
> plot([Noisy(x),signal(x)],x=0..1);
> plot(Noisy(x)-signal(x),x=0..1,y=-1/2..1/2);
Example 3: Enhancing the low frequency part of f.
In this final example we illustrate the effect of enhancing some of the frequencies of a signal.
> Noisy:=x->2*Heaviside(x-1/2)-1;
> k:=(x,t)->2*sum(cos(2*Pi*m*x)*cos(2*Pi*m*t),m=1..4) + 2*sum(sin(2*Pi*m*x)*sin(2*Pi*m*t),m=1..4);
> k2:=(x,t)->4*sum(cos(2*Pi*m*x)*cos(2*Pi*m*t)/m,m=1..4) + 4*sum(sin(2*Pi*m*x)*sin(2*Pi*m*t)/m,m=1..4);
> int(k2(x,t)*Noisy(t),t=0..1):
> enhance:=unapply(%,x):
> plot({Noisy(x),signal(x),enhance(x)},x=0..1,color=BLACK);
These examples use Maple to assist in teaching the concepts of filtering and signal processing.