From 992d4b4b8d3f3a630a2cf00d593ee4ce4dfa7ce8 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Thu, 9 Jan 2025 22:12:06 +0100 Subject: New upstream version 2.7.0~rc8+repack --- lib/decode_msk144.f90 | 112 +++++++++++++++++++++++++------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) (limited to 'lib/decode_msk144.f90') diff --git a/lib/decode_msk144.f90 b/lib/decode_msk144.f90 index 4c8bd920..17110cf4 100755 --- a/lib/decode_msk144.f90 +++ b/lib/decode_msk144.f90 @@ -1,57 +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('', 2i4, i9) - end if - +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('', 2i4, i9) + end if + end subroutine decode_msk144 \ No newline at end of file -- cgit v1.2.3