Applied Math & Computer Science Lab
Data Analysis, Optimization & Mathematical Modeling, Artificial Intelligence, Neural Net For Everyday Life Applications
AI/Data Mining Links Online Free Courses Online Bookstore AMCSL Forum Submit Link New Additions Archive
Practical Data Mining Courses      Get Certificate of Completion Now for Free   
Search the Web:    

Filtering in the Frequency Domain

Here we will consider filtering time series in the frequency domain. To do this we need first apply discrete Fourier transform (DFT) to the input signal, then multiply the signal by filter coefficients and then compute the inverse DFT to get back to time domain.
Perl has module Math::FFT that does Fourier Transform and inverse Fourier Transform using fast Fourier transform algorithm. We will use this module which can be found on the CPAN.

We will implement 3 types of filters: low-pass filter, high-pass filter, band-pass filter.
A low-pass filter passes low frequency components in the signal and blocks the high frequency signal compomnents.
A high-pass filter passes high frequency components in the signal and blocks the low frequency signal components.
And a band-pass filter passes only the specified frequency.
The input to our filter function is the frequency that divides the signal components in two parts - the one that go through the filter and the one that does not go through. This frequency is called cutoff frequency.
Another input to the filter function is the width of the filter.
The link to perl source code is provided below.
The filtering functions will be very useful for preparing data for input to neural net. For example in stock data forecasting we can divide signal to low-pass and high-pass signal components and then input to neural net.



References


1. Filtering in the Frequency Domain - perl script

Related Links


2. Preparing stock data for data analysis or prediction - perl script
3. Perl module for fetching historical stock quotes