Having a non-mathematical background I'm trying to understand how to implement filtering of data in the frequency domain as part of FFT. A javascript implementation of a discrete FFT is found here: https://rosettacode.org/wiki/Fast_Fourier_transform#JavaScript
I am having trouble understanding how to implement a Ram-Lak filter such as the one found in fig 3 in this article: http://www3.cs.stonybrook.edu/~mueller/teaching/cse377/lab3.pdf
So far I have completed a FFT of an array of say 100 real numbers and obtained two resulting arrays with real and imaginary components, respectively of the 100 resulting frequency components from 0 frequency (DC) to 99.
After obtaining this result i do this (in pseudocode):
center = frequencies.length/2
For n = frequencies 1 to 99 in result of FFT do {
If (n < center) {Multiply each real and imaginary component by (n/(center))}
If (n >= center) { Multiply each real and imaginary component by (frequencies.length-n/center)}
} // end do
Perform inverse FFT
After the inverse FFT the 100 real initial numbers should have been run through a Ram-lak filter - am I corrrect?