How to use Fourier Filter on Complex Data

For the Fourier decomposition of a signal as a sum of sinusoidal functions, you may take a look at example here.

To process your signal in the frequency domain, you can use the DSP.jl package to filter out the higher frequency components of your “noisy” dataset:

using DSP, Plots
x = 1:1:10
y = [-1.0,5,0,2,-7,1,6,9,-2,3.0]
fs = 1.0;   # sampling frequency
fc = 0.35;  # frequency cutoff, less than Nyquist
responsetype = Lowpass(fc, fs=fs)
designmethod = FIRWindow(hamming(10))
filty = filtfilt(digitalfilter(responsetype, designmethod), y)
plot(x, y, label = "input", legend=:topleft)
plot!(x, filty, label = "filtered")

filtered_signal

PS: it goes without saying, the input array provided is pretty short.

3 Likes