Python Programming for Biology: Bioinformatics and Beyond



Download 7,75 Mb.
Pdf ko'rish
bet286/514
Sana30.12.2021
Hajmi7,75 Mb.
#91066
1   ...   282   283   284   285   286   287   288   289   ...   514
Bog'liq
[Tim J. Stevens, Wayne Boucher] Python Programming

Simulating a signal

We will begin by thinking about how a signal may be simulated in a computer. Naturally,




we  won’t  actually  be  generating  a  real  signal  as  we  won’t  be  taking  experimental

measurements, but it is nonetheless useful to have code that simulates a signal. This will

help give a basis for understanding the signal processing we describe later and allow us to

check that the processing code works as expected. A pure frequency signal just oscillates

and  mathematically  this  is  either  a  sine  or  cosine  function,  or,  in  terms  of  complex

numbers,  an  exponential  function  with  an  imaginary  argument.  The  signal  also  has

amplitude, which in general is also a complex number. Thus a pure frequency signal (x), in

continuous time (t), has the form:



x(t) = Ae

i2

πωt

where ω is the frequency and A is the amplitude.

Note that this is one-dimensional, given there is only one independent variable, t, which

can  be  used  to  calculate  the  amplitude  at  a  given  time.  In  many  applications  higher

dimensions  may  also  be  considered;  imagine  calculating  the  frequency  of  ripples  on  the

surface  of  water  as  an  example  of  two-dimensional  waves.  An  example  of  a  three-

dimensional signal would be diffraction patterns in X-ray crystallography, although in this

case  it  is  spatial  distance  rather  than  time  that  is  the  relevant  variable.  Mathematically

there is no extra difficulty with handling signals that have more than one dimension, but

visualisation becomes harder.

It is often the case that the signal decays exponentially in time, as illustrated in

Figure

19.1


.  Mathematically  we  can  simulate  this  by  multiplying  the  signal  by  an  extra  decay

term, as follows, for decay constant λ:



x(t) = Ae

i2πωt

e

−λt

In  terms  of  discrete  time  points  (as  would  generally  be  recorded  by  a  machine),  the

signal  is  described  by  the  same  form,  but  sampled  at  regular  time  intervals  (

,  for  N  points).  We  will  allow  the  superposition  of  a

number  of  such  signals,  which  can  be  combined  in  a  simple  linear  manner,  so  the  total

signal will just be the sum of the individual frequency components. We will also assume

that the signal has random imperfections, i.e. that it is affected by noise. There are many

ways  to  model  noise  but  we  will  assume  that  at  each  point  in  time  its  magnitude  is

normally distributed (Gaussian) in both real and imaginary components, with the mean at

zero amplitude and with a specified standard deviation that is independent of time.




Download 7,75 Mb.

Do'stlaringiz bilan baham:
1   ...   282   283   284   285   286   287   288   289   ...   514




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish