首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导data留学生编程、讲解Python编程、Python程序调试 解析Java程序|讲解数据库SQL
项目预算:
开发周期:
发布时间:
要求地区:
General tips for computing and plotting discrete fourier transforms (DFT)
Let g(t) be some time signal that’s sampled at to get a discrete array/list g = [ … ]
You don’t need to code your own DFT, use numpy: A = numpy.fft.fft(g) * dt
You should also use numpy.fft.fftshift( A ) to shift the fft output such that the 0-frequency component is centered (see why
here https://docs.scipy.org/doc/numpy/reference/routines.fft.html#background-information) which you probably want when plotting
You can use f_axis = numpy.fft.fftshift( numpy.fft.fftfreq(len(g), dt) ) to create the frequency axis for plotting
the shifted spectrum
Keep in mind the fft output is in general complex, so to compare two fourier transforms (e.g. DFT vs CFT) you should compare either
the real and imaginary parts ( ), or the phase and amplitude ( ). Amplitude plots are most useful for this lab, show
all 4 aspects though if you want.
Note numpy fft assumes the time signal starts at , if yours doesn’t you should center it at zero. If you don’t then the complex
components (x and y, or phase) will be off, but the amplitude should not change (why? analytically, recall that axis shifts in either
domain are equivalent to complex exponential scaling, which has amplitude 1, in the other domain).
If your time signal g is centered at zero, a hack to ‘rotate it’ to start at zero (and then take the fft and fftshift that) is to do: fftshift(
fft( ifftshift(g) ) ) (you may see mention of this online)
1 Fourier transform of Gaussian Functions (6 pts)
A common function used for the convolution of time series data is the Gaussian function
where is the half duration.
1. Plot for and sec on the same graph with domain and .
2. The analytical formula for the Fourier transform of is
Compute the discrete Fourier transform (DFT) for both sampled time series, and compare them to the analytical for both
's on the same graph.
Hints:
As numpy fft assumes signal starts from time 0, you can use the shift property of Fourier transform to first shift the to start
from zero, and after fftshift(fft()) operations, multiply the spectrum by complex exponential sinusoid function.
You need to sample the theoretical curve with w_axis = 2*pi*f_axis , or else rewrite it as if you'd rather
sample it with f_axis
As a guide (so you can be confident of your fft utilization for the remainder of the lab), we expect that the amplitudes (use
numpy.abs(…) ) of the discrete FT and the continuous FT essentially match. The phase won’t necessarily match.
3. Comment on the effect of filtering a general input time function by (i.e. convolution of with ), and explain the
difference in filtered output after applying Gaussian functions with or secs.
4. Comment on how this is related to the time-frequency uncertainty principle (a signal cannot be infinitesimally sharp both in time and
frequency).
2 Fourier transform of Window Functions (6 pts)
A continuous time signal can be truncated into a signal of finite length by window functions :
Typical window functions include:
Boxcar function
Hann window
Now let seconds, and sample both window functions by seconds:
1. Plot both window functions on the same graph.
2. Calculate the Fourier transform of both functions by numpy fft() . Pay extra attention to how you interpret the corresponding
frequencies of output results from python. (Hint: fftshift() may be useful. Also pay attention to the length of the input signal (> 10
sec), as it dictates the frequency resolution for the spectrum.)
3. Plot the Fourier transform of both functions in the appropriate frequency range on the same graph.
4. Based on the FTs, comment on the effect of truncating a continuous time series by either window on its frequency spectrum
compared to the original spectrum .
5. Speculate on the advantages and disadvantages of boxcar and Hann window functions for truncation.
3 Radial Distribution Function (12 pts)
Background
Liquids have no fixed internal structure. Yet they do have some short range order in the sense that they have preferred intermolecular
spacings, which are determined by the locations of minima in the intermolecular potentials. The microscopic structure of liquids is often
characterized by a quantity known as the Radial Distribution Function , which is essentially the probability (Relative to the average
probability, which means that tends to 1 at large , where the neighbour is too far away to feel any interaction.) that a molecule has a
neighbouring molecule at distance . Typically shows a value that approaches zero at small since molecules cannot occupy the
same space; it also shows a peak at the preferred distance of nearest neighbours, and secondary peaks at preferred distances of more
distant neighbours. If a suitable collimated beam of particles (e.g. X-rays or neutrons) is sent through a sample of the liquid, some of the
particles are scattered. The number of particles scattered through a given angle is related to the Fourier Transform of evaluated at the
wavenumber corresponding to the transverse momentum transfer associated with that scattering angle. Kittel derives this relationship in
Chapter 17 of Introduction to Solid State Physics.
If this all sounds complicated, all you need to know here is that something called the Structure Factor is effectively measured by
looking at the scattered intensity as a function of scattering transverse wavenumber (proportional to scattering angle), and that the Radial
Distribution Function is related to it by
where is liquid number density (number of atoms per unit volume, computable from the three constants mentioned in the introduction),
is wavenumber, and is radius.
1. You may have noticed some resemblance between expression (6) and the Fourier transform. First show that the integration part
can be rewritten as
Hint: The structure factor S(k) is even, since there should be no reason why scattering intensity would be different for one direction (+k)
compared to its opposite (−k). Using the fact that S(k) is even may be useful.
2. Now we can make some connections between the Radial Transfer Function and the Fourier Transform, if we substitute and
. What is the Fourier transform of ? Is a real, imaginary or general complex function? Is it even or odd? How will
these affect ? Is that what you expect? Plot as a function of ranging from Å to Å based on argon.py (i.e.
import and use the variables defined there).
Hint: In constructing from argon.py , you should make an "even" array twice the length (minus 1) of YanData. YanData
represents the structure factor (i.e. ) for argon sampled at the defined in the argon.py file. It's specifically sampled
from k = 0 to k = len(YanData) * dk , so create an even function out to the same length in the negative direction (i.e. the "kaxis"
it's sampled on would be len(YanData)*dk, ... 0, ..., + len(YanData)*dk ).
3. Write a Python function [gn, rn] = RDFcalc(S, dk, rho) to calculate Radial Distribution Function from Structure Factor
data, sampled at , and density , and output the RDF vector and its corresponding radial distance vector .
Hint: for Python fft() and ifft() functions, realize that the values of the Fourier Transform corresponding to negative
frequencies are stored in the second half of the arrays given to ( ifft ) or obtained from it ( fft ). You also have to study the
difference between the DFT and FT to multiply the right factors.
4. With the data provided in argon.py , compute the corresponding Radial Distribution Function . Plot your results for from to
Å. Over what range of radius can you trust your result?
Hint: To check if your results make sense, recall that is related to the probability that a molecule has a neighbouring molecule at
distance , therefore, should be close to when , i.e. two molecules can not occupy the same space, and you can set
. Recall . Also note the unit used in formula (6).
5. From the you computed, estimate the average molecular radius of liquid argon. Give your reasoning and state what accuracy
you can justify for your estimation.
6. Now we explore the effect of sampling range. Yan sampled in wavenumber out to Å , and he could have saved
himself work by not collecting as much data, i.e., reducing . But how much could he have reduced the sampling length ,
while still seeing distinct peaks in the Radial Distribution Function? Also explain theoretically what you observe.
Hint: Plot on top of the obtained in part 4, the 's you compute for a series of values. You can try half each time to
look for changes. For the theoretical explanations for part 6 and 7, realize the interchangability of ( ).
7. To explore the effect of data sampling, let's assume Yan decided to save his work by sampling less often (i.e. increasing ). How
large a can he use to be able to still recover the first two peaks clearly? State your answers and a theoretical justification for what
you expect to see if you increase too much.
Hint: Plot on top of the obtained from argon.py data, the 's you obtain when you subsample the same dataset. Try
doubling each time to observe the effect of coarser sampling.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!