1
$\begingroup$

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?
$\endgroup$
  • $\begingroup$ 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) $\endgroup$ – dsp_user Jul 27 '17 at 13:31
  • $\begingroup$ 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? $\endgroup$ – dspnoob123 Jul 27 '17 at 14:16
  • $\begingroup$ @dspnoob123 Please follow the instructions here: stackoverflow.com/help/merging-accounts $\endgroup$ – Peter K. Jul 27 '17 at 16:33
  • $\begingroup$ 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? $\endgroup$ – Marcus Müller Jul 27 '17 at 16:51
  • $\begingroup$ @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. $\endgroup$ – dspnoob123 Jul 27 '17 at 17:28
0
$\begingroup$
  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.

Finally, try Google Scholar.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – dspnoob123 Jul 30 '17 at 14:20
  • $\begingroup$ @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. $\endgroup$ – Stanley Pawlukiewicz Jul 31 '17 at 16:23
  • $\begingroup$ 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. $\endgroup$ – dspnoob123 Jul 31 '17 at 18:12
-1
$\begingroup$

Few points to answer the questions

Editing the first answer from the comments of Marcus Muller

  • The transform to frequency domain and back always happens on parts of the signal, padded to specific lengths, and thus, the transform is part of the filtering algorithm itself, hence no need to explicitly transform time signal to frequency domain before filtering.

  • To find out the cutoff frequencies corresponding to each of the motions, you can see frequency spectrum of the input signal and try to figure out which frequency components are dominant during which type of motion. this will give you a fair idea of cutoffs for designing band pass filters.

$\endgroup$
  • $\begingroup$ Re: filters: any FIR can be implemented with Frequency-domain-based fast convolution (not just BPFs). In any case, you never have to convert to frequency domain first. Re: motion analysis, exactly, spectrum estimation is the way to see the things happening periodically in your signal. If you see things in there, you'd usually just make a spectrum-estimation-based motion estimator instead of modifying filters and then estimate motion of the filter outputs :) $\endgroup$ – Marcus Müller Jul 27 '17 at 14:03
  • $\begingroup$ @MarcusMüller by frequency domain implementation I meant instead of convolving in time domain, one can multiply in frequency domain. $\endgroup$ – arpit jain Jul 27 '17 at 14:23
  • $\begingroup$ exactly, that's fast convolution; but you can't actually work on the discrete Fourier transform of the input signal itself, because that would yield a cyclic rather than a linear convolution. Hence, the transform to frequency domain and back always happens on parts of the signal, padded to specific lengths, and thus, the transform is part of the filtering algorithm itself, not a step happening before. $\endgroup$ – Marcus Müller Jul 27 '17 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.