File: genwave.f90

package info (click to toggle)
wsjtx 2.6.1%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 69,664 kB
  • sloc: cpp: 86,977; f90: 42,417; python: 27,241; ansic: 12,510; fortran: 2,382; makefile: 197; sh: 134
file content (52 lines) | stat: -rwxr-xr-x 1,168 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
subroutine genwave(itone,nsym,nsps,nwave,fsample,hmod,f0,icmplx,cwave,wave)

  real wave(nwave)
  complex cwave(nwave)
  integer hmod
  integer itone(nsym)
  logical ex
  real*8 dt,phi,dphi,twopi,freq,baud

  dt=1.d0/fsample
  twopi=8.d0*atan(1.d0)
  baud=fsample/nsps

! Calculate the audio waveform
  phi=0.d0
  if(icmplx.le.0) wave=0.
  if(icmplx.eq.1) cwave=0.
  k=0
  do j=1,nsym
     freq=f0 + itone(j)*hmod*baud
     dphi=twopi*freq*dt
     do i=1,nsps
        k=k+1
        if(icmplx.eq.1) then
           cwave(k)=cmplx(cos(phi),sin(phi))
        else
           wave(k)=sin(phi)
        endif
        phi=phi+dphi
        if(phi.gt.twopi) phi=phi-twopi
     enddo
  enddo

!### TEMPORARY code to allow transmitting both A and B submodes
  inquire(file='Q65_Tx2',exist=ex)
  if(ex) then
     k=0
     do j=1,nsym
        freq=f0 + itone(j)*2.d0*hmod*baud + 500.d0
        dphi=twopi*freq*dt
        do i=1,nsps
           k=k+1
           wave(k)=0.5*(wave(k)+sin(phi))
           phi=phi+dphi
           if(phi.gt.twopi) phi=phi-twopi
        enddo
     enddo
  endif
!###

  return
end subroutine genwave