Friday, September 28, 2018

discrete signals - What kind of filter I should use to remove the oscillations in this autocorrelation function?


I have an autocorrelation function which is shown as following,


I do believe these trailing oscillating wigs are spurious and should be removed by some kind of filter. But I am not familiar with any types of filters. Any help will be appreciated! The original data can be downloaded at


~


Update @ Apr 14 2017:



This result was processed with the filter suggested by Dan.


enter image description here



Answer



The following comb filter structure can be used to filter your data prior to computing the autocorrelation which will significantly reduce or eliminate the ringing due to the repetition in your signal. However be aware that it may also be filtering signal content based on the spectral occupation of your signal. The structure of the signal and the frequency response is shown below (for N=101).


comb filter


Where N is the number of samples to be a 0.5 second delay. Implemented in Matlab using


out = filter([1 ones(1,N-1) -1],1,in)

frequency response


This filter above as given is a highpass response so depending on the spectral content in the signal of interest, this may not be ideal.



Another option that will equally create nulls at the repetition rate and harmonics of the repetition rate is a moving average filter:


Moving average filter


Implemented in Matlab using


out = filter([ones(1,N)],N,in)

Note in this case the filter was normalized, a 2 could be used as the second parameter in the first case to normalize that filter as well.


freq response for moving average filter


Note that the first filter removes DC and is a highpass function which may not be desirable, while the second filter has a 1/f frequency roll-off as a sinc function in addition to removing the harmonic nulls which will likely widen the autocorrelation response. If the high frequency content is desired, a third filter option that would be interesting to see can be done based on this post


Transfer function of second order notch filter


This filter also removes DC but can have a much tighter nulling response and flat elsewhere based on a nulling parameter $\alpha$



By inserting zeros in the frequency response we can get the base spectrum to repeat, so in your case you would insert N-1 zeros to perform the following filter function (see referenced post for structure of this filter):


out = filter((1+alpha)/2*[1 zeros(1,N-1) -1], [1 zeros(1,N-1) -alpha], in)

The frequency response for $N = 10$ and $\alpha = 0.9$ is shown below. (Your N of course is much larger). If you vary $\alpha$ less than or more than what I used up to but not equal to 1 (I recommend using $\alpha$ in the range between 0.7 and 0.999); the nulls get sharper as $\alpha$ approaches 1.


freq response for exponential nuller


If you do implement these on your data, please post the results for all these cases so we can see the difference it has caused.


No comments:

Post a Comment

periodic trends - Comparing radii in lithium, beryllium, magnesium, aluminium and sodium ions

Apparently the of last four, $\ce{Mg^2+}$ is closest in radius to $\ce{Li+}$. Is this true, and if so, why would a whole larger shell ($\ce{...