| bwfilter | playpen | bwfilter |
bwfilter -- Fourier filter a 1-D image or table column.
bwfilter input output
This task filters a 1-D array in the following way. After subtracting a background from the input, the forward Fourier transform is taken. The data in the transform domain are multiplied by a filter of the form: signal / (signal + noise). The inverse Fourier transform is then taken, the background is added back in, and the result is written to the output.
The input and output may be either an image or a table column, or one of each. For either the input or output parameter, if the value is a single word it is assumed to be an image name, but if it is two words separated by one or more spaces it is assumed to be a table name and a column name.
The background that is subtracted before taking the Fourier transform is obtained by fitting a straight line. The linear fit is done to the log of the data if all values are positive; otherwise, the fit is done to the data values directly.
The signal and noise are estimated as follows. The task fits a constant (the noise level) to the higher frequencies, and it fits a quadratic (the signal) to the log power spectrum at the lower frequencies. Then the filter in the Fourier domain is signal / (signal + noise).
History records are added to the output header to give the date and the cutoff frequency, and for an output table, the column name of the filtered data.
If interactive = no, the task gets the cutoff frequency from the freq parameter.
1. Filter the image "fos.hhh" in the scidata directory, putting the output in column "flux" of table "fos.tab"
pl> bwfilter scidata$fos.hhh "fos.tab flux"
2. Filter column "flux" in table "fos.tab", putting the output in column "f_flux" of the same table.
pl> bwfilter "fos flux" "fos f_flux"
This task was written by Phil Hodge based on algorithms given by Brault and White, 1971, Astron. & Astrophys., 13, 169.