Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

KaiserBessel Class Reference

1-D Kaiser-Bessel window function class. More...

#include <util_sparx.h>

Inheritance diagram for KaiserBessel:

[legend]
List of all members.

Public Member Functions

 KaiserBessel (float alpha_, int K, float r_, float v_, int N_, float vtable_=0.f, int ntable_=5999)
virtual ~KaiserBessel ()
float I0table_maxerror ()
 Compute the maximum error in the table.
vector< float > dump_table ()
virtual float sinhwin (float x) const
 Kaiser-Bessel Sinh window function.
virtual float i0win (float x) const
 Kaiser-Bessel I0 window function.
float i0win_tab (float x) const
 Kaiser-Bessel I0 window function (uses table lookup).
int get_window_size () const
 Return the size of the I0 window.
kbsinh_win get_kbsinh_win ()
 Sinh window function object factory.
kbi0_win get_kbi0_win ()
 I0 window function object factory.

Protected Member Functions

virtual void build_I0table ()
 2*pi*alpha*r*vadjust

Protected Attributes

float alpha
float v
float r
int N
 Kaiser-Bessel parameters.
int K
 size in Ix-space
float vtable
 I0 window size.
int ntable
 table I0 non-zero domain maximum
vector< float > i0table
float dtable
float alphar
 table spacing
float fac
 alpha*r
float vadjust
 2*pi*alpha*r*v
float facadj
float fltb
 Tabulate I0 window for speed.

Detailed Description

1-D Kaiser-Bessel window function class.

(It's a class so that the windowing parameters may be instantiated and held in the instance object.)

The I0 version can be tabulated and interpolated upon demand, but the max error needs to be checked. The "vtable" parameter corresponds to the maximum value of x for which the I0 window is non-zero. Setting "vtable" different from "v" corresponds to a change in units of x. In practice, it is often handy to replace x in some sort of absolute units with x described in terms of grid intervals.

The get_kbsinh_win and get_kbi0_win functions return single-argument function objects, which is what a generic routine is likely to want.

See also:
P. A. Penczek, R. Renka, and H. Schomberg, J. Opt. Soc. Am. _21_, 449 (2004)

Definition at line 224 of file util_sparx.h.


Constructor & Destructor Documentation

KaiserBessel::KaiserBessel float  alpha_,
int  K,
float  r_,
float  v_,
int  N_,
float  vtable_ = 0.f,
int  ntable_ = 5999
 

virtual KaiserBessel::~KaiserBessel  )  [inline, virtual]
 

Definition at line 244 of file util_sparx.h.

00244 {};


Member Function Documentation

virtual void KaiserBessel::build_I0table  )  [protected, virtual]
 

2*pi*alpha*r*vadjust

Reimplemented in FakeKaiserBessel.

vector<float> KaiserBessel::dump_table  )  [inline]
 

Definition at line 247 of file util_sparx.h.

00247                                            {
00248                         return i0table;
00249                 }

kbi0_win KaiserBessel::get_kbi0_win  )  [inline]
 

I0 window function object factory.

Definition at line 294 of file util_sparx.h.

00294                                         {
00295                         return kbi0_win(*this);
00296                 }

kbsinh_win KaiserBessel::get_kbsinh_win  )  [inline]
 

Sinh window function object factory.

Definition at line 280 of file util_sparx.h.

00280                                             {
00281                         return kbsinh_win(*this);
00282                 }

int KaiserBessel::get_window_size  )  const [inline]
 

Return the size of the I0 window.

Definition at line 268 of file util_sparx.h.

Referenced by KaiserBessel::kbi0_win::get_window_size(), and KaiserBessel::kbsinh_win::get_window_size().

00268 { return K; }

float KaiserBessel::I0table_maxerror  ) 
 

Compute the maximum error in the table.

virtual float KaiserBessel::i0win float  x  )  const [virtual]
 

Kaiser-Bessel I0 window function.

Reimplemented in FakeKaiserBessel.

Referenced by KaiserBessel::kbi0_win::operator()().

float KaiserBessel::i0win_tab float  x  )  const [inline]
 

Kaiser-Bessel I0 window function (uses table lookup).

Definition at line 255 of file util_sparx.h.

References x.

00255                                                       {
00256                 /*float absx = fabs(x);
00257                         int loc = int(round(absx*fltb));
00258                         return i0table[loc];*/
00259                         float xt;
00260                         if(x<0.f) xt = -x*fltb+0.5f; else xt = x*fltb+0.5f;
00261                         return i0table[ (int) xt];
00262                         /*return i0table[ (int) (fabs(x)*fltb+0.5f)];
00263                                 if (absx > vtable) return 0.f;
00264                                 float loc = absx/dtable;
00265                                 return i0table[int(loc + 0.5f)]; */
00266                 }

virtual float KaiserBessel::sinhwin float  x  )  const [virtual]
 

Kaiser-Bessel Sinh window function.

Reimplemented in FakeKaiserBessel.

Referenced by KaiserBessel::kbsinh_win::operator()().


Member Data Documentation

float KaiserBessel::alpha [protected]
 

Definition at line 227 of file util_sparx.h.

float KaiserBessel::alphar [protected]
 

table spacing

Definition at line 234 of file util_sparx.h.

float KaiserBessel::dtable [protected]
 

Definition at line 233 of file util_sparx.h.

float KaiserBessel::fac [protected]
 

alpha*r

Definition at line 235 of file util_sparx.h.

float KaiserBessel::facadj [protected]
 

Definition at line 237 of file util_sparx.h.

float KaiserBessel::fltb [protected]
 

Tabulate I0 window for speed.

Definition at line 239 of file util_sparx.h.

vector<float> KaiserBessel::i0table [protected]
 

Definition at line 232 of file util_sparx.h.

int KaiserBessel::K [protected]
 

size in Ix-space

Definition at line 229 of file util_sparx.h.

int KaiserBessel::N [protected]
 

Kaiser-Bessel parameters.

Definition at line 228 of file util_sparx.h.

int KaiserBessel::ntable [protected]
 

table I0 non-zero domain maximum

Definition at line 231 of file util_sparx.h.

float KaiserBessel::r [protected]
 

Definition at line 227 of file util_sparx.h.

float KaiserBessel::v [protected]
 

Definition at line 227 of file util_sparx.h.

float KaiserBessel::vadjust [protected]
 

2*pi*alpha*r*v

Definition at line 236 of file util_sparx.h.

float KaiserBessel::vtable [protected]
 

I0 window size.

Definition at line 230 of file util_sparx.h.


The documentation for this class was generated from the following file:
Generated on Fri Apr 30 15:39:11 2010 for EMAN2 by  doxygen 1.3.9.1