summaryrefslogtreecommitdiff
path: root/map65/libm65/iqcal.f90
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2025-01-09 22:12:06 +0100
committerChristoph Berg <myon@debian.org>2025-01-09 22:12:06 +0100
commit992d4b4b8d3f3a630a2cf00d593ee4ce4dfa7ce8 (patch)
treefbfdfe6bcb0a8a114be2480dac53d88c977e4869 /map65/libm65/iqcal.f90
parent4320ce238aae1fe87fc9f379cdd816e9317885fa (diff)
New upstream version 2.7.0~rc8+repackupstream/2.7.0_rc8+repack
Diffstat (limited to 'map65/libm65/iqcal.f90')
-rwxr-xr-xmap65/libm65/iqcal.f9060
1 files changed, 30 insertions, 30 deletions
diff --git a/map65/libm65/iqcal.f90 b/map65/libm65/iqcal.f90
index c7ee7fd9..c0c4fce2 100755
--- a/map65/libm65/iqcal.f90
+++ b/map65/libm65/iqcal.f90
@@ -1,30 +1,30 @@
-subroutine iqcal(nn,c,nfft,gain,phase,zsum,ipk,reject)
-
- complex c(0:nfft-1)
- complex z,zsum,zave
-
- if(nn.eq.0) then
- zsum=0.
- endif
- nn=nn+1
- smax=0.
- ipk=1
- do i=1,nfft-1 !Find strongest signal
- s=real(c(i))**2 + aimag(c(i))**2
- if(s.gt.smax) then
- smax=s
- ipk=i
- endif
- enddo
- pimage=real(c(nfft-ipk))**2 + aimag(c(nfft-ipk))**2
- p=smax + pimage
- z=c(ipk)*c(nfft-ipk)/p !Synchronous detection of image
- zsum=zsum+z
- zave=zsum/nn
- tmp=sqrt(1.0 - (2.0*real(zave))**2)
- phase=asin(2.0*aimag(zave)/tmp) !Estimate phase
- gain=tmp/(1.0-2.0*real(zave)) !Estimate gain
- reject=10.0*log10(pimage/smax)
-
- return
-end subroutine iqcal
+subroutine iqcal(nn,c,nfft,gain,phase,zsum,ipk,reject)
+
+ complex c(0:nfft-1)
+ complex z,zsum,zave
+
+ if(nn.eq.0) then
+ zsum=0.
+ endif
+ nn=nn+1
+ smax=0.
+ ipk=1
+ do i=1,nfft-1 !Find strongest signal
+ s=real(c(i))**2 + aimag(c(i))**2
+ if(s.gt.smax) then
+ smax=s
+ ipk=i
+ endif
+ enddo
+ pimage=real(c(nfft-ipk))**2 + aimag(c(nfft-ipk))**2
+ p=smax + pimage
+ z=c(ipk)*c(nfft-ipk)/p !Synchronous detection of image
+ zsum=zsum+z
+ zave=zsum/nn
+ tmp=sqrt(1.0 - (2.0*real(zave))**2)
+ phase=asin(2.0*aimag(zave)/tmp) !Estimate phase
+ gain=tmp/(1.0-2.0*real(zave)) !Estimate gain
+ reject=10.0*log10(pimage/smax)
+
+ return
+end subroutine iqcal