diff options
| author | Christoph Berg <myon@debian.org> | 2026-04-07 19:02:45 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-04-07 19:02:45 +0200 |
| commit | f647d78463c1250ce9c99af664615fafccf5e959 (patch) | |
| tree | 5b00428cef68aef1c9d407e2d4535687422419b6 /lib/fst4/lorentzian_fading.f90 | |
| parent | 0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff) | |
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'lib/fst4/lorentzian_fading.f90')
| -rw-r--r--[-rwxr-xr-x] | lib/fst4/lorentzian_fading.f90 | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/lib/fst4/lorentzian_fading.f90 b/lib/fst4/lorentzian_fading.f90 index c1bd5c32..38510b7d 100755..100644 --- a/lib/fst4/lorentzian_fading.f90 +++ b/lib/fst4/lorentzian_fading.f90 @@ -1,43 +1,43 @@ -subroutine lorentzian_fading(c,npts,fs,fspread)
-!
-! npts is the total length of the simulated data vector
-!
- complex c(0:npts-1)
- complex cspread(0:npts-1)
- complex z
-
- twopi=8.0*atan(1.0)
- df=fs/npts
- nh=npts/2
- cspread(0)=1.0
- cspread(nh)=0.
- b=6.0
- do i=1,nh
- f=i*df
- x=b*f/fspread
- z=0.
- a=0.
- if(x.lt.3.0) then
- a=sqrt(1.111/(1.0+x*x)-0.1)
- phi1=twopi*rran()
- z=a*cmplx(cos(phi1),sin(phi1))
- endif
- cspread(i)=z
- z=0.
- if(x.lt.3.0) then
- phi2=twopi*rran()
- z=a*cmplx(cos(phi2),sin(phi2))
- endif
- cspread(npts-i)=z
- enddo
-
- call four2a(cspread,npts,1,1,1)
-
- s=sum(abs(cspread)**2)
- avep=s/npts
- fac=sqrt(1.0/avep)
- cspread=fac*cspread
- c=cspread*c
-
- return
-end subroutine lorentzian_fading
+subroutine lorentzian_fading(c,npts,fs,fspread) +! +! npts is the total length of the simulated data vector +! + complex c(0:npts-1) + complex cspread(0:npts-1) + complex z + + twopi=8.0*atan(1.0) + df=fs/npts + nh=npts/2 + cspread(0)=1.0 + cspread(nh)=0. + b=6.0 + do i=1,nh + f=i*df + x=b*f/fspread + z=0. + a=0. + if(x.lt.3.0) then + a=sqrt(1.111/(1.0+x*x)-0.1) + phi1=twopi*rran() + z=a*cmplx(cos(phi1),sin(phi1)) + endif + cspread(i)=z + z=0. + if(x.lt.3.0) then + phi2=twopi*rran() + z=a*cmplx(cos(phi2),sin(phi2)) + endif + cspread(npts-i)=z + enddo + + call four2a(cspread,npts,1,1,1) + + s=sum(abs(cspread)**2) + avep=s/npts + fac=sqrt(1.0/avep) + cspread=fac*cspread + c=cspread*c + + return +end subroutine lorentzian_fading |
