SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
SoDa::MedianFilter3< T > Class Template Reference

3 point Median Filter class – templatized (!) More...

#include <MedianFilter.hxx>

Public Member Functions

 MedianFilter3 ()
 constructor no parameters
unsigned int apply (T *inbuf, T *outbuf, unsigned int len, float outgain=1.0)
 Apply the 3 sample median filter to an input vector.

Private Member Functions

findMedian (T v)
 find the median of the supplied value vs.

Private Attributes

a
 storage for the value-before-last
b
 storage for the previous value

Detailed Description

template<typename T>
class SoDa::MedianFilter3< T >

3 point Median Filter class – templatized (!)

Definition at line 47 of file MedianFilter.hxx.

Constructor & Destructor Documentation

◆ MedianFilter3()

template<typename T>
SoDa::MedianFilter3< T >::MedianFilter3 ( )
inline

constructor no parameters

Definition at line 53 of file MedianFilter.hxx.

References a, and b.

Member Function Documentation

◆ apply()

template<typename T>
unsigned int SoDa::MedianFilter3< T >::apply ( T * inbuf,
T * outbuf,
unsigned int len,
float outgain = 1.0 )
inline

Apply the 3 sample median filter to an input vector.

Parameters
inbufthe input buffer
outbufthe output buffer – the two buffers may overlap, though inbuf must be <= outbuf
lenthe length of the input and output buffers
outgainboost the output, if necessary

Definition at line 66 of file MedianFilter.hxx.

References findMedian().

◆ findMedian()

template<typename T>
T SoDa::MedianFilter3< T >::findMedian ( T v)
inlineprivate

find the median of the supplied value vs.

the previous two supplied values

Parameters
vthe "new" value in the sequence
Returns
the median value of the last 3 values in a sequence

Definition at line 82 of file MedianFilter.hxx.

References a, and b.

Referenced by apply().

Member Data Documentation

◆ a

template<typename T>
T SoDa::MedianFilter3< T >::a
private

storage for the value-before-last

Definition at line 98 of file MedianFilter.hxx.

Referenced by MedianFilter3(), and findMedian().

◆ b

template<typename T>
T SoDa::MedianFilter3< T >::b
private

storage for the previous value

Definition at line 99 of file MedianFilter.hxx.

Referenced by MedianFilter3(), and findMedian().


The documentation for this class was generated from the following file: