mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-03 02:15:17 -04:00
Enable decoding of MSK144 in jt9[.exe]. Thanks to Alex, VE3NEA!
This commit is contained in:
parent
0d46c8a66e
commit
53db514d42
@ -493,6 +493,7 @@ set (wsjt_FSRCS
|
|||||||
lib/msk144sim.f90
|
lib/msk144sim.f90
|
||||||
lib/mskrtd.f90
|
lib/mskrtd.f90
|
||||||
lib/nuttal_window.f90
|
lib/nuttal_window.f90
|
||||||
|
lib/decode_msk144.f90
|
||||||
lib/ft4/ft4sim.f90
|
lib/ft4/ft4sim.f90
|
||||||
lib/ft4/ft4sim_mult.f90
|
lib/ft4/ft4sim_mult.f90
|
||||||
lib/ft4/ft4_downsample.f90
|
lib/ft4/ft4_downsample.f90
|
||||||
|
57
lib/decode_msk144.f90
Normal file
57
lib/decode_msk144.f90
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
subroutine decode_msk144(audio_samples, params, data_dir)
|
||||||
|
include 'jt9com.f90'
|
||||||
|
|
||||||
|
! constants
|
||||||
|
integer, parameter :: SAMPLING_RATE = 12000
|
||||||
|
integer, parameter :: BLOCK_SIZE = 7168
|
||||||
|
integer, parameter :: STEP_SIZE = BLOCK_SIZE / 2
|
||||||
|
integer, parameter :: CALL_LENGTH = 12
|
||||||
|
|
||||||
|
! aguments
|
||||||
|
integer*2 audio_samples(NMAX)
|
||||||
|
type(params_block) :: params
|
||||||
|
character(len = 500) :: data_dir
|
||||||
|
|
||||||
|
! parameters of mskrtd
|
||||||
|
integer*2 :: buffer(BLOCK_SIZE)
|
||||||
|
real :: tsec
|
||||||
|
logical :: bshmsg = .false. ! enables shorthand messages
|
||||||
|
logical :: btrain = .false. ! turns on training in MSK144 mode
|
||||||
|
real*8 :: pcoeffs(5) = (/ 0.0, 0.0, 0.0, 0.0, 0.0 /); ! phase equalization
|
||||||
|
logical :: bswl = .false.
|
||||||
|
character(len = 80) :: line
|
||||||
|
character(len = CALL_LENGTH) :: mycall
|
||||||
|
character(len = CALL_LENGTH) :: hiscall
|
||||||
|
|
||||||
|
! local variables
|
||||||
|
integer :: sample_count
|
||||||
|
integer :: position
|
||||||
|
integer :: message_count = 0
|
||||||
|
|
||||||
|
|
||||||
|
! decode in 0.3s blocks
|
||||||
|
sample_count = params%ntr * SAMPLING_RATE
|
||||||
|
mycall = transfer(params%mycall, mycall) ! string to char[]
|
||||||
|
hiscall = transfer(params%hiscall, hiscall)
|
||||||
|
|
||||||
|
do position = 1, sample_count - BLOCK_SIZE + 1, STEP_SIZE
|
||||||
|
buffer = audio_samples(position : position + BLOCK_SIZE - 1)
|
||||||
|
tsec = position / REAL(SAMPLING_RATE)
|
||||||
|
|
||||||
|
call mskrtd(buffer, params%nutc, tsec, params%ntol, params%nfqso, params%ndepth, &
|
||||||
|
mycall, hiscall, bshmsg, btrain, pcoeffs, bswl, data_dir, line)
|
||||||
|
|
||||||
|
if (line(1:1) .ne. char(0)) then
|
||||||
|
line = line(1:index(line, char(0))-1)
|
||||||
|
write(*, 1001) line
|
||||||
|
1001 format(a80)
|
||||||
|
message_count = message_count + 1;
|
||||||
|
end if
|
||||||
|
end do
|
||||||
|
|
||||||
|
if (.not. params%ndiskdat) then
|
||||||
|
write(*, 1002) 0, message_count, 0
|
||||||
|
1002 format('<DecodeFinished>', 2i4, i9)
|
||||||
|
end if
|
||||||
|
|
||||||
|
end subroutine decode_msk144
|
14
lib/jt9.f90
14
lib/jt9.f90
@ -27,7 +27,7 @@ program jt9
|
|||||||
logical :: read_files = .true., tx9 = .false., display_help = .false., &
|
logical :: read_files = .true., tx9 = .false., display_help = .false., &
|
||||||
bLowSidelobes = .false., nexp_decode_set = .false., &
|
bLowSidelobes = .false., nexp_decode_set = .false., &
|
||||||
have_ntol = .false.
|
have_ntol = .false.
|
||||||
type (option) :: long_options(32) = [ &
|
type (option) :: long_options(33) = [ &
|
||||||
option ('help', .false., 'h', 'Display this help message', ''), &
|
option ('help', .false., 'h', 'Display this help message', ''), &
|
||||||
option ('shmem',.true.,'s','Use shared memory for sample data','KEY'), &
|
option ('shmem',.true.,'s','Use shared memory for sample data','KEY'), &
|
||||||
option ('tr-period', .true., 'p', 'Tx/Rx period, default SECONDS=60', &
|
option ('tr-period', .true., 'p', 'Tx/Rx period, default SECONDS=60', &
|
||||||
@ -64,6 +64,7 @@ program jt9
|
|||||||
option ('ft8', .false., '8', 'FT8 mode', ''), &
|
option ('ft8', .false., '8', 'FT8 mode', ''), &
|
||||||
option ('jt9', .false., '9', 'JT9 mode', ''), &
|
option ('jt9', .false., '9', 'JT9 mode', ''), &
|
||||||
option ('qra64', .false., 'q', 'QRA64 mode', ''), &
|
option ('qra64', .false., 'q', 'QRA64 mode', ''), &
|
||||||
|
option ('msk144', .false., 'k', 'MSK144 mode', ''), &
|
||||||
option ('QSOprog', .true., 'Q', 'QSO progress (0-5), default PROGRESS=1',&
|
option ('QSOprog', .true., 'Q', 'QSO progress (0-5), default PROGRESS=1',&
|
||||||
'QSOprogress'), &
|
'QSOprogress'), &
|
||||||
option ('sub-mode', .true., 'b', 'Sub mode, default SUBMODE=A', 'A'), &
|
option ('sub-mode', .true., 'b', 'Sub mode, default SUBMODE=A', 'A'), &
|
||||||
@ -91,7 +92,7 @@ program jt9
|
|||||||
TRperiod=60.d0
|
TRperiod=60.d0
|
||||||
|
|
||||||
do
|
do
|
||||||
call getopt('hs:e:a:b:r:m:p:d:f:F:w:t:9876543WYqTL:S:H:c:G:x:g:X:Q:', &
|
call getopt('hs:e:a:b:r:m:p:d:f:F:w:t:9876543WYqkTL:S:H:c:G:x:g:X:Q:', &
|
||||||
long_options,c,optarg,arglen,stat,offset,remain,.true.)
|
long_options,c,optarg,arglen,stat,offset,remain,.true.)
|
||||||
if (stat .ne. 0) then
|
if (stat .ne. 0) then
|
||||||
exit
|
exit
|
||||||
@ -129,7 +130,9 @@ program jt9
|
|||||||
read (optarg(:arglen), *) fhigh
|
read (optarg(:arglen), *) fhigh
|
||||||
case ('q')
|
case ('q')
|
||||||
mode = 164
|
mode = 164
|
||||||
case ('Q')
|
case ('k')
|
||||||
|
mode = 144
|
||||||
|
case ('Q')
|
||||||
read (optarg(:arglen), *) nQSOProg
|
read (optarg(:arglen), *) nQSOProg
|
||||||
case ('3')
|
case ('3')
|
||||||
mode = 66
|
mode = 66
|
||||||
@ -352,7 +355,12 @@ program jt9
|
|||||||
call multimode_decoder(shared_data%ss,id2a, &
|
call multimode_decoder(shared_data%ss,id2a, &
|
||||||
shared_data%params,nfsample)
|
shared_data%params,nfsample)
|
||||||
cycle
|
cycle
|
||||||
|
|
||||||
|
! MSK144
|
||||||
|
else if (mode .eq. 144) then
|
||||||
|
call decode_msk144(shared_data%id2, shared_data%params, data_dir)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
! Normal decoding pass
|
! Normal decoding pass
|
||||||
call multimode_decoder(shared_data%ss,shared_data%id2, &
|
call multimode_decoder(shared_data%ss,shared_data%id2, &
|
||||||
shared_data%params,nfsample)
|
shared_data%params,nfsample)
|
||||||
|
11
lib/jt9a.f90
11
lib/jt9a.f90
@ -70,8 +70,15 @@ subroutine jt9a()
|
|||||||
call multimode_decoder(shared_data%ss,id2a,local_params,12000)
|
call multimode_decoder(shared_data%ss,id2a,local_params,12000)
|
||||||
local_params%nzhsym=50
|
local_params%nzhsym=50
|
||||||
endif
|
endif
|
||||||
! Normal decoding pass
|
|
||||||
call multimode_decoder(shared_data%ss,shared_data%id2,local_params,12000)
|
if(local_params%nmode .eq. 144) then
|
||||||
|
! MSK144
|
||||||
|
call decode_msk144(shared_data%id2, shared_data%params, data_dir)
|
||||||
|
else
|
||||||
|
! Normal decoding pass
|
||||||
|
call multimode_decoder(shared_data%ss,shared_data%id2,local_params,12000)
|
||||||
|
endif
|
||||||
|
|
||||||
call timer('decoder ',1)
|
call timer('decoder ',1)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user