SUB_WAVELET/Fortran/SUB_upsconv.f90

30 lines
562 B
Fortran
Raw Normal View History

2025-04-17 11:06:03 +08:00
SUBROUTINE upsconv(n,x,f,s,y)
implicit none
integer :: n,s
real*8 :: x(n),f(8),y(1000)
integer :: sx2,first,last,lenKept,i
real*8 :: tempy(1000),d
y = 0
sx2 = 2*n
first = 0
last = 0
lenKept = s
do i=1,sx2-1,2
y(i) = x((i+1)/2)
end do
call conv(sx2-1,y(1:sx2-1),8,f,tempy(1:sx2+6))
if(lenKept>sx2+6) lenKept = sx2+6
d = (sx2+6-lenKept)/2.0
first = 1+int(floor(d))
last = sx2+6-int(ceiling(d))
y(1:s) = tempy(first:last)
end subroutine