From fa2ff1b38ad8fbb177ae544eee9953d7d5bb0259 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 10 Jul 2012 13:44:17 +0000 Subject: [PATCH] Replacing db.f90 and analytic.f90. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/jtms3@2504 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- libm65/analytic.f90 | 24 ++++++++++++++++++++++++ libm65/db.f90 | 5 +++++ mainwindow.cpp | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 libm65/analytic.f90 create mode 100644 libm65/db.f90 diff --git a/libm65/analytic.f90 b/libm65/analytic.f90 new file mode 100644 index 000000000..1a84ca9e2 --- /dev/null +++ b/libm65/analytic.f90 @@ -0,0 +1,24 @@ +subroutine analytic(d,npts,nfft,s,c) + +! Convert real data to analytic signal + + real d(npts) + real s(npts) + complex c(npts) + + nh=nfft/2 + fac=2.0/nfft + c(1:npts)=fac*d(1:npts) + c(npts+1:nfft)=0. + call four2a(c,nfft,1,-1,1) !Forward c2c FFT + + do i=1,nh + s(i)=real(c(i))**2 + aimag(c(i))**2 + enddo + + c(1)=0.5*c(1) + c(nh+2:nfft)=0. + call four2a(c,nfft,1,1,1) !Inverse c2c FFT + + return +end subroutine analytic diff --git a/libm65/db.f90 b/libm65/db.f90 new file mode 100644 index 000000000..aa58f43f1 --- /dev/null +++ b/libm65/db.f90 @@ -0,0 +1,5 @@ +real function db(x) + db=-99.0 + if(x.gt.1.259e-10) db=10.0*log10(x) + return +end function db diff --git a/mainwindow.cpp b/mainwindow.cpp index 08534b213..7aa60d349 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,4 +1,4 @@ -//-------------------------------------------------------------- MainWindow +//------------------------------------------------------------- MainWindow #include "mainwindow.h" #include "ui_mainwindow.h" #include "devsetup.h"