mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05:00 
			
		
		
		
	Better way of estimating noise level for S/N measurements.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2776 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									4f34b46084
								
							
						
					
					
						commit
						113f1770ff
					
				@ -16,7 +16,7 @@ subroutine decode9a(c0,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift,   &
 | 
			
		||||
  ndown=nsps8/nspsd
 | 
			
		||||
 | 
			
		||||
! Downsample to 16 samples/symbol
 | 
			
		||||
  call downsam9(c0,npts8,nsps8,nspsd,fpk,c2,nz2) 
 | 
			
		||||
  call downsam9(c0,npts8,nsps8,nspsd,fpk,c2,nz2)
 | 
			
		||||
 | 
			
		||||
  call peakdt9(c2,nz2,nsps8,nspsd,c3,nz3,xdt)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -6,6 +6,7 @@ subroutine downsam9(c0,npts8,nsps8,nspsd,fpk,c2,nz2)
 | 
			
		||||
  complex c0(0:npts8-1)
 | 
			
		||||
  complex c1(0:NMAX-1)
 | 
			
		||||
  complex c2(0:4096-1)
 | 
			
		||||
  real s(1000)
 | 
			
		||||
 | 
			
		||||
  fac=1.e-4
 | 
			
		||||
  c1(0:npts8-1)=fac*c0                     !Copy c0 into c1
 | 
			
		||||
@ -18,12 +19,22 @@ subroutine downsam9(c0,npts8,nsps8,nspsd,fpk,c2,nz2)
 | 
			
		||||
  df1=1500.0/nfft1
 | 
			
		||||
  call four2a(c1,nfft1,1,-1,1)             !Forward FFT
 | 
			
		||||
 | 
			
		||||
!  do i=0,nfft1-1
 | 
			
		||||
!     f=i*df1
 | 
			
		||||
!     pp=real(c1(i))**2 + aimag(c1(i))**2
 | 
			
		||||
!     write(50,3009) i,f,1.e-6*pp
 | 
			
		||||
!3009 format(i8,f12.3,f12.3)
 | 
			
		||||
!  enddo   
 | 
			
		||||
  ia=nint(250.0/df1)
 | 
			
		||||
  nadd=1.0/df1
 | 
			
		||||
  j=250/df1
 | 
			
		||||
  s=0.
 | 
			
		||||
  do i=1,1000
 | 
			
		||||
     do n=1,nadd
 | 
			
		||||
        j=j+1
 | 
			
		||||
        s(i)=s(i)+real(c1(j))**2 + aimag(c1(j))**2
 | 
			
		||||
     enddo
 | 
			
		||||
!     write(50,3000) i,(j-nadd/2)*df1,s(i)
 | 
			
		||||
!3000 format(i5,2f12.3)
 | 
			
		||||
  enddo
 | 
			
		||||
  call pctile(s,1000,40,avenoise)
 | 
			
		||||
!  write(71,*) avenoise,nadd
 | 
			
		||||
!  call flush(50)
 | 
			
		||||
!  call flush(71)
 | 
			
		||||
  
 | 
			
		||||
  ndown=nsps8/16                           !Downsample factor
 | 
			
		||||
  nfft2=nfft1/ndown                        !Backward FFT length
 | 
			
		||||
@ -31,10 +42,11 @@ subroutine downsam9(c0,npts8,nsps8,nspsd,fpk,c2,nz2)
 | 
			
		||||
   
 | 
			
		||||
  fshift=fpk-1500.0
 | 
			
		||||
  i0=nh1 + fshift/df1
 | 
			
		||||
  fac=1.0/avenoise
 | 
			
		||||
  do i=0,nfft2-1
 | 
			
		||||
     j=i0+i
 | 
			
		||||
     if(i.gt.nh2) j=j-nfft2
 | 
			
		||||
     c2(i)=c1(j)
 | 
			
		||||
     c2(i)=fac*c1(j)
 | 
			
		||||
  enddo
 | 
			
		||||
 | 
			
		||||
  call four2a(c2,nfft2,1,1,1)              !Backward FFT
 | 
			
		||||
 | 
			
		||||
@ -102,7 +102,8 @@ program jt9sim
 | 
			
		||||
 | 
			
		||||
        f=f0
 | 
			
		||||
        if(nsigs.gt.1) f=f0 - 0.5d0*fspan + fspan*(isig-1.d0)/(nsigs-1.d0)
 | 
			
		||||
        snrdbx=snrdb
 | 
			
		||||
        snrdbx=snrdb 
 | 
			
		||||
!        snrdbx=snrdb + (ifile-1)*4.0
 | 
			
		||||
        sig=10.0**(0.05*snrdbx)
 | 
			
		||||
        write(*,1020) ifile,isig,f,snrdbx,msgsent
 | 
			
		||||
1020    format(i3,i4,f10.3,f7.1,2x,a22)
 | 
			
		||||
@ -110,8 +111,9 @@ program jt9sim
 | 
			
		||||
        phi=0.
 | 
			
		||||
        baud=12000.d0/nsps
 | 
			
		||||
        k=12000                             !Start audio at t = 1.0 s
 | 
			
		||||
        f1=0.0001 * (ifile-1)
 | 
			
		||||
        print*,ifile-2,f1
 | 
			
		||||
!        f1=0.0001 * (ifile-1)
 | 
			
		||||
        f1=0.
 | 
			
		||||
!        print*,ifile-1,f1
 | 
			
		||||
        dphi2=0.
 | 
			
		||||
        ddphi2=twopi*f1*dt/60.0
 | 
			
		||||
        do isym=1,85
 | 
			
		||||
 | 
			
		||||
@ -49,9 +49,13 @@ subroutine symspec2(c5,nz3,nsps8,nspsd,fsample,snrdb,i1SoftSymbolsScrambled)
 | 
			
		||||
 | 
			
		||||
  sig=sig/69.
 | 
			
		||||
  df8=1500.0/nsps8
 | 
			
		||||
  t=max(1.0,sig/xmed - 1.0)
 | 
			
		||||
  snrdb=db(t) - db(2500.0/df8) - 4.5
 | 
			
		||||
!  print*,'A',ave,xmed,sig,t,df8,snrdb
 | 
			
		||||
!  t=max(1.0,sig/xmed - 1.0)
 | 
			
		||||
!  snrdb=db(t) - db(2500.0/df8) - 4.5
 | 
			
		||||
  t=max(1.0,sig - 1.0)
 | 
			
		||||
  snrdb=db(t) - 60.3
 | 
			
		||||
!  write(71,3001) ave,xmed,sig,db(sig),t,snrdb
 | 
			
		||||
!3001 format(6f12.2)
 | 
			
		||||
!  call flush(71)
 | 
			
		||||
     
 | 
			
		||||
  m0=3
 | 
			
		||||
  k=0
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
//-------------------------------------------------------------- MainWindow
 | 
			
		||||
//--------------------------------------------------------------- MainWindow
 | 
			
		||||
#include "mainwindow.h"
 | 
			
		||||
#include "ui_mainwindow.h"
 | 
			
		||||
#include "devsetup.h"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user