MATLAB: FInding the tresholhd of signal noise(really long narrow spikes).

treshold

Hi,
i have an input EEG signal , i need to filter the data , which means that i need to remove the noise that is the really long narrow spikes, this is how the signal looks:
as you can see there are almost 12 events (large narrow spikes) – and by using the findpeaks function i get almost 2000 pks, which means that i get also the low maximum points, how can i find only the maximum/minimum points of the large spikes or atleast how do find the treshold of for example the lowest line and then plot what's under it?
thanks in advance:)

Best Answer

The findpeaks function has a number of name-value pair agruments that can customise its behaviour to give the desired results. One option here is to use 'MinPeakProminencce', and, 'MinPeakHeight' alone or together.
Use findpeaks twice, once on the data vector to get the positive peaks, and once on the negative of the data vector to get the negative peaks. Make the appropriate corrections to get the actual peak amplitudes of the negative peaks, if necessary.