Fourier series - by Ray Betz: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
SDiver (talk | contribs)
SDiver (talk | contribs)
Line 219: Line 219:


[[Image:Adaptive.JPG]]
[[Image:Adaptive.JPG]]
It should be noted that in the above diagram, <math> e(n)=y(n)-r(n) = [\sum_{k=0}^{N-1} h_n(k) x(n-k)] - r(n) </math>.  The goal of an adaptive FIR filter is to drive the error, e(n), to zero.  If we consider that this is a two coefficient filter and we have a contour plot of <math> e^2(n) </math> then we want to travel in the direction of the negative gradient to minimize the error.  Let us say that <math> \mu </math> is the stepping size.  So...
It should be noted that in the above diagram, <math> e(n)=y(n)-r(n) = [\sum_{k=0}^{N-1} h_n(k) x(n-k)] - r(n) </math>.  The goal of an adaptive FIR filter is to drive the error, e(n), to zero.  If we consider that this is a two coefficient filter and we have a contour plot of <math> e^2(n) </math> then we want to travel in the direction of the negative gradient to minimize the error.  Let us say that <math> \mu </math> is the stepping size.  So...
<math>  \triangle h_n(m) = - \frac{\partial (e^2(n))}{\partial h_n(m)} \mu = - \mu 2 e(n)\frac{\partial (e(n))}{\partial h_n(m)} = - 2 \mu e(n) x(n-m) </math>
<math>  \triangle h_n(m) = - \frac{\partial (e^2(n))}{\partial h_n(m)} \mu = - \mu 2 e(n)\frac{\partial (e(n))}{\partial h_n(m)} = - 2 \mu e(n) x(n-m) </math>

Revision as of 18:53, 30 November 2005

Fourier Series

If

  1. x(t)=x(t+T)
  2. Dirichlet conditions are satisfied

then we can write

x(t)=k=αkej2πktT

The above equation is called the complex fourier series. Given x(t), we may determine αk by taking the inner product of αk with x(t). Let us assume a solution for αk of the form ej2πntT. Now we take the inner product of αk with x(t) over the interval of one period, T. <αk|x(t)>=<ej2πntT|k=αkej2πktT> =T2T2x(t)ej2πntTdt =T2T2k=αkej2πktTej2πntTdt =k=αkT2T2ej2π(kn)tTdt

If k=n then,

T2T2ej2π(kn)tTdt=T2T21dt=T

If kn then,

T2T2ej2π(kn)tTdt=0

We can simplify the above two conclusion into one equation. (What is the delta function below?)

k=αkT2T2ej2π(kn)tTdt=k=Tδk,nαk=Tαn

So, we conclude αn=1TT2T2x(t)ej2πntTdt

Orthogonal Functions

The function yn(t) and ym(t) are orthogonal on (a,b) if and only if <yn(t)|ym(t)>=abyn*(t)ym(t)dt=0.

The set of functions are orthonormal if and only if <yn(t)|ym(t)>=abyn*(t)ym(t)dt=δm,n.

Linear Systems

Let us say we have a linear time invarient system, where x(t) is the input and y(t) is the output. What outputs do we get as we put different inputs into this system? File:Linear System.JPG

If we put in an impulse response, δ(t), then we get out h(t). What would happen if we put a time delayed impulse signal, δ(tu), into the system? The output response would be a time delayed h(t), or h(tu), because the system is time invarient. So, no matter when we put in our signal the response would come out the same (just time delayed).

What if we now multiplied our impulse by a coefficient? Since our system is linear, the proportionality property applies. If we put x(u)δ(tu) into our system then we should get out x(u)h(tu).

By the superposition property(because we have a linear system) we may put into the system the integral of x(u)δ(tu) and we would get out x(u)h(tu)du. What would we get if we put ej2πft into our system? We could find out by plugging ej2πft in for x(u) in the integral that we just found the output for above. If we do a change of variables (v=tu, and dv=du) we get x(u)h(tu)du=ej2πfth(tu)du=ej2πf(tv)h(v)dv=ej2πfth(v)ej2πfvdv. By pulling ej2πft out of the integral and calling the remaining integral Bk we get ej2πftBk.



