#include <util.h>
Public Member Functions | |
sincBlackman (int M_, float fc_, int ntable_=1999) | |
virtual | ~sincBlackman () |
float | sBwin_tab (float x) const |
int | get_sB_size () const |
Return the size of the kernel. | |
Protected Member Functions | |
virtual void | build_sBtable () |
Protected Attributes | |
int | M |
float | fc |
kernel size | |
int | ntable |
cut-off frequency | |
vector< float > | sBtable |
float | fltb |
Tabulate kernel for speed. |
Definition at line 260 of file util.h.
Util::sincBlackman::sincBlackman | ( | int | M_, | |
float | fc_, | |||
int | ntable_ = 1999 | |||
) |
Definition at line 1961 of file util_sparx.cpp.
References build_sBtable().
01962 : M(M_), fc(fc_), ntable(ntable_) { 01963 // Sinc-Blackman kernel 01964 build_sBtable(); 01965 }
virtual EMAN::Util::sincBlackman::~sincBlackman | ( | ) | [inline, virtual] |
void Util::sincBlackman::build_sBtable | ( | ) | [protected, virtual] |
Definition at line 1967 of file util_sparx.cpp.
References fc, fltb, M, ntable, EMAN::Util::round(), sBtable, twopi, and x.
Referenced by sincBlackman().
01967 { 01968 sBtable.resize(ntable+1); 01969 int ltab = int(round(float(ntable)/1.25f)); 01970 int M2 = M/2; 01971 fltb = float(ltab)/M2; 01972 for (int i=ltab+1; i <= ntable; i++) sBtable[i] = 0.0f; 01973 float x = 1.0e-7f; 01974 sBtable[0] = (float)(sin(twopi*fc*x)/x*(0.52-0.5*cos(twopi*(x-M2)/M)+0.08*cos(2*twopi*(x-M2)/M))); 01975 for (int i=1; i <= ltab; i++) { 01976 x = float(i)/fltb; 01977 sBtable[i] = (float)(sin(twopi*fc*x)/x*(0.52-0.5*cos(twopi*(x-M2)/M)+0.08*cos(2*twopi*(x-M2)/M))); 01978 //cout << " "<<x<<" "<<sBtable[i] <<endl; 01979 } 01980 }
int EMAN::Util::sincBlackman::get_sB_size | ( | ) | const [inline] |
Return the size of the kernel.
Definition at line 279 of file util.h.
Referenced by EMAN::EMData::get_pixel_filtered().
float EMAN::Util::sincBlackman::sBwin_tab | ( | float | x | ) | const [inline] |
float EMAN::Util::sincBlackman::fc [protected] |
float EMAN::Util::sincBlackman::fltb [protected] |
int EMAN::Util::sincBlackman::M [protected] |
int EMAN::Util::sincBlackman::ntable [protected] |
vector<float> EMAN::Util::sincBlackman::sBtable [protected] |