Spikes in data due to different nature can be removed, if desired, from the original data. LTPDA ltpda_spikecleaning detects and replaces spikes of the input AOs. A spike in data is defined as a single sample exceeding a certain value (usually, the floor noise of the data) defined by the user:

where is the input data high-pass filtered, is a value defined by the user (by default is 3.3) and is the standard deviation of . In consequence, a spike is defined as the value that exceeds the floor noise of the data by a factor , the higher of this parameter the more difficult to "detect" a spike.

Syntaxis

	b = ltpda_spikecleaning(a, pl)
  

With the following parameters:

Methods explained

1. Random : this method substitutes the spiky sample by:

where is a random number of mean zero and standard deviation 1.

2. Mean : this method uses the following equation to replace the spike detected in data.

3. Previous : the spike is substitued by the previous sample, i.e.:

Examples

1. Spike cleaning of a sequence of random data with kspike=2.

		x = ao(tsdata(randn(10000,1),1)); % create an AO of random data sampled at 1 Hz.
		pl = plist();  % create an empty parameters list 
		pl = append(pl, param('kspike', 2)); % kspike=2
		y = ltpda_spikecleaning(x, pl); % spike cleaning function applied to the input AO, x
		iplot(x, y) % plot original and "cleaned" data
  

2. Example of real data: the first image shows data from the real world prior to the application of the spike cleaning tool. It is clear that some spikes are present in data and might be convenient to remove them. The second image shows the same data after the spike samples supression.