描述:频率滤波器是一种常见的滤波器,它是基于Fourier 变换演变过来的,它主要分为高通滤波器和低通滤波器。所谓高通滤波器就是只通过高频,滤除低频。反之低通滤波器就是滤除高频,保留低频。
现举例一个常见的频率滤波器——FFT Filter
Code:
/**
* Constructor to set up an FFT object and then automatically
* apply the FFT algorithm.
*
* @param pixels int array containing the image data.
* @param w The width of the image in pixels.
* @param h The height of the image in pixels.
*/
public FFT(int [] pixels, int w, int h){
input = new TwoDArray(pixels,w,h);
intermediate = new TwoDArray(pixels,w,h);
output = new TwoDArray(pixels,w,h);
transform();
}
/**
* Method to recursively apply the 1D FFT to a ComplexNumber array.
*
* @param x A ComplexNumber array containing a row or a column of
* image data.
* @return A ComplexNumber array containing the result of the