shiftgabormp.h
来自「C++语言写的小波变换和傅立叶变换的源代码」· C头文件 代码 · 共 47 行
H
47 行
// ShiftGaborMP.h#ifndef SHIFTGABORMP_H#define SHIFTGABORMP_H#include "Gabor.h"#include "Partition.h"#include <vector.h>// Functions which runs MP algorithm until epsilon precision is achieved// i.e. |Rf|<epsilon, or maximal number of iterations is performed. // It makes repeated calls to getOptimalShiftGabor function.// Works for any dimension of the signal, slower algorithmreal RunShiftGaborMP(int max_iter, // maximal number of iterations real epsilon, // desired precision | Rf | < epsilon const Interval &f, // signal to be approximated // assumption : f sampled on integers starting with 0 // i.e. f.beg must be 0. No constraints on f.length. const Partition &Part, // partiton which defining //dictionary Interval &f_approx, // MP approximation of f // f_approx is a linear combination of Gabors Interval &Rf, // final residual: Rf = f - f_approx // error which is returned equals | Rf | vector <RealGabor> &G, // vector of Gabors chosen for // f_approx vector <real> & Gcoef // coeficinets in the linear // combination, corresponding to Gabors in G // f_approx = sum( Gcoef[i] * G[i] ), where number of i's // depends on epsilon and max_iter );// Given signal f, getOptimalShiftGabor finds Gabor function G // which is closest in // l2 norm to f, from the dictionary of Gabors defined by partition Part.// On output G is set to this optimal function, no sample for G created.// Also, on output coef = <f, G>void getOptimalShiftGabor(const Interval &f, // signal const Partition &Part, RealGabor &G, // optimal Gabor, the one closest to f real &coef // <f, G> );#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?