mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-31 13:12:30 -04:00
Add multi-signal waveform compression.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8251 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
dbce0cb8ee
commit
b0212188e6
@ -73,9 +73,22 @@ subroutine foxgen(t)
|
|||||||
if(i.ge.m) exit
|
if(i.ge.m) exit
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
fac=1.0/maxval(abs(wave))
|
sqx=0.
|
||||||
|
do i=1,NWAVE
|
||||||
|
sqx=sqx + wave(i)*wave(i)
|
||||||
|
enddo
|
||||||
|
sigmax=sqrt(sqx/NWAVE)
|
||||||
|
wave=wave/sigmax !Force rms=1.0
|
||||||
|
|
||||||
|
do i=1,NWAVE
|
||||||
|
wave(i)=h1(wave(i)) !Compress the waveform
|
||||||
|
enddo
|
||||||
|
|
||||||
|
fac=1.0/maxval(abs(wave)) !Set maxval = 1.0
|
||||||
wave=fac*wave
|
wave=fac*wave
|
||||||
|
|
||||||
|
if(NWAVE.ne.-99) go to 100 !### Omit filtering, for now ###
|
||||||
|
|
||||||
x(1:k)=wave
|
x(1:k)=wave
|
||||||
x(k+1:)=0.
|
x(k+1:)=0.
|
||||||
call four2a(x,nfft,1,-1,0)
|
call four2a(x,nfft,1,-1,0)
|
||||||
@ -99,10 +112,28 @@ subroutine foxgen(t)
|
|||||||
enddo
|
enddo
|
||||||
flush(29)
|
flush(29)
|
||||||
|
|
||||||
call system_clock(count1,clkfreq)
|
100 call system_clock(count1,clkfreq)
|
||||||
time=float(count1-count0)/float(clkfreq) !Cumulative execution time
|
time=float(count1-count0)/float(clkfreq) !Cumulative execution time
|
||||||
! write(*,3010) time
|
! write(*,3010) time
|
||||||
!3010 format('Time:',f10.6)
|
!3010 format('Time:',f10.6)
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine foxgen
|
end subroutine foxgen
|
||||||
|
|
||||||
|
real function h1(x)
|
||||||
|
|
||||||
|
! sigma=1.0/sqrt(2.0)
|
||||||
|
sigma=1.0
|
||||||
|
xlim=sigma/sqrt(6.0)
|
||||||
|
ax=abs(x)
|
||||||
|
sgnx=1.0
|
||||||
|
if(x.lt.0) sgnx=-1.0
|
||||||
|
if(ax.le.xlim) then
|
||||||
|
h1=x
|
||||||
|
else
|
||||||
|
z=exp(1.0/6.0 - (ax/sigma)**2)
|
||||||
|
h1=sgnx*sqrt(6.0)*sigma*(2.0/3.0 - 0.5*z)
|
||||||
|
endif
|
||||||
|
|
||||||
|
return
|
||||||
|
end function h1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user