home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / maths / plplot / plplot_2 / examples / f77 / x04f.f < prev    next >
Encoding:
Text File  |  1994-05-26  |  1.5 KB  |  50 lines

  1. ! $Id: x04f.f,v 1.2 1994/05/26 19:34:17 mjl Exp $
  2. ! $Log: x04f.f,v $
  3. ! Revision 1.2  1994/05/26  19:34:17  mjl
  4. ! Inserted missing CVS Id and Log fields for all Fortran demos.  Comment
  5. ! character changed to "!" everywhere, to work well with font-lock in Lucid
  6. ! emacs (requires a small change to fortran-mode.el).
  7. !
  8. !
  9.       program example04
  10. !     =================
  11. !
  12. ! Illustration of logarithmic axes, and redefinition of window
  13.  
  14.       real freql(0:100),ampl(0:100),phase(0:100)
  15.       call plinit()
  16.       call pladv(0)
  17.       call plfont(2)
  18.  
  19.       f0 = 1000.0
  20.       do 1 i=0,100
  21.         freql(i)=1.0+real(i)/20.0
  22.         freq=10.0**freql(i)
  23.         ampl(i)=20.0*log10(1.0/sqrt(1.0+(freq/f0)**2))
  24.         phase(i)=-(180.0/3.141592654)*atan(freq/f0)
  25.     1 continue
  26.  
  27.       call plvpor(0.15,0.85,0.1,0.9)
  28.       call plwind(1.0,6.0,-80.0,0.0)
  29.       call plcol(1)
  30.       call plbox('bclnst',0.0,0,'bnstv',0.0,0)
  31.       call plcol(2)
  32.       call plline(101,freql,ampl)
  33.       call plcol(1)
  34.       call plptex(5.0,-30.0,1.0,-20.0,0.5,'-20 dB/decade')
  35.       call plwind(1.0,6.0,-100.0,0.0)
  36.       call plbox(' ',0.0,0,'cmstv',30.0,3)
  37.       call plcol(3)
  38.       call plline(101,freql,phase)
  39.  
  40.       call plcol(1)
  41.       call plmtex('b',3.2,0.5,0.5,'Frequency')
  42.       call plmtex('t',2.0,0.5,0.5,'Single Pole Low-Pass Filter')
  43.       call plcol(2)
  44.       call plmtex('l',5.0,0.5,0.5,'Amplitude (dB)')
  45.       call plcol(3)
  46.       call plmtex('r',5.0,0.5,0.5,'Phase shift (degrees)')
  47.  
  48.       call plend      
  49.       end
  50.