Using wavelet filter this is the output obtained. The problem is elimination of the spikes at 0.023,0.043,0.063 and so on. Please note: no predefined filters present in simulink and dsp toolbox are to be used. Kindly suggest an alternative method to remove the spikes.
based on your results, you can try a median filter, in Matlab -
medfilt1; which takes n-length samples of your series x at a time and computes the median, and apply the median value to each value of x. It is a very common non-linear filtering technique.
try something like
result = medfilt1(signal,6)
you and alter the length of evaluation from 6 to whichever number suits the data.
Guess a threshold from your data (e.g. from a cumulative probability density function of the abs value of your signal, where you then say the threshold
t= the point closest to the 95% mark)
Threshold your signal by signal(signal > 1.25*t) = NaN
Interpolate the NaN-points away, if necessary via a linear interpolation