diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-16 12:37:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-16 12:57:29 +0200 |
| commit | 5a4967c577ad245a2117b7b2f71c13b1212fe285 (patch) | |
| tree | 4d09343cfe757239895a0dd9b399242d2a07d7c2 /lib/ftrsd/ftrsd_paper/bodide.f90 | |
| parent | 23c903a09fb1d73fd20b50323cd80cfb3aba8799 (diff) | |
Merge 2.7 changes, I had uploaded -1 from the wrong branch.debian/3.0.0_rc1+repack-2
Diffstat (limited to 'lib/ftrsd/ftrsd_paper/bodide.f90')
| -rwxr-xr-x | lib/ftrsd/ftrsd_paper/bodide.f90 | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/lib/ftrsd/ftrsd_paper/bodide.f90 b/lib/ftrsd/ftrsd_paper/bodide.f90 index 72e0f137..248cb890 100755 --- a/lib/ftrsd/ftrsd_paper/bodide.f90 +++ b/lib/ftrsd/ftrsd_paper/bodide.f90 @@ -1,54 +1,54 @@ -program bodide -! Compute probability of word error for a bounded distance decoder. -! Hardwired for non-coherent 64-FSK and the JT65 RS (63,12) code on GF(64). -! -! Let ps be symbol error probability. -! The probability of getting an error pattern with e symbol errors is: -! ps^e * (1-ps)*(n-e) -! The number of error patterns with e errors is binomial(63,e) -! Overall probability of getting a word with e errors is: -! P(e)= binomial(63,e)* ps^e * (1-ps)*(n-e) -! Probability that word is correct is P(0 to 25 errors) = sum{e=0}^{25} P(e) -! Probability that word is wrong is 1-P(0 to 25 errors) -! P_word_error=1-( sum_{e=0}^{t} P(e) ) -! - implicit real*16 (a-h,o-z) - - integer*8 binomial - integer x,s,XX,NN,M - character arg*8 - - nargs=iargc() - if(nargs.ne.1) then - print*,'Probability of word error for noncoherent 64-FSK with bounded distance decoding' - print*,'Usage: bounded_distance D' - print*,'Example: bounded_distance 25' - go to 999 - endif - call getarg(1,arg) - read(arg,*) nt - M=64 - write(*,1012) -1012 format('Es/No P(word error)'/ & - '----------------------') - do isnr=0,40 - esno=10**(isnr/2.0/10.0) - hsum=0.d0 - do k=1,M-1 - h=binomial(M-1,k) - h=h*((-1)**(k+1))/(k+1) - h=h*exp(-esno*k/(k+1)) - hsum=hsum + h - enddo - ps=hsum - hsum=0.d0 - do i=0,nt - h=binomial(63,i) - h=h*ps**i - h=h*(1-ps)**(63-i) - hsum=hsum+h - enddo - pw=1-hsum - write(*,'(f4.1,4x,e10.4,4x,e10.4)') isnr/2.0, ps, pw - enddo -999 end program bodide +program bodide
+! Compute probability of word error for a bounded distance decoder.
+! Hardwired for non-coherent 64-FSK and the JT65 RS (63,12) code on GF(64).
+!
+! Let ps be symbol error probability.
+! The probability of getting an error pattern with e symbol errors is:
+! ps^e * (1-ps)*(n-e)
+! The number of error patterns with e errors is binomial(63,e)
+! Overall probability of getting a word with e errors is:
+! P(e)= binomial(63,e)* ps^e * (1-ps)*(n-e)
+! Probability that word is correct is P(0 to 25 errors) = sum{e=0}^{25} P(e)
+! Probability that word is wrong is 1-P(0 to 25 errors)
+! P_word_error=1-( sum_{e=0}^{t} P(e) )
+!
+ implicit real*16 (a-h,o-z)
+
+ integer*8 binomial
+ integer x,s,XX,NN,M
+ character arg*8
+
+ nargs=iargc()
+ if(nargs.ne.1) then
+ print*,'Probability of word error for noncoherent 64-FSK with bounded distance decoding'
+ print*,'Usage: bounded_distance D'
+ print*,'Example: bounded_distance 25'
+ go to 999
+ endif
+ call getarg(1,arg)
+ read(arg,*) nt
+ M=64
+ write(*,1012)
+1012 format('Es/No P(word error)'/ &
+ '----------------------')
+ do isnr=0,40
+ esno=10**(isnr/2.0/10.0)
+ hsum=0.d0
+ do k=1,M-1
+ h=binomial(M-1,k)
+ h=h*((-1)**(k+1))/(k+1)
+ h=h*exp(-esno*k/(k+1))
+ hsum=hsum + h
+ enddo
+ ps=hsum
+ hsum=0.d0
+ do i=0,nt
+ h=binomial(63,i)
+ h=h*ps**i
+ h=h*(1-ps)**(63-i)
+ hsum=hsum+h
+ enddo
+ pw=1-hsum
+ write(*,'(f4.1,4x,e10.4,4x,e10.4)') isnr/2.0, ps, pw
+ enddo
+999 end program bodide
|
