mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05:00 
			
		
		
		
	FST4/W: Disable envelope shaping at start and end of transmission when environment variable FST4_NOSHAPING=1. Works for fst4sim too.
This commit is contained in:
		
							parent
							
								
									afee4d9a28
								
							
						
					
					
						commit
						86b0affc56
					
				@ -120,7 +120,7 @@ program fst4sim
 | 
			
		||||
      if(fspread.gt.0.0 .or. delay.ne.0.0) call watterson(c,nwave,NZ,fs,delay,fspread)
 | 
			
		||||
      if(fspread.lt.0.0) call lorentzian_fading(c,nwave,fs,-fspread)
 | 
			
		||||
      c=sig*c
 | 
			
		||||
      wave=real(c)
 | 
			
		||||
      wave=aimag(c)
 | 
			
		||||
      if(snrdb.lt.90) then
 | 
			
		||||
         do i=1,nmax                   !Add gaussian noise at specified SNR
 | 
			
		||||
            xnoise=gran()
 | 
			
		||||
 | 
			
		||||
@ -1,17 +1,20 @@
 | 
			
		||||
subroutine gen_fst4wave(itone,nsym,nsps,nwave,fsample,hmod,f0,    &
 | 
			
		||||
   icmplx,cwave,wave)
 | 
			
		||||
 | 
			
		||||
   use prog_args
 | 
			
		||||
   parameter(NTAB=65536)
 | 
			
		||||
   real wave(nwave)
 | 
			
		||||
   complex cwave(nwave),ctab(0:NTAB-1)
 | 
			
		||||
   character(len=1) :: cvalue 
 | 
			
		||||
   real, allocatable, save :: pulse(:)
 | 
			
		||||
   real, allocatable :: dphi(:)
 | 
			
		||||
   integer hmod
 | 
			
		||||
   integer itone(nsym)
 | 
			
		||||
  logical first
 | 
			
		||||
   logical first, lshape
 | 
			
		||||
   data first/.true./
 | 
			
		||||
   data nsps0/-99/
 | 
			
		||||
  save first,twopi,dt,tsym,nsps0,ctab
 | 
			
		||||
   data lshape/.true./
 | 
			
		||||
   save first,twopi,dt,tsym,nsps0,ctab,lshape
 | 
			
		||||
 | 
			
		||||
   if(first) then
 | 
			
		||||
      twopi=8.0*atan(1.0)
 | 
			
		||||
@ -19,6 +22,8 @@ subroutine gen_fst4wave(itone,nsym,nsps,nwave,fsample,hmod,f0,    &
 | 
			
		||||
         phi=i*twopi/NTAB
 | 
			
		||||
         ctab(i)=cmplx(cos(phi),sin(phi))
 | 
			
		||||
      enddo
 | 
			
		||||
      call get_environment_variable("FST4_NOSHAPING",cvalue,nlen)
 | 
			
		||||
      if(nlen.eq.1 .and. cvalue.eq."1") lshape=.false.
 | 
			
		||||
   endif
 | 
			
		||||
 | 
			
		||||
   if(first.or.nsps.ne.nsps0) then
 | 
			
		||||
@ -52,12 +57,12 @@ subroutine gen_fst4wave(itone,nsym,nsps,nwave,fsample,hmod,f0,    &
 | 
			
		||||
   if(icmplx.eq.0) wave=0.
 | 
			
		||||
   if(icmplx.eq.1) cwave=0.
 | 
			
		||||
   k=0
 | 
			
		||||
  do j=0,(nsym+2)*nsps-1
 | 
			
		||||
   do j=nsps,(nsym+1)*nsps-1
 | 
			
		||||
      k=k+1
 | 
			
		||||
      i=phi*float(NTAB)/twopi
 | 
			
		||||
      i=iand(i,NTAB-1)
 | 
			
		||||
      if(icmplx.eq.0) then
 | 
			
		||||
        wave(k)=real(ctab(i))
 | 
			
		||||
         wave(k)=aimag(ctab(i))
 | 
			
		||||
      else
 | 
			
		||||
         cwave(k)=ctab(i)
 | 
			
		||||
      endif
 | 
			
		||||
@ -66,25 +71,22 @@ subroutine gen_fst4wave(itone,nsym,nsps,nwave,fsample,hmod,f0,    &
 | 
			
		||||
   enddo
 | 
			
		||||
 | 
			
		||||
! Compute the ramp-up and ramp-down symbols
 | 
			
		||||
  kshift=nsps
 | 
			
		||||
   if(icmplx.eq.0) then
 | 
			
		||||
     wave(1:nsps)=0.0
 | 
			
		||||
     wave(nsps+1:nsps+nsps/4)=wave(nsps+1:nsps+nsps/4) *                      &
 | 
			
		||||
      if(lshape) then
 | 
			
		||||
         wave(1:nsps/4)=wave(1:nsps/4) *                      &
 | 
			
		||||
            (1.0-cos(twopi*(/(i,i=0,nsps/4-1)/)/real(nsps/2)))/2.0
 | 
			
		||||
     k1=nsym*nsps+3*nsps/4+1
 | 
			
		||||
     wave((nsym+1)*nsps+1:)=0.0 
 | 
			
		||||
         k1=(nsym-1)*nsps+3*nsps/4+1
 | 
			
		||||
         wave(k1:k1+nsps/4)=wave(k1:k1+nsps/4) *                              &
 | 
			
		||||
            (1.0+cos(twopi*(/(i,i=0,nsps/4)/)/real(nsps/2)))/2.0
 | 
			
		||||
     wave=cshift(wave,kshift)
 | 
			
		||||
      endif
 | 
			
		||||
   else
 | 
			
		||||
     cwave(1:nsps)=0.0
 | 
			
		||||
     cwave(nsps+1:nsps+nsps/4)=cwave(nsps+1:nsps+nsps/4) *                    &
 | 
			
		||||
      if(lshape) then
 | 
			
		||||
         cwave(1:nsps/4)=cwave(1:nsps/4) *                    &
 | 
			
		||||
            (1.0-cos(twopi*(/(i,i=0,nsps/4-1)/)/real(nsps/2)))/2.0
 | 
			
		||||
     k1=nsym*nsps+3*nsps/4+1
 | 
			
		||||
     cwave((nsym+1)*nsps+1:)=0.0
 | 
			
		||||
         k1=(nsym-1)*nsps+3*nsps/4+1
 | 
			
		||||
         cwave(k1:k1+nsps/4)=cwave(k1:k1+nsps/4) *                              &
 | 
			
		||||
            (1.0+cos(twopi*(/(i,i=0,nsps/4)/)/real(nsps/2)))/2.0
 | 
			
		||||
     cwave=cshift(cwave,kshift)
 | 
			
		||||
      endif
 | 
			
		||||
   endif
 | 
			
		||||
 | 
			
		||||
   return
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user