1 c===========================================================================
3 c This file is part of TISEAN
5 c Copyright (c) 1998-2007 Rainer Hegger, Holger Kantz, Thomas Schreiber
7 c TISEAN is free software; you can redistribute it and/or modify
8 c it under the terms of the GNU General Public License as published by
9 c the Free Software Foundation; either version 2 of the License, or
10 c (at your option) any later version.
12 c TISEAN is distributed in the hope that it will be useful,
13 c but WITHOUT ANY WARRANTY; without even the implied warranty of
14 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 c GNU General Public License for more details.
17 c You should have received a copy of the GNU General Public License
18 c along with TISEAN; if not, write to the Free Software
19 c Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 c===========================================================================
22 c Wiener filter (1): write periodogram to file
23 c author T. Schreiber (1998)
24 c===========================================================================
27 character*72 file, fout
31 call whatido("Wiener filter (first part)",iverb)
37 isout=igetout(fout,iverb)
39 call nthstring(1,file)
40 if(file.eq."-") stop "wiener1: cannot read stdin"
41 call readfile(nmax,x,nexcl,jcol,file,iverb)
42 call normal(nmax,x,sc,sd)
44 if(nmaxp.ne.nmax) then
45 write(istderr(),*) "wiener1: padding zeroes to ", nmaxp
49 if(isout.eq.1) call addsuff(fout,file,"_amp")
50 call outfile(fout,iunit,iverb)
51 if(dh.eq.0.) dh=h/nmaxp
53 if(ibin.gt.0) write(istderr(),*)
54 . "wiener1: binning", 2*ibin+1," frequencies"
55 call store_spec(nmaxp,x,0)
56 write(iunit,*) 0., x(1)
57 do 20 i=2+ibin,(nmaxp+1)/2-ibin,2*ibin+1
59 do 30 ib=i-ibin,i+ibin
61 20 write(iunit,*) h*(i-1)/real(nmaxp), p
62 if(mod(nmaxp,2).eq.0) write(iunit,*)
63 . h*(nmaxp-1)/real(nmaxp), x(nmaxp)
64 if(iunit.ne.istdout()) write(istderr(),*)
65 . 'Now edit periodogram in file ', fout(1:index(fout," ")-1)
72 . "[-f# -w# -o outfile -l# -x# -c# -V# -h] file")
73 call ptext("then edit file_amp and run: "//
74 . "wiener2 [-f# -w# -o outfile -l# -x# -c# -V# -h] file")
75 call popt("f","sampling rate (e.g. in Hz, default 1.)")
76 call popt("w","frequency resolution (e.g. in Hz, default 1/N)")
77 call popt("l","number of values to be read (all)")
78 call popt("x","number of values to be skipped (0)")
79 call popt("c","column to be read (1 or file,#)")
82 call ptext("Note: ""-"" not accepted as file")