| 
									
										
										
										
											2017-11-30 20:34:05 +00:00
										 |  |  | subroutine foxgen()
 | 
					
						
							| 
									
										
										
										
											2017-11-16 21:32:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-08 17:03:11 +00:00
										 |  |  |   ! Called from MainWindow::foxTxSequencer() to generate the Tx waveform in
 | 
					
						
							|  |  |  |   ! FT8 Fox mode.  The Tx message can contain up to 5 "slots", each carrying
 | 
					
						
							|  |  |  |   ! its own FT8 signal.
 | 
					
						
							|  |  |  |   
 | 
					
						
							|  |  |  |   ! Encoded messages can be of the form "HoundCall FoxCall rpt" (a standard FT8
 | 
					
						
							|  |  |  |   ! message with i3bit=0) or "HoundCall_1 RR73; HoundCall_2 <FoxCall> rpt", 
 | 
					
						
							|  |  |  |   ! a new message type with i3bit=1.  The waveform is generated with
 | 
					
						
							|  |  |  |   ! fsample=48000 Hz; it is compressed to reduce the PEP-to-average power ratio,
 | 
					
						
							|  |  |  |   ! with (currently disabled) filtering afterware to reduce spectral growth.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ! Input message information is provided in character array cmsg(5), in
 | 
					
						
							|  |  |  |   ! common/foxcom/.  The generated wave(NWAVE) is passed back in the same
 | 
					
						
							|  |  |  |   ! common block.
 | 
					
						
							|  |  |  |   
 | 
					
						
							| 
									
										
										
										
											2018-09-30 12:02:14 -05:00
										 |  |  |   parameter (NN=79,ND=58,NSPS=4*1920)
 | 
					
						
							| 
									
										
										
										
											2020-07-23 19:13:05 +01:00
										 |  |  |   parameter (NWAVE=(160+2)*134400*4) !the biggest waveform we generate (FST4-1800 at 48kHz)
 | 
					
						
							| 
									
										
										
										
											2020-07-17 23:44:14 +01:00
										 |  |  |   parameter (NFFT=614400,NH=NFFT/2)
 | 
					
						
							| 
									
										
										
										
											2017-12-21 20:55:38 +00:00
										 |  |  |   character*40 cmsg
 | 
					
						
							| 
									
										
										
										
											2018-09-13 12:39:08 -04:00
										 |  |  |   character*37 msg,msgsent
 | 
					
						
							| 
									
										
										
										
											2018-09-30 12:02:14 -05:00
										 |  |  |   integer itone(79)
 | 
					
						
							|  |  |  |   integer*1 msgbits(77),msgbits2
 | 
					
						
							| 
									
										
										
										
											2017-12-07 21:36:25 +00:00
										 |  |  |   integer*1, target:: mycall
 | 
					
						
							| 
									
										
										
										
											2017-12-12 17:59:09 +00:00
										 |  |  |   real x(NFFT)
 | 
					
						
							| 
									
										
										
										
											2017-11-16 21:32:07 +00:00
										 |  |  |   real*8 dt,twopi,f0,fstep,dfreq,phi,dphi
 | 
					
						
							| 
									
										
										
										
											2017-12-12 17:59:09 +00:00
										 |  |  |   complex cx(0:NH)
 | 
					
						
							| 
									
										
										
										
											2017-12-27 21:06:57 +00:00
										 |  |  |   common/foxcom/wave(NWAVE),nslots,nfreq,i3bit(5),cmsg(5),mycall(12)
 | 
					
						
							| 
									
										
										
										
											2018-09-30 12:02:14 -05:00
										 |  |  |   common/foxcom2/itone2(NN),msgbits2(77)
 | 
					
						
							| 
									
										
										
										
											2017-11-16 21:32:07 +00:00
										 |  |  |   equivalence (x,cx),(y,cy)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   fstep=60.d0
 | 
					
						
							|  |  |  |   dfreq=6.25d0
 | 
					
						
							|  |  |  |   dt=1.d0/48000.d0
 | 
					
						
							|  |  |  |   twopi=8.d0*atan(1.d0)
 | 
					
						
							| 
									
										
										
										
											2017-12-08 17:03:11 +00:00
										 |  |  |   irpt=0
 | 
					
						
							| 
									
										
										
										
											2017-12-12 17:59:09 +00:00
										 |  |  |   nplot=0
 | 
					
						
							|  |  |  |   wave=0.
 | 
					
						
							| 
									
										
										
										
											2017-11-16 21:32:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-27 20:22:44 +00:00
										 |  |  |   do n=1,nslots
 | 
					
						
							| 
									
										
										
										
											2018-09-30 12:02:14 -05:00
										 |  |  |      msg=cmsg(n)(1:37)
 | 
					
						
							| 
									
										
										
										
											2018-11-05 11:59:48 -05:00
										 |  |  |      call genft8(msg,i3,n3,msgsent,msgbits,itone)
 | 
					
						
							| 
									
										
										
										
											2017-12-08 17:03:11 +00:00
										 |  |  | ! Make copies of itone() and msgbits() for ft8sim
 | 
					
						
							|  |  |  |      itone2=itone
 | 
					
						
							|  |  |  |      msgbits2=msgbits
 | 
					
						
							| 
									
										
										
										
											2017-12-27 21:06:57 +00:00
										 |  |  |      f0=nfreq + fstep*(n-1)
 | 
					
						
							| 
									
										
										
										
											2017-11-16 21:32:07 +00:00
										 |  |  |      phi=0.d0
 | 
					
						
							|  |  |  |      k=0
 | 
					
						
							|  |  |  |      do j=1,NN
 | 
					
						
							|  |  |  |         f=f0 + dfreq*itone(j)
 | 
					
						
							|  |  |  |         dphi=twopi*f*dt
 | 
					
						
							|  |  |  |         do ii=1,NSPS
 | 
					
						
							|  |  |  |            k=k+1
 | 
					
						
							|  |  |  |            phi=phi+dphi
 | 
					
						
							|  |  |  |            xphi=phi
 | 
					
						
							|  |  |  |            wave(k)=wave(k)+sin(xphi)
 | 
					
						
							|  |  |  |         enddo
 | 
					
						
							|  |  |  |      enddo
 | 
					
						
							|  |  |  |   enddo
 | 
					
						
							| 
									
										
										
										
											2017-12-12 17:59:09 +00:00
										 |  |  |   kz=k
 | 
					
						
							| 
									
										
										
										
											2017-11-21 21:00:54 +00:00
										 |  |  |   
 | 
					
						
							| 
									
										
										
										
											2017-12-12 17:59:09 +00:00
										 |  |  |   peak1=maxval(abs(wave))
 | 
					
						
							|  |  |  |   wave=wave/peak1
 | 
					
						
							| 
									
										
										
										
											2017-12-12 20:15:36 +00:00
										 |  |  |   width=50.0
 | 
					
						
							| 
									
										
										
										
											2017-12-27 21:06:57 +00:00
										 |  |  |   call foxfilt(nslots,nfreq,width,wave)
 | 
					
						
							| 
									
										
										
										
											2017-12-12 17:59:09 +00:00
										 |  |  |   peak3=maxval(abs(wave))
 | 
					
						
							|  |  |  |   wave=wave/peak3
 | 
					
						
							|  |  |  |   
 | 
					
						
							| 
									
										
										
										
											2017-11-16 21:32:07 +00:00
										 |  |  |   return
 | 
					
						
							|  |  |  | end subroutine foxgen
 | 
					
						
							| 
									
										
										
										
											2017-12-12 17:59:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-13 17:18:34 +00:00
										 |  |  | ! include 'plotspec.f90'
 |