2017-10-30 17:35:44 -04:00
|
|
|
program jt65osdtest
|
|
|
|
!
|
2017-10-31 15:51:21 -04:00
|
|
|
! Demonstrate some procedures that can be used to implement an ordered-
|
|
|
|
! statistics decoder for JT65.
|
|
|
|
! 1. Test JT65 generator-matrix-based encoding by comparing codewords with
|
2017-10-30 17:35:44 -04:00
|
|
|
! those produced by the tried-and-true KA9Q encoder
|
2017-10-31 15:51:21 -04:00
|
|
|
! 2. Demonstrate how to reconfigure the generator matrix to make an arbitrary
|
|
|
|
! subset of 12 symbols the systematic symbols, and show that re-encoding using
|
|
|
|
! the subset of symbols regenerates the original codeword.
|
2017-10-30 17:35:44 -04:00
|
|
|
!
|
|
|
|
use jt65_generator_matrix
|
|
|
|
use gf64math
|
2017-10-31 15:51:21 -04:00
|
|
|
use packjt
|
2017-10-30 17:35:44 -04:00
|
|
|
|
2017-10-31 15:51:21 -04:00
|
|
|
character*22 message
|
2017-10-30 17:35:44 -04:00
|
|
|
integer m(12),cwka9q(63),cwk9an(63),cwtest(63)
|
|
|
|
integer gmrb(12,63)
|
2017-10-31 15:51:21 -04:00
|
|
|
data m/61,51,10,42,51,55, 3,29,53,55,58,42/ !"K9AN K1JT -25"
|
|
|
|
|
2017-11-02 17:21:29 -04:00
|
|
|
message="K1ABC W9XYZ EN37"
|
2017-10-31 15:51:21 -04:00
|
|
|
call packmsg(message,m,itype,.false.)
|
|
|
|
write(*,*) 'Message text: ',message
|
|
|
|
write(*,*) 'Message symbols:'
|
|
|
|
write(*,'(12i3)') m
|
|
|
|
|
|
|
|
! Encode using Karn encoder.
|
2017-10-30 17:35:44 -04:00
|
|
|
call rs_encode(m,cwka9q)
|
2017-10-31 15:51:21 -04:00
|
|
|
write(*,*) 'KA9Q codeword'
|
2017-10-30 17:35:44 -04:00
|
|
|
write(*,'(63i3)') cwka9q
|
2017-10-31 15:51:21 -04:00
|
|
|
! Encode using generator matrix.
|
2017-10-30 17:35:44 -04:00
|
|
|
call gf64_encode(g,m,cwk9an)
|
2017-10-31 15:51:21 -04:00
|
|
|
write(*,*) 'K9AN codeword'
|
2017-10-30 17:35:44 -04:00
|
|
|
write(*,'(63i3)') cwk9an
|
|
|
|
|
2017-10-31 15:51:21 -04:00
|
|
|
! The message symbols are the last 12 symbols of the codeword. For this test,
|
|
|
|
! "pretend" that the symbols at positions 1,3,5,7,9,11,13,15,17,19,21,23 are
|
|
|
|
! the best received symbols, i.e. the best symbols are all parity symbols.
|
|
|
|
! Reorder columns of the generator matrix so that the best symbols are in front
|
|
|
|
! and then use Gauss-Jordan elimination to create a generator matrix that
|
|
|
|
! can be used to re-encode the best 12 symbols, producing the same codeword
|
|
|
|
! that we started with.
|
2017-10-30 17:35:44 -04:00
|
|
|
gmrb=g
|
|
|
|
do i=1,12
|
2017-10-31 15:51:21 -04:00
|
|
|
gmrb(1:12,i)=g(1:12,2*i-1)
|
|
|
|
gmrb(1:12,i+12)=g(1:12,2*i)
|
2017-10-30 17:35:44 -04:00
|
|
|
enddo
|
|
|
|
|
2017-10-31 15:51:21 -04:00
|
|
|
call gf64_standardize_genmat(gmrb)
|
|
|
|
|
|
|
|
! Now demonstrate that we can use the revised generator matrix to encode the 12
|
|
|
|
! best symbols and recover the codeword that we started with.
|
|
|
|
m(1:12)=cwk9an(1:23:2) !Take symbols 1,3,5,...23 as the message
|
|
|
|
call gf64_encode(gmrb,m,cwtest) !reencode using the revised generator matrix
|
|
|
|
write(*,*) 'Re-encode using generator matrix reconfigured to use odd-index symbols starting at 1 as the message:'
|
2017-10-30 17:35:44 -04:00
|
|
|
write(*,'(12i3)') m
|
2017-10-31 15:51:21 -04:00
|
|
|
write(*,*) 'Re-encoded codeword should be the same as the original codeword:'
|
|
|
|
write(*,'(63i3)') cwtest !This should be the same as the original cw.
|
2017-10-30 17:35:44 -04:00
|
|
|
|
|
|
|
end program jt65osdtest
|