function WSPECTRM, x,n ;+ ; NAME: ; WSPECTRM ; ; PURPOSE: ; This function generates a power spectrum. ; ; CATEGORY: ; Wavelets ; ; CALLING SEQUENCE: ; sp = WSPECTRM(x,n) ; ; INPUTS: ; x: a 1-d array ; n: desired length of 1-d array ; ; OUTPUTS: ; sp: a power spectrum of input x array ; ; EXAMPLE: ; ; PROCEDURE: ; Uses the IDL FFT function. ; ; MODIFICATION HISTORY: ; Written by: Amara Graps October, 1994 ;Translated from MatLab Wavelab routine: tw_spectrum.m ;- sp = ABS(FFT(x,-1))^2 ;Forward Fast Fourier Transform sp = sp(0:n-1) RETURN, sp ; Algorithm Source: WaveLab Version 0.600 ; WaveLab WWW site: http://playfair.stanford.edu/ ; WaveLab Questions? e-mail wavelab@playfair.stanford.edu END ;***************************************************