# Filtering on a time signal

I am new to DSP, and am mostly self taught. I have a couple of questions, that may be too basic, but I couldn't really find an answer online.

I have a signal obtained by plotting the motion of a human in 2D from a fixed point of reference (origin).

1. The data is noisy, so I wanted to use a filter to get a smoother signal.
2. I want to filter out different motions. The intuition is that different kind of motions would occur at different frequencies.

From what I googled, and read online; it seems I need a bandpass filter like butterworth. However, after reading a few tutorials and book chapters, I have two questions:

1. My signal is a time-signal (displacement vs time), but the filter takes the input in terms of cut-off frequency. Does this mean I have to convert the signal into frequency domain, or does the filter take care of it? I am bit confused on how this actually works.
2. On a related note, I don't know the frequency of each motion that I am trying to filter out i.e. the intuition is that the frequency for different motions be different, but how do I determine by cut-off values? Is it usually done by trial and error, or is there a more scientific way to accomplish this?
• How fast do you take samples (sample rate)? This will at least give you an idea of the maximum frequency supported by your signal (Nyquist frequency = sampling rate / 2 ). Your cut-off frequency will be expressed as a fraction of the sampling rate. Now just feed the filter with different frequencies and see what comes out. You don't need to convert to FFT before using a filter unless you want to use FFT filtering (FFT convolution) Jul 27 '17 at 13:31
• mods: The original question was an unregistered account. Can you please merge it with this account? I was not able to leave comments for some reason without registering. @Marcus: Can you explain a bit more about your second point about spectrum estimation? Jul 27 '17 at 14:16
– Peter K.
Jul 27 '17 at 16:33
• well, arpit recommended that you first estimate the spectrum to look where your movement signal lies, and then adjust the filters based on that. I say: Why adjust even have any filters when you get all the info you need from the spectrum estimate? Jul 27 '17 at 16:51
• @MarcusMüller Is it possible to extract the relevant signal based on simply spectral analysis? I need the relevant signal for a particular motion for post-processing. If that's possible, then yes, your suggestion would work for me. Jul 27 '17 at 17:28

1. My signal is a time-signal (displacement vs time), but the filter takes the input in terms of cut-off frequency. Does this mean I have to convert the signal into frequency domain, or does the filter take care of it? I am bit confused on how this actually works.

You design or specify the filter in the frequency domain, but the actual filtering can be directly accomplished in time. There are FFT based filtering algorithms that are typically more efficient, but there is no requirement to transform your signal to the frequency domain.

1. On a related note, I don't know the frequency of each motion that I am trying to filter out i.e. the intuition is that the frequency for different motions be different, but how do I determine by cut-off values? Is it usually done by trial and error, or is there a more scientific way to accomplish this?

Anything that doesn't require trial and error is suspect, scientific methodology wise. I suggest that you try to be more specific about what filtering out different motions actually means. Some kinds of phenomena are a superposition of features which are often separable, of which some can be "filtered out" and others don't lend themselves to that.

You might want to use a tool known as the Short Time Fourier Transform (STFT) and see if you can eye ball any patterns associated with desired/undesired motion.

• By "filtering out", I meant that if there are 2 kind of motions obtained from a single person (e.g. they run for 30 seconds, and then jog for 2 minutes), Both motions would be occurring at different freqs, and I wanted to separate out the 30s signal, and the 2min signal. Jul 30 '17 at 14:20
• @dspnoob123 I believe that you are actually looking for a time series classification algorithm. There are many mature solutions for identifying one kind of signal over another,particularly if there isn't a lot of "noise" in your signals. I could make some suggestion but Google can provide more. I would be very surprised if the answer you're looking for hasn't been answered elsewhere. I still think looking at the STFT is a good idea.
– user28715
Jul 31 '17 at 16:23
• Thank you, I'll look into the classification algorithms. Based on your answer, I have started looking at STFT, and I am starting to understand this more now. Jul 31 '17 at 18:12

Few points to answer the questions