mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 21:40:52 -05:00 
			
		
		
		
	Move the sweep generator into a separate routine.
This commit is contained in:
		
							parent
							
								
									d44d00453f
								
							
						
					
					
						commit
						254a15b4f6
					
				@ -3,24 +3,35 @@ subroutine sfox_clo(fsample,syncwidth,clo)
 | 
				
			|||||||
! Generate complex LO for the SuperFox sync signal
 | 
					! Generate complex LO for the SuperFox sync signal
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  use sfox_mod
 | 
					  use sfox_mod
 | 
				
			||||||
  complex clo(NMAX)                      !Complex Local Oscillator
 | 
					  complex clo(NSYNC)                      !Complex Local Oscillator
 | 
				
			||||||
 | 
					  complex w
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  w=1.0
 | 
				
			||||||
 | 
					  call sweep(1500.0,syncwidth,fsample,w,clo,nsync)
 | 
				
			||||||
 | 
					  clo=conjg(clo)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return
 | 
				
			||||||
 | 
					end subroutine sfox_clo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					subroutine sweep(f0,syncwidth,fsample,w,c,iz)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  complex c(iz)
 | 
				
			||||||
  complex w,wstep
 | 
					  complex w,wstep
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  twopi=8.0*atan(1.0)
 | 
					  twopi=8.0*atan(1.0)
 | 
				
			||||||
  tsync=NS*NSPS/fsample
 | 
					  ttot=iz/fsample
 | 
				
			||||||
  w=1.0
 | 
					  a0=f0 + syncwidth/2.0             !Frequency at midpoint of LO waveform
 | 
				
			||||||
  a0=1500.0+ syncwidth/2.0          !Frequency at midpoint of LO waveform
 | 
					  a2=2.0*syncwidth/ttot             !Frequency drift rate
 | 
				
			||||||
  a2=2.0*syncwidth/tsync            !Frequency drift rate
 | 
					  x0=0.5*(iz+1)
 | 
				
			||||||
  x0=0.5*(nsync+1)
 | 
					  s=2.0/iz
 | 
				
			||||||
  s=2.0/nsync
 | 
					  do i=1,iz
 | 
				
			||||||
  do i=1,nsync
 | 
					     if(i.eq.iz/2+1) a2=-a2         !Reverse sign of drift at midpoint
 | 
				
			||||||
     if(i.eq.nsync/2+1) a2=-a2       !Reverse sign of drift at midpoint
 | 
					 | 
				
			||||||
     x=s*(i-x0)
 | 
					     x=s*(i-x0)
 | 
				
			||||||
     dphi=(a0 + x*a2)*(twopi/fsample)
 | 
					     dphi=(a0 + x*a2)*(twopi/fsample)
 | 
				
			||||||
     wstep=cmplx(cos(dphi),sin(dphi))
 | 
					     wstep=cmplx(cos(dphi),sin(dphi))
 | 
				
			||||||
     w=w*wstep
 | 
					     w=w*wstep
 | 
				
			||||||
     clo(i)=conjg(w)
 | 
					     c(i)=w
 | 
				
			||||||
  enddo
 | 
					  enddo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return
 | 
					  return
 | 
				
			||||||
end subroutine sfox_clo
 | 
					end subroutine sweep
 | 
				
			||||||
 | 
				
			|||||||
@ -215,7 +215,6 @@ program sfoxtest
 | 
				
			|||||||
        ntot=ntot+nharderr
 | 
					        ntot=ntot+nharderr
 | 
				
			||||||
        nworst=max(nworst,nharderr)
 | 
					        nworst=max(nworst,nharderr)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
!        call rs_decode_sf(rxdat,iera,nera,nfixed)    !Call the BM decoder
 | 
					 | 
				
			||||||
        ntrials=1000
 | 
					        ntrials=1000
 | 
				
			||||||
        call timer('ftrsd3  ',0)
 | 
					        call timer('ftrsd3  ',0)
 | 
				
			||||||
        call ftrsd3(s3,chansym0,rxdat,rxprob,rxdat2,rxprob2,ntrials,  &
 | 
					        call ftrsd3(s3,chansym0,rxdat,rxprob,rxdat2,rxprob2,ntrials,  &
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user