************************************************************************
      SUBROUTINE FTSTPR(N,IT,T)
 
      IMPLICIT REAL  (A-H,O-Z)
      DIMENSION IT(5),T(0:N-1,5)

      DATA PI/3.1415926535897932385D0/

      CALL FTRLPR(N,IT,T)
 
      N4=N*4
 
      DO 10 I=0,N-1
      T(I,5)=SIN(2*PI*(2*I+1)/N4)
   10 CONTINUE
 
      END
************************************************************************
      SUBROUTINE FTSTMN(X,Y,M,N,IT,T,ISN)
 
      IMPLICIT REAL  (A-H,O-Z)
      DIMENSION IT(5),T(0:N-1,5)
      DIMENSION X(M,0:2*N-1),Y(M,0:N-1,2)
 
      N2=N*2
 
      DO 10 J=1,N-1
      J1=2*J
      J2=N2-J1
      J3=2*J+1
      J4=N2-J3
      DO 10 I=1,M
      Y(I,J,1)=X(I,J2)-X(I,J1)+2*T(J,4)*(X(I,J2)+X(I,J1))
      Y(I,J,2)=X(I,J4)-X(I,J3)+2*T(J,5)*(X(I,J4)+X(I,J3))
   10 CONTINUE
 
      J=0
      J3=2*J+1
      J4=N2-J3
      DO 20 I=1,M
      Y(I,0,1)=0
      Y(I,J,2)=X(I,J4)-X(I,J3)+2*T(J,5)*(X(I,J4)+X(I,J3))
   20 CONTINUE
 
      IF(ISN.EQ.-1) THEN
      DO 30 IR=1,2
      DO 30 J=0,N-1
      DO 30 I=1,M
      Y(I,J,IR)=N*Y(I,J,IR)
   30 CONTINUE
      END IF
 
      CALL FTRLFW(Y,X,M,N,N,IT,T)
 
      DO 40 I=1,M
      X(I,0)=0
      X(I,1)=0.5D0*Y(I,0,1)
      X(I,N2-1)=-0.5D0*Y(I,0,2)
   40 CONTINUE
 
      DO 50 J=1,N-1
      DO 50 I=1,M
      X(I,2*J)=Y(I,J,2)
      X(I,2*J+1)=X(I,2*J-1)+Y(I,J,1)
   50 CONTINUE
 
      END
