diff options
| author | Christoph Berg <christoph.berg@credativ.de> | 2022-08-23 10:23:16 +0200 |
|---|---|---|
| committer | Christoph Berg <christoph.berg@credativ.de> | 2022-08-23 10:23:16 +0200 |
| commit | 2d1068e60bce7ae1fff11623454900e8cee956b1 (patch) | |
| tree | acebe276e30466ef0ab91bc3da5e379bec0d7dc5 /lib/savec2.f90 | |
| parent | 43bebfbad6e7ba026bd3d55720c7d9e12a7ef8ef (diff) | |
New upstream version 2.6.0~rc3+repackupstream/2.6.0_rc3+repack
Diffstat (limited to 'lib/savec2.f90')
| -rwxr-xr-x | lib/savec2.f90 | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/lib/savec2.f90 b/lib/savec2.f90 index 6435a215..6be9c06f 100755 --- a/lib/savec2.f90 +++ b/lib/savec2.f90 @@ -1,55 +1,55 @@ -integer function savec2(c2name,ntrseconds,f0m1500) - -! Array c0() has complex samples at 1500 Hz sample rate. -! WSPR-2: downsample by 1/4 to produce c2, centered at 1500 Hz -! WSPR-15: downsample by 1/32 to produce c2, centered at 1612.5 Hz - - parameter (NDMAX=120*1500) !Sample intervals at 1500 Hz rate - parameter (MAXFFT=256*1024) - - character*(*) c2name - character*14 outfile - real*8 f0m1500 - complex c0 - complex c1(0:MAXFFT-1) - complex c2(0:65535) - common/c0com/c0(0:NDMAX-1) - - ntrminutes=ntrseconds/60 - npts=114*1500 - nfft1=262144 - if(ntrminutes.eq.15) then - npts=890*1500 - nfft1=MAXFFT - endif - df1=1500.0/nfft1 - fac=1.0/nfft1 - c1(0:npts-1)=fac*c0(0:npts-1) - c1(npts:nfft1-1)=0. - - call four2a(c1,nfft1,1,1,1) !Complex FFT to frequency domain - -! Select the desired frequency range - nfft2=65536 - nh2=nfft2/2 - if(ntrminutes.eq.2) then - c2(0:nh2)=c1(0:nh2) - c2(nh2+1:nfft2-1)=c1(nfft1-nh2+1:nfft1-1) - else - i0=nint(112.5/df1) - c2(0:nh2)=c1(i0:i0+nh2) - c2(nh2+1:nfft2-1)=c1(i0-nh2+1:i0-1) - endif - - call four2a(c2,nfft2,1,-1,1) !Shorter complex FFT, back to time domain - -! Write complex time-domain data to disk. - i1=index(c2name,'.c2') - outfile=c2name(i1-11:i1+2) - open(18,file=c2name,status='unknown',access='stream', iostat=ioerr) - if (ioerr.eq.0) then - write(18) outfile,ntrminutes,f0m1500,c2(0:45000-1) - close(18) - endif - savec2 = ioerr -end function savec2 +integer function savec2(c2name,ntrseconds,f0m1500)
+
+! Array c0() has complex samples at 1500 Hz sample rate.
+! WSPR-2: downsample by 1/4 to produce c2, centered at 1500 Hz
+! WSPR-15: downsample by 1/32 to produce c2, centered at 1612.5 Hz
+
+ parameter (NDMAX=120*1500) !Sample intervals at 1500 Hz rate
+ parameter (MAXFFT=256*1024)
+
+ character*(*) c2name
+ character*14 outfile
+ real*8 f0m1500
+ complex c0
+ complex c1(0:MAXFFT-1)
+ complex c2(0:65535)
+ common/c0com/c0(0:NDMAX-1)
+
+ ntrminutes=ntrseconds/60
+ npts=114*1500
+ nfft1=262144
+ if(ntrminutes.eq.15) then
+ npts=890*1500
+ nfft1=MAXFFT
+ endif
+ df1=1500.0/nfft1
+ fac=1.0/nfft1
+ c1(0:npts-1)=fac*c0(0:npts-1)
+ c1(npts:nfft1-1)=0.
+
+ call four2a(c1,nfft1,1,1,1) !Complex FFT to frequency domain
+
+! Select the desired frequency range
+ nfft2=65536
+ nh2=nfft2/2
+ if(ntrminutes.eq.2) then
+ c2(0:nh2)=c1(0:nh2)
+ c2(nh2+1:nfft2-1)=c1(nfft1-nh2+1:nfft1-1)
+ else
+ i0=nint(112.5/df1)
+ c2(0:nh2)=c1(i0:i0+nh2)
+ c2(nh2+1:nfft2-1)=c1(i0-nh2+1:i0-1)
+ endif
+
+ call four2a(c2,nfft2,1,-1,1) !Shorter complex FFT, back to time domain
+
+! Write complex time-domain data to disk.
+ i1=index(c2name,'.c2')
+ outfile=c2name(i1-11:i1+2)
+ open(18,file=c2name,status='unknown',access='stream', iostat=ioerr)
+ if (ioerr.eq.0) then
+ write(18) outfile,ntrminutes,f0m1500,c2(0:45000-1)
+ close(18)
+ endif
+ savec2 = ioerr
+end function savec2
|
