home *** CD-ROM | disk | FTP | other *** search
- ; This batch file creates a plot of the power spectrum of
- ; the simulated signal used in the example from Chapter 13,
- ; "Signal Processing", of _Using IDL_, with a 30 cycle/second
- ; periodic component added.
-
- @sigprc01.bat ; compute time data sequence u
-
- F = FINDGEN(N/2+1) / (N*delt) ; f = [0.0, 1.0/(N*delt), ... , 1.0/(2.0*delt)]
-
- u_a = U + SIN(2*!PI*30.0*delt*FINDGEN(N))
-
- v_a = FFT(u_a)
-
- ; log-log plot of power spectrum
-
- PLOT, F, ABS(v_a(0:N/2))^2, YTITLE='Power Spectrum', $
- /YLOG, YRANGE=[1.0e-8,1.0], YSTYLE=1, YMARGIN=[4,4], $
- XTITLE='Frequency in cycles / second', $
- /XLOG, XRANGE=[1.0,1.0/(2.0*delt)], XSTYLE=1, $
- TITLE='Power Spectrum with (solid) and without!C(dashed) Aliased 30 c/s Component'
-
- OPLOT, F, ABS((FFT(U))(0:N/2))^2, LINESTYLE=2 ; overplot without window
-
-