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

new option pi4shift

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: 5123
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent c7eefe4b
......@@ -56,7 +56,7 @@ c
parameter(luin=10, luout=11)
c
logical last, hilbert, realspec, imagspec, ampspec, phasespec
logical envelope
logical envelope, pi4shift
c
real tanf,dt
real c1,c2,c3,readversion
......@@ -75,16 +75,16 @@ c
c commandline
integer maxopt, lastarg, iargc
character*80 argument
parameter(maxopt=7)
parameter(maxopt=8)
character*2 optid(maxopt)
character*40 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c debugging
logical debug, verbose
c here are the keys to our commandline options
data optid/2h-d, 2h-v, 2h-H, 2h-R, 2h-I, 2h-A, 2h-P/
data opthasarg/7*.FALSE./
data optarg/7*1h-/
data optid/2h-d, 2h-v, 2h-H, 2h-R, 2h-I, 2h-A, 2h-P, '-4'/
data opthasarg/8*.FALSE./
data optarg/8*1h-/
c
c------------------------------------------------------------------------------
c basic information
......@@ -94,7 +94,7 @@ c
if (iargc().eq.1) call getarg(1, argument)
if ((argument(1:5).eq.'-help').or.(iargc().lt.2)) then
print *,version
print *,'Usage: evelo infile outfile [-H|-R|-I|-A|-P]'
print *,'Usage: evelo infile outfile [-H|-R|-I|-A|-P|-4]'
print *,' or: evelo -help'
if (argument(1:5).ne.'-help') stop 'ERROR: wrong number of arguments'
print *,' '
......@@ -106,6 +106,7 @@ c
print *,'-I calculate imaginary part of Fourier spectrum'
print *,'-A calculate Fourier amplitude spectrum'
print *,'-P calculate Fourier phase spectrum'
print *,'-4 phase shift by pi/4'
print *,' '
print *,'The switches are exclusive with priority in the order'
print *,'listed above.'
......@@ -133,6 +134,7 @@ c
imagspec=.false.
ampspec=.false.
phasespec=.false.
pi4shift=.false.
c
if (.not.(hilbert)) then
realspec=optset(4)
......@@ -142,7 +144,10 @@ c
ampspec=optset(6)
if (.not.(ampspec)) then
phasespec=optset(7)
if (.not.(phasespec)) envelope=.true.
if (.not.(phasespec)) then
pi4shift=optset(8)
if (.not.(pi4shift)) envelope=.true.
endif
endif
endif
endif
......@@ -165,6 +170,7 @@ c
comment='ERROR in algorithm selection code'
if (envelope) comment='calculate envelope'
if (hilbert) comment='calculate Hilbert transform'
if (pi4shift) comment='shift by pi/4'
if (realspec) comment='calculate real part of Fourier spectrum'
if (imagspec) comment='calculate imaginary part of Fourier spectrum'
if (ampspec) comment='calculate Fourier amplitude spectrum'
......@@ -216,6 +222,15 @@ c
do i=limit+2,nspa
ftarray(i)=(0.d0,-1.d0)*ftarray(i)
enddo
elseif (pi4shift) then
limit=nspa/2+1
do i=2,limit
ftarray(i)=sqrt(2.)*(1.d0,1.d0)*ftarray(i)
enddo
ftarray(limit)=(0.d0,0.d0)
do i=limit+2,nspa
ftarray(i)=sqrt(2.)*(0.d0,-1.d0)*ftarray(i)
enddo
elseif (envelope) then
limit=nspa/2+1
do i=limit+1,nspa
......@@ -223,10 +238,11 @@ c
enddo
endif
c
if ((envelope).or.(hilbert)) call tf_dfork(nspa, ftarray, 1.d0)
if ((envelope).or.(hilbert).or.(pi4shift))
& call tf_dfork(nspa, ftarray, 1.d0)
c
scalefact=dt*sqrt(float(nspa))
if (hilbert) then
if (hilbert.or.pi4shift) then
do i=1,nsamp
fdata(i)=real(ftarray(i))
enddo
......
Markdown is supported
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