INPUT OUTPUT REASON
δ(t) h(t) Given
δ(tu) h(tu) Time Invarient
x(u)δ(tu) x(u)h(tu) Proportionality
x(u)δ(tu)du x(u)h(tu)du Superposition
ej2πfth(tu)du ej2πftej2πvth(v)dv Superposition
ej2πft ej2πftBk Superposition (from above)

Fourier Series (indepth)

I would like to take a closer look at αk in the Fourier Series. Hopefully this will provide a better understanding of αk.

We will seperate x(t) into three parts; where αk is negative, zero, and positive. x(t)=k=αkej2πktT=k=1αkej2πktT+α0+k=1αkej2πktT

Now, by substituting n=k into the summation where k is negative and substituting n=k into the summation where k is positive we get: n=1αnej2πntT+α0+n=1αnej2πntT

Recall that αn=1TT2T2x(u)ej2πntTdt

If x(t) is real, then αn*=αn. Let us assume that x(t) is real.

x(t)=α0+n=1(αnej2πntT+αn*ej2πntT)

Recall that y+y*=2Re(y) Here is further clarification on this property

So, we may write:

x(t)=α0+n=12Re(αnej2πntT)

Fourier Transform

Fourier transforms emerge because we want to be able to make Fourier expressions of non-periodic functions. We can take the limit of those non-periodic functions to get a fourier expression for the function.

Remember that: x(t)=x(t+T)=k=αkej2πktT=k=1/TT2T2x(u)ej2πkuTduej2πktT


So, limxx(t)=(x(u)ej2πfudu)ej2πftdf

From the above limit we define x(t) and X(f).

x(t)=1[X(f)]=X(f)ej2πftdf

X(f)=[x(t)]=x(t)ej2πftdt

By using the above transforms we can now change a function from the frequency domain to the time domain or vise versa. We are not limited to just one domain but can use both of them.

We can take the derivitive of x(t) and then put it in terms of the reverse fourier transform.

dxdt=j2πfX(f)ej2πftdf=1[j2πfX(f)]

What happens if we just shift the time of x(t)?

x(tt0)=X(f)ej2πf(tt0)df=ej2πft0X(f)ej2πftdf=1[ej2πft0X(f)]

In the same way, if we shift the frequency we get:

X(ff0)=x(t)ej2π(ff0)tdt=ej2πtf0x(t)ej2πftdf=[ej2πtf0x(t)]

What would be the Fourier transform of cos(2/pif0t)x(t)?

[cos(2πf0t)x(t)]=x(t)cos(2πf0t)ej2πftdt=ej2πf0t+ej2πf0t2x(t)ej2πftdt

=12x(t)ej2π(ff0)tdt+12x(t)ej2π(f+f0)tdt=12X(ff0)+12X(f+f0)

What would happen if we multiplied our time by a constant in x(t)? We will substitute u=at and du=adt. If a0:

[x(at)]=x(at)ej2πftdt=x(u)ej2πfuadu|a|=1|a|X(fa)

Ok, lets take the fourier transform of the fourier series.

[n=αnej2πntT]=n=αnej2πntTej2πftdt=n=αnej2π(fnT)tdt=n=αnδ(fnT)

Remember: δ(f)=ej2πftdt

CD Player

