dsp::Apodization Class Reference

Various apodizing (window) functions. More...

#include <Apodization.h>

Inheritance diagram for dsp::Apodization:
dsp::Shape OwnStream Reference::Able Reference::HeapTracked

Public Types

enum  Type {
  none, hanning, welch, bartlett,
  tukey, top_hat
}
 

Public Member Functions

 Apodization ()
 Null constructor.
 
void set_type (const std::string &)
 Set the type of window function by name.
 
void set_analytic (bool f=true)
 Set true when the data to be tapered are complex-valued.
 
bool get_analytic () const
 
void set_size (unsigned)
 Set the number of samples in the window.
 
void set_transition_start (unsigned n)
 Number of samples in the transition region on the start.
 
void set_transition_end (unsigned n)
 Number of samples in the transition region on the end.
 
void set_transition (unsigned n)
 
void build ()
 Build the specified window.
 
void Hanning ()
 Create a Hanning window function.
 
void Welch ()
 Create a Welch window function.
 
void Bartlett ()
 Create a Bartlett window function.
 
void Tukey ()
 Create Tukey window function. More...
 
void TopHat ()
 Create top hat window function.
 
void normalize ()
 make the integrated total of the window equal to one
 
Type getType ()
 
Type get_type ()
 
void operate (float *indata, float *outdata=0) const
 Multiply indata by the window function.
 
void swap ()
 Swap the two halves of the window.
 
double integrated_product (float *data, unsigned incr=1) const
 Returns SUM i=1..N {window[i] * data[i]}.
 
void dump (const std::string &filename)
 Write the window to a text file. More...
 
- Public Member Functions inherited from dsp::Shape
 Shape ()
 Default constructor.
 
virtual ~Shape ()
 Destructor.
 
 Shape (const Shape &)
 Copy constructor.
 
const Shapeoperator= (const Shape &)
 Assignment operator.
 
virtual void resize (unsigned npol, unsigned nchan, unsigned ndat, unsigned ndim)
 Set the dimensions of the data.
 
unsigned get_npol () const
 Get the number of polarizations.
 
unsigned get_nchan () const
 Get the number of frequency channels.
 
unsigned get_ndat () const
 Get the number of datum in each of the nchan*npol divisions.
 
unsigned get_ndim () const
 Get the dimension of each datum (e.g. 2=complex 8=Jones)
 
virtual bool matches (const Shape *shape)
 Returns true if the npol, nchan, and ndat dimensions match.
 
void scrunch_to (unsigned ndat)
 Scrunch each dimension to a new ndat.
 
void rotate (int npt)
 Rotate data so that Shape[i] = Shape[i+npt].
 
void zero ()
 Set all values to zero.
 
void zero_dimensions ()
 Set all dimnensions to zero; allocated memory unaffected.
 
void borrow (const Shape &, unsigned ichan=0)
 Borrow the data from the specified channel of another Shape.
 
const Shapeoperator/= (float factor)
 Divide each point by factor.
 
const Shapeoperator*= (float factor)
 Multiply each point by factor.
 
const Shapeoperator+= (const Shape &)
 Add another Shape to this one.
 
float * get_datptr (unsigned ichan, unsigned ipol)
 Provide access to the data for the specified polarization.
 
const float * get_datptr (unsigned ichan, unsigned ipol) const
 Provide access to the data for the specified polarization.
 
- Public Member Functions inherited from OwnStream
 OwnStream (const OwnStream &)
 
const OwnStreamoperator= (const OwnStream &)
 
virtual void set_cout (std::ostream &) const
 
virtual void set_cerr (std::ostream &) const
 
- Public Member Functions inherited from Reference::Able
 Able (const Able &)
 
Ableoperator= (const Able &)
 
unsigned get_reference_count () const
 
- Public Member Functions inherited from Reference::HeapTracked
 HeapTracked (const HeapTracked &)
 
HeapTrackedoperator= (const HeapTracked &)
 
bool __is_on_heap () const
 

Additional Inherited Members

- Static Public Member Functions inherited from Reference::Able
static size_t get_instance_count ()
 
- Static Public Member Functions inherited from Reference::HeapTracked
static void * operator new (size_t size, void *ptr=0)
 
static void operator delete (void *location, void *ptr)
 
static void operator delete (void *location)
 
static size_t get_heap_queue_size ()
 
- Static Public Attributes inherited from dsp::Shape
static bool verbose = false
 
- Protected Member Functions inherited from dsp::Shape
void init ()
 
void size_dataspace ()
 
void destroy ()
 
- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 
void __dereference (bool auto_delete=true) const
 
- Protected Attributes inherited from dsp::Shape
float * buffer
 Data points.
 
unsigned bufsize
 Size of the data buffer.
 
unsigned offset
 Offset between datum from each polarization.
 
unsigned npol
 Number of polarizations.
 
unsigned nchan
 Number of frequency divisions (channels)
 
unsigned ndat
 Number of datum in each of the npol*nchan divisions.
 
unsigned ndim
 Dimension of each datum.
 
bool borrowed
 Flag that data are borrowed from another Shape.
 

Detailed Description

Various apodizing (window) functions.

Member Function Documentation

◆ dump()

void dsp::Apodization::dump ( const std::string &  filename)

Write the window to a text file.

One row per value. Two columns: index value

◆ Tukey()

void dsp::Apodization::Tukey ( )

Create Tukey window function.

\method Tukey

A Tukey window is a top hat window with a Hann transition band. In other words, instead of abruptly transitioning to zero, it uses a Hann window to transition to zero.


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

Generated using doxygen 1.8.17