I'm back again with another probably very basic question, but I searched a lot about the minimum length of signal for a filter to work, and mine seems to satisfy this (from filtfilt requirement in MATLAB), but still the filter doesn't seem to work. Please help.
Context : Dealing with an encoder signal for angular velocity measurements. The measurement is noisy due to 2 reasons : Eccentricity error of encoder (has a period equal to one revolution), and other errors (position error, state width error etc, which I assume as random). I have tried to remove the influence of random errors by averaging "n" samples, to get a new signal which seems to have worked in cancelling the high frequency noise (after lowpass filtering). However, the eccentricity error still remains.
What I did : I am trying to remove the influence of eccentricity error with a notch filter. I have calculated the mean rotational speed, and used the "irrnotch" function in MATLAB to generate a notch filter.
Problem : Even after applying the notch filter (using filtfilt), that frequency doesn't seem to be attenuated. I only have one rotation worth of data (signal length corresponds to one rotation), and I am trying to cancel out the fundamental frequency (with the period equal to one rotation). How can I proceed with this ? Is the notch filter not working because I have only one rotation worth of data?
I have put some figures below:
The input to the filter is yellow, which is the average angular speed signal. Output from the filter is purple.
FVtool from MATLAB. sampling freq for the yellow signal is close to 3.5 Hz (after averaging). cutoff frequency that I need removed is 0.177 Hz. So I input 0.1 as the normalised frequency.
I understand in this particular case, there is not much variation in the input signal except the effect of the eccentricity error, and I should probably take the mean and call it a day, but I want to know what I can do if there were higher variations super imposed on the base signal. How should I filter the base signal out ? Should I highpass, and add the mean back? or any other way..