#include <util_sparx.h>
Inheritance diagram for KaiserBessel:
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. |
(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.
Definition at line 223 of file util_sparx.h.
|
|
|
Definition at line 243 of file util_sparx.h. 00243 {};
|
|
2*pi*alpha*r*vadjust
Reimplemented in FakeKaiserBessel. |
|
Definition at line 246 of file util_sparx.h. 00246 {
00247 return i0table;
00248 }
|
|
I0 window function object factory.
Definition at line 293 of file util_sparx.h. 00293 { 00294 return kbi0_win(*this); 00295 }
|
|
Sinh window function object factory.
Definition at line 279 of file util_sparx.h. 00279 { 00280 return kbsinh_win(*this); 00281 }
|
|
Return the size of the I0 window.
Definition at line 267 of file util_sparx.h. Referenced by KaiserBessel::kbi0_win::get_window_size(), and KaiserBessel::kbsinh_win::get_window_size(). 00267 { return K; }
|
|
Compute the maximum error in the table.
|
|
Kaiser-Bessel I0 window function.
Reimplemented in FakeKaiserBessel. Referenced by KaiserBessel::kbi0_win::operator()(). |
|
Kaiser-Bessel I0 window function (uses table lookup).
Definition at line 254 of file util_sparx.h. References x. 00254 { 00255 /*float absx = fabs(x); 00256 int loc = int(round(absx*fltb)); 00257 return i0table[loc];*/ 00258 float xt; 00259 if(x<0.f) xt = -x*fltb+0.5f; else xt = x*fltb+0.5f; 00260 return i0table[ (int) xt]; 00261 /*return i0table[ (int) (fabs(x)*fltb+0.5f)]; 00262 if (absx > vtable) return 0.f; 00263 float loc = absx/dtable; 00264 return i0table[int(loc + 0.5f)]; */ 00265 }
|
|
Kaiser-Bessel Sinh window function.
Reimplemented in FakeKaiserBessel. Referenced by KaiserBessel::kbsinh_win::operator()(). |
|
Definition at line 226 of file util_sparx.h. |
|
table spacing
Definition at line 233 of file util_sparx.h. |
|
Definition at line 232 of file util_sparx.h. |
|
alpha*r
Definition at line 234 of file util_sparx.h. |
|
Definition at line 236 of file util_sparx.h. |
|
Tabulate I0 window for speed.
Definition at line 238 of file util_sparx.h. |
|
Definition at line 231 of file util_sparx.h. |
|
size in Ix-space
Definition at line 228 of file util_sparx.h. |
|
Kaiser-Bessel parameters.
Definition at line 227 of file util_sparx.h. |
|
table I0 non-zero domain maximum
Definition at line 230 of file util_sparx.h. |
|
Definition at line 226 of file util_sparx.h. |
|
Definition at line 226 of file util_sparx.h. |
|
2*pi*alpha*r*v
Definition at line 235 of file util_sparx.h. |
|
I0 window size.
Definition at line 229 of file util_sparx.h. |