Below is a diagram of how the information on a CD player is read and processed. As you can see the information on the CD is processed by the D/A converter and then sent through a low pass filter and then to the speaker. If you were recording sound, the sound would be captured by a microphone. Then, it should be sent through a low pass filter. The reason you want a low-pass filter is to keep high frequencies (that you don't intend to record) from being recorded. If a high frequency was recorded at say 30 KHz and the maximum frequency you intended to record was 20KHz, then when you played back the recording you would here a tone at 10KHz. From the filter the signal goes onto the A/D converter and then it is ready to be put on the CD. Recording signals (as just described) is essentially the reverse of the operation pictured below.

File:CDsystem.jpg

In Time Domain:

Let's start with a signal h(t), as shown in the below picture. In this signal there is an infinite amount of information. Obviously, we can't hold it all in a computer, but we could take samples every T. Lets do that by multiplying h(t) by n=δ(tnT). Since the magnitude of our delta function is one, we get a series of delta functions that record the value of h(t) at intervals of T. This gives us a result that looks like: h(t)n=δ(tnT)=n=x(nt)δ(tnT)

In Frequency Domain:

In the frequency domain we start with H(f). Now we are in frequency, so we must convolve instead of multiply like we did in the time domain. We would have to convolve H(f) with [n=δ(tnT)].

Aside:[n=δ(tnT)]=n=δ(tnT)ej2πftdt=n=δ(tnT)ej2πftdt=n=ej2πfnT

This result looks it could be a fourier series. We would like to get our result in terms of delta functions. As shown below, the periodic delta functions could be represented as a fourier series with coefficients αm.

n=δ(tnT)=m=αmej2πmt

Now we can solve for αm.

αm=1TT2T2n=δ(tnT)ej2πmtTdt=1TT2T2δ(t)ej2πmtTdt=1T

Since the only delta function within the integration limits is the delta function at t=0, we can take out the summation and just leave one delta function. Then, evaluating the integral at t=0 we get 1T

n=δ(tnT)=n=1Tej2πktT [n=δ(tnT)]=[n=1Tej2πktT]=n=1Tej2πktTej2πftdt=1Tn=ej2π(fmTtdt=1Tn=δ(fnT)

Now wer are ready to take the convolution.

H(f)*1Tn=δ(fnT)=1Tn=H(fnT)

File:Barnsasample.jpg

Time Domain

In order to output as sound any of the signals that we have we must run them through a D/A converter. This is like convolving the below signal by a step function p(t)=U(t+T2)U(tT2).

This gives us (nt)p(tnT). This is what the signal looks like as it is output through the D/A converter.

Frequency Domain

To find out what we would multiply by in the frequency domain we just take the inverse fourier transform of p(t) and we get P(f)=sin(πtT)πtT.

By multiplying 1Tn=X(fnT)P(f)=X(f). This is hopefully close to what we started with for a signal.

File:BarnsaDA.jpg

For 2 times oversampling:

In time, multiply: n=x(nT)δ(tnT) by n=MMh(mT2)δ(tmT2). This profides points that are interpolated and makes our output sound better because it looks closer to the original wave.

In frequency, convolve: 1Tn=X(fnT) with m=MMh(mT2)ej2πmf2T. The X(f) that you get is great because there is little distortion near the original frequency plot. This means that you can use a cheaper low-pass filter then you would otherwise have been able to.

Nyquist Frequency

If you are sampling at a frequency of 40 KHz, then the highest frequency that you can reproduce is 20 KHz. The nyquist frequency, would be 20 KHz, the highest frequency that can be reproduced for a given sampling rate.

FIR Filters

A finite impulse response filter (FIR filter) is a digital filter that is applied to data before sending to out a D/A filter. This type of filter allows for compensation of the signal before is it destorted so that it will look as it was originally recorded. Using an FIR filter also allows us to put a cheap low-pass filter on after the D/A converter because the signal has been compensated so it doesn't take as good a low-pass filter as it would without the FIR filter.

Note: From the Circular Convolution we get: y(n)=m=0N1h(m)x(nm)

Adaptive FIR Filters

File:Adaptive.JPG

It should be noted that in the above diagram, e(n)=y(n)r(n)=[k=0N1hn(k)x(nk)]r(n). The goal of an adaptive FIR filter is to drive the error, e(n), to zero. If we consider that this is a two coefficient filter and we have a contour plot of e2(n) then we want to travel in the direction of the negative gradient to minimize the error. Let us say that μ is the stepping size. So... hn(m)=(e2(n))hn(m)μ=μ2e(n)(e(n))hn(m)=2μe(n)x(nm)

What would hn+1(m) look like?

hn+1(m)=hn(m)2μ(y(n)r(n))x(nm)=hn(m)2μ([k=0N1hn(k)x(nk)]r(n))x(nm)