Professional Documents
Culture Documents
C. C. Esporlas
National Institute of Physics
University of the Philippines
ccesporlas@gmail.com
1. Introduction
In physics most problems involve functions or
signals that can be expressed or decomposed into a
sum of sinusoidal functions of different frequencies
that can be recombined to obtain the original
function. These signals may be of any form like a
square wave or a Gaussian wave and they can be
represented as the limit of a sum of sinusoidal
functions like a set of continuous oscillations. This
recombination process is a mathematical tool
commonly used in physics is the Fourier analysis.
After decomposition an amplitude and phase is
obtained for each frequency that is basically the
sinusoidal functions which therefore has a value that
can be represented as a complex number.
Fourier analysis has many scientific applications
like in signal and image processing, optics such as
the output of a stellar interferometer, the electron
distribution in an atom obtained from a Fourier
transform of the amplitude of scattered X-rays and
also the wave nature of matter in quantum mechanics.
In most cases, Fourier transform refers to the
transform of functions of a continuous real variable,
such as time. The amplitude and phase of a
sinusoidal component of function depends on the
component's frequency which is the complex part.
However this continuous function can be replaced by
a continuum of discrete values and the integration is
replaced with a summation. This application is
helpful since data is only available at discrete points
in time or space like a continuous sampling which is
more applicable now with the use of computers.
bs =
N 1
a
N
r =0
rs
exp 2 i
N
(1)
N 1
rs
b exp 2 i N
N
ar =
(2)
s =0
bs
cs ( r ) =
exp [ is r ]
(3)
ar = ar + kN , bs = bs + kN
(4)
rs
exp 2 i
N
r =0
N 1
1
r ( s)
=
ar exp 2 i
N
N r =0
= b s .
bs =
N 1
a
N
bs = b* s = bN* s ;
thus, only values b0,,bN/2
bN/2+1,,bN-1 are redundant.
(5)
are
relevant,
and
2. Physics Problem
In this project we are given a time-dependent
voltage probed at N=64 points (sampling) in time
resulting to a discrete set of voltages {Uo,,UN-1}.
And then another sequence {bo,,bN-1} is the Fourier
transform of the voltage signals. This second set of
sequence has the power spectrum |bs|2=|bN-s|2=1 for s
= 8,10,,16, otherwise bs=0. If the voltage
{Uo,,UN-1}signal is real then from Equation 5, bN*
s=b s.
Now, what is asked is how the voltage signal
{Uo,,UN-1}will look like if the phases of the Fourier
coefficients are constant, e.g. bs=1, if bs0 and if
random phases for the non-zero bs, i.e., bs=exp(is)
where the s is random. Next is to find phases (s)
that will result in the lowest possible peak voltage,
i.e. min {s} max r |Ur|.
In order to get an idea of how the voltage signal
will look like, we need to get the inverse Fourier
transform of the different sets of s { s=constant
(e.g. bs=0); s=constant but bs0; s=random0} and
plot it in a U vs. N graph.
For the first and second condition, we simply get a
set of s which is a set of 1s and 0s using the power
spectrum condition and apply an Inverse Fourier
Transform and get the voltage signal {Uo,,UN-1}.
For the second condition, when a specific constant
phase is used, the bs becomes equal to 1 such that all
the bs in the set is equal to 1 and when an Inverse
Fourier is formed, we will get a straight line.
For the third condition we use the equation
bs=exp(is) and setting the s as a random set of
values.
In the next problem, we look for the phases that
give the minimum peak voltage of different voltage
signals having different sets of random phases.
Basically we get a set of voltage points for a single
signal by using a set of random phases. We then get
the Fourier transform of this set of voltage points for
a single signal and then get its peak voltage.
Repeating the same process over again for a number
of times corresponding the number of voltage signals
we get a set of peak voltages and then we get the
maximum of this set of peak voltages. The set of
phases that give this minimum peak voltage will then
be marked.
3. Algorithm
To implement the computations needed we use
Python which already has a library for the Fourier
transform.
For problem1:
b[i]= 1
b[N-i]= 1
4. Results
For part1 the voltage signal looks like this:
U=scipy.real(scipy.fftpack.ifft(b3))
pylab.plot(x3,U,'g',label=')
For part2
References
[1] Mathematical Methods for Physicists by Arfken
and Weber
Source Code:
#############################################################################################
#
# Applied Physics 155
# Project 1: Fourier Transform
#
# Name: Project1_FourierTransform_Esporlas.py
# By: Cindy Liza C. Esporlas
# Date: December 13, 2007
# Description: This outputs the plot of a voltage signal using the set of Fourier
#
coefficients b (with problem1: constant phases, problem2: random phases)
#
where these coefficients are the Fourier transform of a set of voltage
#
values obtained from a number of probes N. This only gives approximation
#
since the the voltage values are taken from a discrete number of sources.
#
This also outputs an approximate minimum of the voltage peaks and the set of
#
phase angles that give these values.
#############################################################################################
import scipy, scipy.special, scipy.fftpack, pylab
N=64
x=scipy.linspace(0,N-1,N)
#problem 1
pylab.figure(1)
b1=scipy.zeros(N)
for i in range(8,17,2):
b1[i]=1
b1[N-i]=1
part1=scipy.fftpack.ifft(b1)
pylab.plot(x,part1,'r-',label='Voltage Signal with Constant Phases')
pylab.axis('tight')
pylab.xlabel('Voltage Signal Probes (N)')
pylab.ylabel('Voltage Sequence(U)')
#problem 2
pylab.figure(2)
b2=scipy.zeros(N)
for i in range(8,17,2):
bs=int(abs(scipy.exp(1j*scipy.rand()*360)))
b2[i]=bs
b2[N-i]=scipy.conjugate(bs)
part2=scipy.fftpack.ifft(b2)
pylab.plot(x,part2,'b',label='Voltage Signal with Random Phases')
pylab.axis('tight')
pylab.xlabel('Voltage Signal Probes (N)')
pylab.ylabel('Voltage Sequence(U)')
#problem 3
pylab.figure(3)
pylab.axis('normal')
pylab.xlabel('Voltage Signals (R3)')
pylab.ylabel('Voltage Sequence(U)')
#Get the minimum of the set of maximum U values from R voltage signals
for r in xrange(R3):
minmaxU=min(maxU)
#store the minimum of the set of maximum U values and the corresponding phi used in a two dimensional array
for j in range(N3):
if U[j]==minmaxU:
minU=[U[j],phis[j]]
print minU
#show the minimum of the maximum U values
print minmaxU
pylab.show()