LAB 9: HUMAN HEARING AND LEAST-SQUARE TRIGONOMETRIC APPROXIMATION

__Mathematics: __

A human's ear recognizes sound waves, which are variations
in time of the air pressure. Sound waves enter the ear with different
frequencies and the ear activates signals along neural pathways to the brain
with the same frequencies. The signals are interpreted as sound. However, the
human's ear recognizes the sound waves having frequencies within a certain
range, which is roughly ** from 20 to 20,000 **cycles per second.
Therefore, the ear only approximates the incoming sound waves by truncating
signals having frequencies outside this range. This project exploits the
trigonometric approximation for the model of human hearing.

Let a sound wave ** p(t) **have a saw-tooth
pattern with a basic frequency of

*p(t) = _{}_{}_{}*

and graphically:

The ear recognizes only sinusoidal variations of the air pressure that are trigonometric functions of time:

*q(t)
= _{}a_{0 }+ _{}a_{j} cos_{}+ b_{j } sin_{} + a_{m} cos_{}*

where ** (a_{j},b_{j}) **are
amplitudes of the sinusoidal components of a complex sound wave, while
frequencies of the sinusoidal components

The sound wave ** p(t)** with period

* *

Amplitudes ** (a_{j},b_{j}) **of
the function

*a _{j} = _{}_{}p(t) cos*

The least-square trigonometric approximation minimizes the mean square error:

*E = _{}[p(t) – q(t)]^{2} dt*

In the example of ** p(t)** given, one can find
analytically that

__Objectives:__

·
Understand
a computational algorithm for the least-square trigonometric approximation

·
Exploit
the trigonometric approximation for different values of *m *

·
Understand
the Gibbs phenomenon occurring at jump discontinuities of the trigonometric
sums

* *

Let
the interval ** t _{} [0,T] **be
equally spaced partitioned into

*t _{i }= _{}, i=1,2,…,n,n+1*

Let
** n = 2m**. The trigonometric approximant

*a _{j} = _{} _{}p(t_{i}) cos*

When
the function ** p(t) **has a jump at the ends of the interval

*a _{j} = _{}_{}p(t_{i}) cos*

- Define
*T = 0.0005,*and*m = 20000 T,*.*n = 2m* - Assign an equally
spaced partition of
to a row-vector*[0,T]*with*t*grid points.*(n+1)* - Compute a row-vector
from the function*p*at*p(t)*grid points.*(n+1)* - Compute coefficients
of the trigonometric approximant*(a*_{j},b_{j})*q(t).* - Plot the trigonometric
approximant
for a tense partition*q(t)*of the interval between*t*_{int}*0 < t < T.* - Plot the sound wave function
at the same graph.*p(t)*

*Exploiting
the MATLAB script:*

1.
Check
a local error of the trigonometric approximation ** e(t) = |p(t) – q(t)| **for
values of

2.
Check
a local error ** e(t) = |p(t) – q(t)| **for values of

The
least squares trigonometric approximation becomes better as the number of terms
in the approximating trigonometric polynomial ** q(t)** becomes
larger. The mean square error

*E = _{}_{}, *

where
** h **is a step size for a tense grid between

However,
the trigonometric approximant ** q(t) **with infinitely many terms
(the Fourier series) may not converge to the original function

*Steps
in writing the MATLAB script:*

- Define
as previously. Define a loop for values of*T*from*m*to*1**100.* - Let
and assign an equally spaced partition of*n = 2 m*to a row-vector*[0,T]*. with*t*grid points.*(n+1)* - Compute a row-vector
from the function*p*at*p(t)*grid points.*(n+1)* - Compute coefficients
of the trigonometric approximant*(a*_{j},b_{j})*q(t).* - Compute the mean square error
for each value of*E*. Save*m*as a vector.*E* - After the loop in
is terminated, plot the vector*m*versus*E*in semilogy scale.*m* - For
, plot the local error of the trigonometric approximation*m = 100*for a tense partition*e(t) = |p(t) – q(t)|*of the interval between*t*_{int}*0 < t < T.*

*Exploiting
the MATLAB script:*

- Plot the local error
for*e(t) = |p(t) – q(t)|*.*m = 10, 50, 150, 200*

- Compute the
trigonometric approximant
of the function*q(t)*on*p(t)*for*t*_{}[0,2_{}]:*m = 10*

*p(t) = _{}*

- Compute the
trigonometric approximant
of the function*q(t)*on*p(t)*for*t*_{}[0,2_{}]:*m = 10*

*p(t) = e ^{cos t} [
cos(sin t) + sin(sin t)]*