Ideal Low-Pass Filter Output? I'm very new to digital signal processing, I've been reading a text book to try to figure out this assignment at work (avionics related).  I'm supposed to implement a two-pole low-pass filter with a fixed cutoff frequency (of 0.02Hz)

I'm not sure if my current output is correct, given my understanding of how low pass filters are supposed to work.



The top is my input signal. 3Hz to the left, 1Hz to the right.

Given my current level of understanding of digital signal processing, my expected output of a low-pass filter with a frequency cutoff of 2Hz is in the middle. 0 to the left, and the original 1Hz signal on the right.

The bottom is the output of my current implementation. I don't know if my current implementation is wrong, my understanding, or my expectations of how close to ideal the filters actually are.

This actual implementation is a single pole recursive filter, just trying to get a working example (and understanding) I can test against, before I design everything the way they want it.

The sample rate is 100Hz, so for f = 2Hz, I tried poles of both x = e^(-2*pi*2/100) and x = e^(-2*pi*2/200) (the formula I saw wanted a value from 0 to .5, so assumed it was some fraction of sample rate?)

Any ideas?
From the description I'll take you have a filter with 3 coefficients. (and the formulae are missing the symbol i). With a sample rate of 100 Hz you would require a filter of length 33 to make it cover the complete wave form of one cycle of 3 Hz signal. Just looking one tenth of a waveform a filter would have to do magic to attenuate (just) a 3Hz signal but leave 1Hz signals intact.

If you'll have octave or matlab, you might want to see the frequency response of your filter:

 `a=exp(i*pi*2/100);freqz([1,a*conj(a)],1)`


Here the 3dB cutoff is approximately at Fs/4 (one quarter of the sampling frequenzy).