diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-16 12:37:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-16 12:57:29 +0200 |
| commit | 5a4967c577ad245a2117b7b2f71c13b1212fe285 (patch) | |
| tree | 4d09343cfe757239895a0dd9b399242d2a07d7c2 /map65/libm65/iqcal.f90 | |
| parent | 23c903a09fb1d73fd20b50323cd80cfb3aba8799 (diff) | |
Merge 2.7 changes, I had uploaded -1 from the wrong branch.debian/3.0.0_rc1+repack-2
Diffstat (limited to 'map65/libm65/iqcal.f90')
| -rwxr-xr-x | map65/libm65/iqcal.f90 | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/map65/libm65/iqcal.f90 b/map65/libm65/iqcal.f90 index c0c4fce2..c7ee7fd9 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
|
