general/missions/rbsp/efw/
rbsp_vector_bandpass.pro
***************************************************************************************** FUNCTION : vector_bandpass.pro PURPOSE : This program does a bandpass filter on the input data using IDL's built-in FFT.PRO routine. The data is first padded with zeroes to ensure the number of elements remains an integer power of 2. The user defines the input vector array of data, the sample rate, and frequency range(s) before running the program, then tells the program whether a low-pass (i.e. only return low frequency signals), high-pass, or middle frequency bandpass filter. The program eliminates the postitive AND negative frequency bins in frequency space to ensure symmetry before performing the inverse FFT on the data. CALLED BY: NA CALLS: power_of_2.pro REQUIRES: NA INPUT: DAT : [N,3]-Array of magnetic or electric field data SR : Scalar defining the sample rate (mHz, Hz, kHz, etc. doesn't matter as long as everything is consistent) LF : Scalar defining the low frequency cutoff (Default = 0) [Note: MUST be same units as SR] HF : Scalar defining the high frequency cutoff (Default = Nyquist) [Note: MUST have same units as SR AND LF] EXAMPLES: htr_mfi2tplot,DATE=date get_data,'WIND_B3_HTR(GSE,nT)',DATA=mag magf = mag.Y tt = mag.X ; -Unix time (s since 01/01/1970) nt = N_ELEMENTS(tx) evl = MAX(tt,/NAN) - MIN(tt,/NAN) ; -Event length (s) nsps = ((nt - 1L)/evl) ; -Approx Sample Rate (Hz) lfmf1 = vector_bandpass(magf,nsps,15d-2,15d-1,/LOWF) KEYWORDS: LOWF : If set, program returns low-pass filtered data with freqs below LF MIDF : If set, program returns bandpass filtered data with freqs between LF and HF **[Default]** HIGHF : If set, program returns high-pass filtered data with freqs above HF CHANGED: 1) Fixed Low Freq. bandpass to get rid of artificial zero frequency bin created by FFT calc. [01/14/2009 v1.0.1] 2) Fixed case where NaN's are in data [01/18/2009 v1.0.2] 3) Changed program my_power_of_2.pro to power_of_2.pro and renamed [08/10/2009 v2.0.0] CREATED: 12/30/2009 CREATED BY: Lynn B. Wilson III LAST MODIFIED: 08/10/2009 v2.0.0 MODIFIED BY: Lynn B. Wilson III *****************************************************************************************
Routines
File attributes
Modification date: | Fri Nov 21 06:43:17 2014 |
Lines: | 56 |