连续(sinc)小波变换给出NaN

时间:2016-12-22 06:57:38

标签: fortran

  implicit     none
  character*20 fflname,oflname
  integer      length_sgnl
  real*8       pi, dt, m, n, theta
  parameter    ( length_sgnl=11900, dt=0.01d0, m=1, n=1, pi=3.1416
 &            ,theta=0.2 )

  integer      i     
  complex*16   cj, coeff ,sgnl(1 : length_sgnl)
  real*8       t(1 : length_sgnl)
  parameter    ( cj = dcmplx(0, 1) )

  real*8       time, real_sgnl, imag_sgnl


  oflname="filtered.data"
  fflname="artificial"
  open(11, file = oflname)
  do i=1, length_sgnl
     read(11, *) time, real_sgnl, imag_sgnl
     sgnl(i) = dcmplx(real_sgnl, imag_sgnl)
     t(i) = (i*dt - m) / (2**n)
  enddo

  coeff = 0
  do i=1, length_sgnl
     coeff = coeff 
 &        + sgnl(i) * sin(pi*t(i)) / (pi*t(i)) * exp (-cj*2*pi*t(i))
  enddo


  do i=1, length_sgnl
     sgnl(i) = sgnl(i) 
 &         - coeff * sin(pi*t(i)) / (pi*t(i)) * exp (-cj*2*pi*t(i))
 &         + coeff * sin(pi*t(i)) / (pi*t(i)) * exp (-cj*2*pi*t(i))
 &         * exp (cj*theta)
  enddo

  open(12, file = fflname)
  do i=1, length_sgnl
    write(12, *) i*dt, sgnl(i)
  enddo
  close(12)

  stop
  end

我想通过连续Shannon小波变换给原始信号提供相移。 构造信号的结果都是NaN,尽管编译时没有任何错误信息。

0 个答案:

没有答案