Commit 27043722 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

first correct version

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 516
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 2e3b039c
c this is <siggen.f>
c------------------------------------------------------------------------------
c ($Id: siggen.f,v 1.3 2001-10-25 09:41:11 forbrig Exp $)
c ($Id: siggen.f,v 1.4 2001-10-25 12:01:02 forbrig Exp $)
c
c 24/10/2001 by Thomas Forbriger (IMGF Frankfurt)
c
......@@ -16,7 +16,7 @@ c
character*(*) version
parameter(version='SIGGEN V1.0 SIGnal GENerator')
character*(*) SIGGEN_CVS_ID
parameter(SIGGEN_CVS_ID='$Id: siggen.f,v 1.3 2001-10-25 09:41:11 forbrig Exp $')
parameter(SIGGEN_CVS_ID='$Id: siggen.f,v 1.4 2001-10-25 12:01:02 forbrig Exp $')
c
c parameters
integer nsig,ncyc
......@@ -115,12 +115,18 @@ c
print *,' 0.25*cos(pi*(t-Ta)/(Te-Ta))**3) Ta < t < Te'
print *,' f(t)=1 t >= Te'
print *,' '
print *,' It is a smooth step starting at Ta at value 0'
print *,' and leading to value a at Te.'
print *,' '
print *,'3 first order derivative of Mueller-Bruestle function'
print *,' f(t)=0 t <= Ta'
print *,' f(t)=a*(0.75*pi/(Te-Ta)*'
print *,' dsin(pi*(t-Ta)/(Te-Ta))**3) Ta < t < Te'
print *,' f(t)=0 t >= Te'
print *,' '
print *,' It is a smooth one-sided impulse starting at Ta'
print *,' and ending at Te.'
print *,' '
print *,'4 second order derivative of Mueller-Bruestle function'
print *,' f(t)=0 t <= Ta'
print *,' f(t)=a*(9*pi**2/(4*(Te-Ta)**2)*'
......@@ -128,20 +134,47 @@ c
print *,' cos(pi*(t-Ta)/(Te-Ta))) Ta < t < Te'
print *,' f(t)=0 t >= Te'
print *,' '
print *,' It is a smooth two-sided impulse starting at Ta'
print *,' and ending at Te with a zero-crossing at (Ta+Te)/2.'
print *,' '
print *,'5 damped modulated sine'
print *,' the frequency is modulated according to'
print *,' Fr(t)=f1+b*t'
print *,' with b=sqrt(((2*f2-f1)**2-f1**1)/(4*n))'
print *,' the end of the signal is at'
print *,' Tend=Ta+(f2-f1)/b'
print *,' the freqeuncy extrema are'
print *,' Fr(0)=f1 Fr(Tend-Ta)=f2'
print *,' the final value of the signal phase is'
print *,' 2*pi*Fr(Te-Ta)*(Te-Ta)=n*2*pi'
print *,' '
print *,' f(t)=0 t <= Ta'
print *,' f(t)=a*(sin(2*pi*Fr(t-Ta)*(t-Ta))*'
print *,' f(t)=a*(sin(2*pi*(f1+b*(t-Ta))*(t-Ta))*'
print *,' exp(-(t-Ta)/Td))) Ta < t < Tend'
print *,' f(t)=0 t >= Tend'
print *,' '
print *,' Tend=Ta+2.*n/(f1+f2)'
print *,' b=(f2**2-f1**2)/(4.*n)'
print *,' '
print *,' The signal starts at Ta with value 0 and'
print *,' terminates at Tend after n cycles with value 0.'
print *,' The frequency varies from f1 at Ta to f2 at Tend.'
print *,' '
print *,'6 damped asymmetric sine pulse'
print *,' '
print *,' f(t)=0 t <= Ta'
print *,' f(t)=a*(sin(2*pi*(1.-(1.-(t-Ta)/(Te-Ta))**b))*'
print *,' exp(-(t-Ta)/Td))) Ta < t < Te'
print *,' f(t)=0 t >= Te'
print *,' '
print *,' b=log(0.5)/log(1.-(Tm-Ta)/(Te-Ta))'
print *,' '
print *,' The signal starts at Ta with value 0 has a single'
print *,' zero-crossing at Tm and terminates at Te with'
print *,' frequency 0Hz and value 0.'
print *,' '
print *,'7 damped asymmetric cosine pulse'
print *,' '
print *,' f(t)=a*(cos(1.5*pi*(1.-(1.-ti/te)**b))*'
print *,' exp(-t/Td))) t < Te'
print *,' f(t)=0 t >= Te'
print *,' '
print *,' b=log(2./3.)/log(1.-Tm/Te)'
print *,' '
print *,' The signal starts at time 0s with value a, has a'
print *,' single zero-crossing at Tm and terminates at Te'
print *,' with value 0 and frequency 0Hz.'
print *,' '
print *,SIGGEN_CVS_ID
stop
......@@ -213,7 +246,7 @@ c
if (ti.lt.ta) then
data(i)=0.
elseif(ti.le.te) then
data(i)=a*(-0.75*cos(pi*(ti-ta)/(te-ta))+
data(i)=a*(0.5-0.75*cos(pi*(ti-ta)/(te-ta))+
& 0.25*cos(pi*(ti-ta)/(te-ta))**3)
else
data(i)=a
......@@ -222,11 +255,55 @@ c
elseif (nsig.eq.3) then
if (verbose) then
print *,'first order derivative of Mueller-Bruestle function'
print *,'parameters:'
print 50,'amplitude','a',a,' '
print 50,'sampling interval','d',d,'s'
print 50,'time series lentgh','T',t,'s'
print 50,'onset of wavelet','Ta',ta,'s'
print 50,'end of wavelet','Te',te,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
endif
do i=1,nsamples
ti=d*(i-1)
if (ti.lt.ta) then
data(i)=0.
elseif(ti.le.te) then
data(i)=a*(3.*pi/(4.*(te-ta))*sin(pi*(ti-ta)/(te-ta))**3)
else
data(i)=0.
endif
enddo
elseif (nsig.eq.4) then
if (verbose) then
print *,'second order derivative of Mueller-Bruestle function'
print *,'parameters:'
print 50,'amplitude','a',a,' '
print 50,'sampling interval','d',d,'s'
print 50,'time series lentgh','T',t,'s'
print 50,'onset of wavelet','Ta',ta,'s'
print 50,'end of wavelet','Te',te,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
endif
do i=1,nsamples
ti=d*(i-1)
if (ti.lt.ta) then
data(i)=0.
elseif(ti.le.te) then
data(i)=a*(9*pi**2/(4.*(te-ta)**2)*
& sin(pi*(ti-ta)/(te-ta))**2*
& cos(pi*(ti-ta)/(te-ta)))
else
data(i)=0.
endif
enddo
elseif (nsig.eq.5) then
if (verbose) then
print *,'modulated and damped sine wave'
......@@ -258,7 +335,7 @@ c
data(i)=0.
elseif(ti.le.tend) then
data(i)=a*(sin(2*pi*(f1+b*(ti-ta))*(ti-ta))*
& exp(ti-Ta/Td))
& exp(-(ti-Ta)/Td))
else
data(i)=0.
endif
......@@ -298,6 +375,37 @@ c
data(i)=0.
endif
enddo
elseif (nsig.eq.7) then
if (verbose) then
print *,'asymmetric cosine pulse'
print *,'parameters:'
print 50,'amplitude','a',a,' '
print 50,'sampling interval','d',d,'s'
print 50,'time series lentgh','T',t,'s'
print 50,'zero of wavelet','Tm',tm,'s'
print 50,'end of wavelet','Te',te,'s'
print 50,'damping time constant','Td',td,'s'
endif
nsamples=int(t/d)
b=log(2./3.)/log(1.-Tm/te)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
print 53,'frequency modulation exponent',b,' '
print 53,'phase at tm',1.5*(1.-myexpo(dble(1.-tm/te),b)),'pi'
print 53,'phase at te',1.5*(1.-myexpo(dble(1.-te/te),b)),'pi'
print 53,'frequency at te',
& (b*3./(4.*te))*myexpo(dble(1.-te/te),(b-1.)),'Hz'
endif
do i=1,nsamples
ti=d*float(i-1)
if(ti.le.te) then
data(i)=a*(cos(1.5*pi*(1.-myexpo(dble(1.-ti/te),b)))*
& exp(-ti/Td))
else
data(i)=0.
endif
enddo
else
stop 'ERROR: unknown signal'
endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment