# What are the spike removal techniques in matlab without using filters

output from wavelet filter using daubechies 4 wavelet.

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.

• I am confused, your title suggest that you do not want to use filters? Does that mean you do not want to use Matlab's filter function or you do not want any complex filtering techniques? – GameOfThrows Feb 5 '16 at 11:04
• It's totally unclear to me what you're trying to achieve or asking for in fact. – Jazzmaniac Feb 5 '16 at 11:16
• hi, I need some algorithm to eliminate these notches from my result without using any given filters present in simulink or dsp tool-box . – VIKASH RANJAN Feb 5 '16 at 12:15
• Thanks for giving a look, as the above signal is real time signal it flashes parse error when I use medfilt1(signal,6) command. Since I am trying to design a filter based on wavelet so I cant use any other filter to filter to eliminate the notches of my signal, though different filtering techniques could be used. – VIKASH RANJAN Feb 5 '16 at 21:11

## 3 Answers

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.

Forget about filters, just use a median block from the DSP system toolbox.

• 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