Download Techniques in Signal and Data Processing

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Computational electromagnetics wikipedia , lookup

Chirp spectrum wikipedia , lookup

Heterodyne wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Transcript
Techniques in Signal and
Data Processing
CSC 508
Frequency Domain Analysis
Frequency Domain Analysis
In this section we learn how to transform a time domain signal into the frequency domain.
We study both periodic and non-periodic signals and the types of transforms that work best
with each.
First Principles - We have combined sine waves of different amplitudes and frequencies to
make other wave shapes. A sine wave is a periodic function described by the y-value of a
unit-vector rotated about the origin. In this case the independent variable is the angle
between the unit vector and the positive x-axis.
We can specify a time-varying periodic function by defining a rotation rate w if the unitvector in radians per second. The angle q of the unit vector is given by q=wt for time t.
There are three parameters that describe a sine function. These are the amplitude A, the
frequency 2pw and the phase q0.
period = 1/frequency
y(t )  A sin( 2pwt  q 0 )
amplitude
The amplitude is the peak value obtained by multiplying the value of the sine function
by A. The frequency is the number of cycles of the sine wave generated per second
and is given in 2p times w cycles per second (Hertz). The period (or wavelength) is the
inverse of the frequency. The phase q0 is the amount of shif in angle (or time) of the
wave relative to the origin. For a positive phase shift, the wave appears to move
backqard because the values of the wave are reached earlier by an amount proportional
to the phase angle.
So what's the big deal about sine waves? They are only one of an infinitely large
number of possible wave shapes. The reason we are concerned with sine waves is that
they are a class of waves that can be combined to make any other wave shape.
Combining Sine Waves - Let's add two sine waves together whose amplitudes and
frequencies are the same but whose phases are different by p/2.
Y1 q   A sin q 

Y2  A sin q  p

2
We see that this results in a new sine wave with the same frequency, an amplitude that is
2 times the original functions' amplitudes, and a phase that is half way between 0 and
p/2. We can verify this result mathematically.


Ysum q   Y1 q   Y2 q   A sin q   sin q  p

2
   
   
since sin   sin   2 sin 
cos

 2 
 2 



q  q  p
2
we have Ysum q   2 A sin 
2



cos p 4
2 A sin q  p 
4
Ysum q   2 A sin q  p
Ysum q  
 cosq  q  p 2 




2
4
If we were to reduce the amplitude of one of the sine waves in this example, the result
would still be a sine wave but the phase of the resulting wave would shift toward the
phase of the sine wave with the larger amplitude.


In order to build functions with other shapes
we have to combine waves of different
frequencies. In the next example with add
two sine waves, buth this time we keep the
amplitudes and phases equal and give one
wave double the frequency of the other.
Since the two wave have the same phase,
they initially add together constructively (i.e.
the amplitude of the resulting wave is
greater). However, the higher frequency
wave begins to swing back to negative
values before the lower frequency wave and
the two wave begin to cancel each other out
(i.e. they add destructively).
You may want to use the program
sine_gen.exe to experiement with this effect.
The Fourier Series
We are now ready to formalize the notion of a trignonometric series that can generate
any function. Consider the following inifinite series,
1
2
a0  a1 cos x  b1 sin x  ...  an cos nx  bn sin nx  ...
where 1/2a0 is a normalized coefficient establishing the baseline or neutral position of the
periodic function being represented in the series. This series is called the Fourier series,
named after its discoverer. The next pair of terms (a1cosx + b1sinx) is the fundamental,
the next term is called the first harmonic or first overtone and so on. Since the cosine
and sine are related by a phase angle p, this series can also be represented with only
sine or cosine terms. For example,

 A sin( nx   )
n 0
n
An  an2  bn2 , an  An sin  , bn  An cos 
This is all very exciting, but to be of much value to us, we need to know how to
determine the proper coefficients an and bn to represent an arbitrary function f(x) in a
Fourier series.
Suppose a function f(x) is represented by the Fourier series,
a0 
f ( x)    (an cos nx  bn sin nx)
2 n 1
We wish to solve for an expression of the coefficients an and bn. To do this we must
select one of the term in the infinite series at a time while forcing the other terms to
zero. There is usually a trick in mathematical derivations and this case is no
exception. Multiply both sides of this expression by cos mx and then integrate both
sides with respect to x over one period (-p to p).

 a0

f
(
x
)
cos
mx
dx

cos
mx

cos
mx
(
a
cos
nx

b
sin
nx
)

n
n
 dx
p
p  2
n 1


p
p
a0 p
  cos mx dx   an  cos nx cos mx dx   sin nx cos mx dx
p
p
2 p
n 1
p
p


The integrals in the summation can be evaluated with the help of a few trigonometric
identities. In particular we have the desired selector operation,
 0 when n  m
cos
nx
cos
mx
dx


p
p when n  m
p
And the other integra is always zero. Therefore, for each value of the index m, only
the mth term is non-zero, and we have,
p
 p f ( x) cos mx dx  pa

m
p
 p f ( x) sin mx dx pb
m

Solving for the coefficients an and bn we have,
1
p
an 
f ( x) cos nx dx

p
p
bn 
1

p
f ( x) sin nx dx

p
p

( for n  0,1,2,...)
( for n  1,2,...)
Any function f(x) that is continuous and integrable over the domain -p to p can be
represented as a trigonometric series with the coefficients an and bn,
f ( x)  12 a0  a1 cos x  b1 sin x  ...  an cos nx  bn sin nx  ...
When f(x) is an even function (i.e. f(-x)=f(x) ) or an odd function (i.e. f(-x)=-f(x) )
then we can simplify the trigonometric series to a Fourier cosine series or a Fourier
sine series respectively.
f(x) Even
p
an 
f(x) Odd
p
2
p
p
bn  0
0
f ( x) cos nx dx
p
p
an  0
bn 
2
p
p
0
f ( x) sin nx dx
Let's compute the coefficients of the square wave defined by,
 1 for x  p to 0
f ( x)  
  1 for x  0 to p
p
p
We notice that the function is odd since f(-x)=-f(x), so we will compute the coefficients
of the Fourier sine series. The limits of integration are between 0 and p so only the +1
portion of the square wave is used. (Don't forget that the -1 portion of the square wave
is implied by the fact that we are assuming an odd function.)
cosine
bn 
2
p
sin nx dx

p
0
p
2 1

  cos nx 
p n
0
2 1
1
   cos np  
p n
n
0
p
2p
3p
 4
 np for n  1,3,5,...
bn  

 0 for n  2,4,6,...
4p
So the coefficients are,
b1  4 p
b5  4 5 p
b9  4 9 p
b2  0
b6  0
b10  0
b3  4 3p
b7  4 7p
b11  4 11p
b4  0
b8  0
b12  0
etc.
Using just these terms we get the approximation to the square wave shown below:
Homework:
1. Compute the first 8 coefficients of the following function and use sine_gen.exe to
view the resulting approximation of f(x).
  p  x for x  p ,  p / 2


f ( x)  
x for x  p / 2 , p / 2

 p  x for x  p / 2 , p

p
p/2
0
p/2
p
2. Define the limits of integration for this
odd function and derive the formula for
the coefficients of its Fourier sine series.
p
p/2
0
p/2
p