More work on a simulator for dpsk with root-raised-cosine pulses.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8632 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke 2018-04-22 19:51:31 +00:00
parent 6445485399
commit bd0d414365
2 changed files with 11 additions and 15 deletions

View File

@ -14,7 +14,7 @@ subroutine genwsprdpsk(msg,msgsent,imessage)
logical first logical first
integer ipreamble(16) !Freq estimation preamble integer ipreamble(16) !Freq estimation preamble
integer isync(32) !Long sync vector integer isync(32) !Long sync vector
integer imessage(NN) integer imessage(NN)
data ipreamble/1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1/ data ipreamble/1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1/
data first/.true./ data first/.true./
data iuniqueword0/z'30C9E8AD'/ data iuniqueword0/z'30C9E8AD'/
@ -47,11 +47,13 @@ write(*,'(50i1,1x,14i1,1x,4i1)') msgbits
call encode204(msgbits,codeword) !Encode the test message call encode204(msgbits,codeword) !Encode the test message
! Message structure: imessage(1)=1 !reference bit
! d100 p16 d100 imessage(2:101)=codeword(1:100)
imessage(1:100)=codeword(1:100) imessage(102:132)=isync(1:31) !only use 31 of the sync bits
imessage(101:132)=isync
imessage(133:232)=codeword(101:200) imessage(133:232)=codeword(101:200)
do i=2,232
imessage(i)=mod(imessage(i-1)+imessage(i),2)
enddo
return return
end subroutine genwsprdpsk end subroutine genwsprdpsk

View File

@ -15,7 +15,6 @@ program wsprdpsksim
complex cwav(0:NMAX-1) complex cwav(0:NMAX-1)
real*8 fMHz real*8 fMHz
integer imessage(NN) integer imessage(NN)
integer idemess(NN) !Differentially encoded message
integer*2 iwave(NMAX) !Generated full-length waveform integer*2 iwave(NMAX) !Generated full-length waveform
! Get command-line argument(s) ! Get command-line argument(s)
@ -54,17 +53,12 @@ program wsprdpsksim
txt=NN*NSPS0/12000.0 txt=NN*NSPS0/12000.0
call genwsprdpsk(msg,msgsent,imessage) !Encode the message, get itone call genwsprdpsk(msg,msgsent,imessage) !Encode the message, get itone
imessage=2*imessage-1
write(*,1000) f0,xdt,txt,snrdb,fspread,delay,nfiles,msgsent write(*,1000) f0,xdt,txt,snrdb,fspread,delay,nfiles,msgsent
1000 format('f0:',f9.3,' DT:',f6.2,' txt:',f6.1,' SNR:',f6.1, & 1000 format('f0:',f9.3,' DT:',f6.2,' txt:',f6.1,' SNR:',f6.1, &
' fspread:',f6.1,' delay:',f6.1,' nfiles:',i3,2x,a22) ' fspread:',f6.1,' delay:',f6.1,' nfiles:',i3,2x,a22)
! Assume 0'th message bit is 0
imessage=2*imessage-1
idemess(1)=-1*imessage(1)
do i=2,NN
idemess(i)=imessage(i-1)*imessage(i)
enddo
beta=1.0 ! excess bandwidth beta=1.0 ! excess bandwidth
if(nwav.eq.0) then if(nwav.eq.0) then
df=fs/(NMAX/NDOWN) ! df=fs/(NMAX/NDOWN) !
@ -84,7 +78,7 @@ program wsprdpsksim
istart=xdt/dt istart=xdt/dt
c0=0.0 c0=0.0
do i=1,NN do i=1,NN
c0(istart+(i-1)*200)=idemess(i) c0(istart+(i-1)*200)=imessage(i)
enddo enddo
call four2a(c0,NMAX/NDOWN,1,1,1) call four2a(c0,NMAX/NDOWN,1,1,1)
c0=c0*conjg(c) c0=c0*conjg(c)
@ -141,7 +135,7 @@ write(*,*) 'sample SNR: ',10*log10(snrtest)+10*log10(0.4/2.5)
istart=xdt/dt istart=xdt/dt
c0wav=0.0 c0wav=0.0
do i=1,NN do i=1,NN
c0wav(istart+(i-1)*200*NDOWN)=idemess(i) c0wav(istart+(i-1)*200*NDOWN)=imessage(i)
enddo enddo
call four2a(c0wav,NMAX,1,1,1) call four2a(c0wav,NMAX,1,1,1)
c0wav=c0wav*conjg(cwav) c0wav=c0wav*conjg(cwav)