home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / lib / mathlib / libconv / TRY / ornl_dcor1d.f < prev    next >
Encoding:
Text File  |  1994-08-02  |  2.2 KB  |  64 lines

  1.       subroutine ornl_dcor1d(   f,incf,if0, nf,
  2.      $                g,incg,ig0, ng,
  3.      $                h,inch,ih0, nh)
  4.       double precision f(1), g(1), h(1)
  5.       integer incf, if0, nf, incg, ig0, ng, inch, ih0, nh
  6. c-----------------------------------------------------------------------------
  7. c
  8. c   dcor1d  performs a 1D correlation in the time domain :
  9. c    h(j) = Sum[ f(i) * g(i-j) ]
  10. c
  11. c-----------------------------------------------------------------------------
  12. c
  13. c   PARAMETERS:
  14. c
  15. c    f:    Vector containing sequence "f"
  16. c    incf:    Increment between two successive values of "f"
  17. c    if0:    Starting time of Sequence
  18. c    nf:    Number of elements of sequence
  19. c
  20. c    g:    Vector containing sequence "g"
  21. c    incg:    Increment between two successive values of "g"
  22. c    ig0:    Starting time of Sequence
  23. c    ng:    Number of elements of sequence
  24. c
  25. c    h:    Vector containing sequence "h"
  26. c    inch:    Increment between two successive values of "h"
  27. c    ih0:    Starting time of Sequence
  28. c    nh:    Number of elements of sequence
  29. c
  30. c-----------------------------------------------------------------------------
  31. c
  32. c   PLEASE NOTE:
  33. c    1-    Please note that the array pointers must all point to the first 
  34. c    element of the array "nf1", "ng1" and "nh1".
  35. c     If "f" for example is defined as
  36. c        dimension f(-25:45)
  37. c    Then "dcor1d" must be called with the following parameters
  38. c        call dcor1d( f(-25),1,-25,45, ... )
  39. c
  40. c    2- Please also note, that due to DEFINITION of the correlation operation, 
  41. c    it cannot be done in place ... unless "ig0+ng-1" (the time of the last 
  42. c    sample of "g") is <= 0 ... a circumstance which is mostly unlikely.
  43. c-----------------------------------------------------------------------------
  44. c
  45. c   This Fortran Subroutine written by
  46. c    Jean-Pierre Panziera
  47. c    Silicon Graphics Inc
  48. c    September 20, 1991
  49. c
  50. c-----------------------------------------------------------------------------
  51.       double precision one, zero
  52.       parameter( one = 1., zero = 0.)
  53. c-----------------------------------------------------------------------------
  54. c
  55. c   Call dfir1d with the Swapped sequence "g" ...
  56. c
  57. c-----------------------------------------------------------------------------
  58.     call ornl_dfir1d(    f,incf,if0,nf,
  59.      $            g(1+(ng-1)*incg),-incg,-(ig0+ng-1),ng,
  60.      $            h,inch,ih0,nh,
  61.      $            one, zero)
  62.       return
  63.       end
  64.