# One dimensional sieve applied to images

#### 'siv4.mex' implemenation applies the m-sieve to a vector or column wise to a matrix

A Matlab function siv4_test.m illustrates how siv4.mex can be used to analyse columns of 1D data.

 Consider a signal, [itex]X[/itex] ```X=getData('PULSES3WIDE') >blue X=0 5 5 0 0 1 1 4 3 3 2 2 1 2 2 2 1 0 0 0 1 1 0 3 2 0 0 0 6 0 0 ```
 The data has minima and maxima of different scales (lengths). In one dimension we measure pulse length using a ruler, measuring tape or whatever - but not frequency or Gaussian scale.

# Filter

#### Lowpass siv4.mex

 Imagine that within the data above there is a signal, which may comprise positive or negative pulses, that is contaminated by smaller scale noise (leftmost panel). Then 'siv4.mex' (i.e. compiled from the 'C' to suite your operating system) can filter out the smaller scale noise - irrespective of amplitude, i.e. it removes smaller scale (length) extrema.The rightmost panels show the results of removing all 'noise' less than scales 1, 5 and 10. Unlike linear filters edges remain well defined and 'noise' is completely removed.
```data{1}=siv4_alt('PULSES3WIDE',[2;5;10]);
data{1}
ans =
y: {[34x1 double]  [34x1 double]  [34x1 double]} % outputs for the 3 specified scales
scan: [34 34]            % instructing single column processing
X: [34x1 double]    % input data
options: [3x4 double]   % options (see elsewhere)
outputs: 'lll'                 % outputs all lowpass
type: 'int'                 % input data may be double but only contains integers
name: 'PULSES3WIDE'
```