/************************************************** * Fichier : FastSymmlet8.C * Format : ANSI C++ * * (c) 1998-2002 Daniel Lemire, Ph.D. * http://www.ondelette.com/ - wavelet forum - forum sur les ondelettes * * Last modified on March 6th 1998 * Dernière modification le 6 mars 1998 * * Free for any use, but this copyright notice must remain. * Provide as is. Use at your risks. * * Gratuit pour toute utilisation, mais préservez cette mention. * Sans garantie aucune, utilisez à vos risques. * * C++ implementation of the Symmlet8 wavelet. * See end of the file for usage. * * Cette classe utilise les ondelettes Symmlet8. Son * utilisation est très simple (voir la fin du fichier * pour un exemple). Elle suppose des conditions périodiques * aux bords. * ***************************************************/ #include static const float scale[8] = {0.0322231006040782f, -0.0126039672622638f, -0.0992195435769564f, 0.297857795605605f, 0.803738751805386f, 0.497618667632563f, -0.0296355276459604f, -0.0757657147893567f}; static const float wavelet[8] = {0.0757657147893567f, -0.0296355276459604f, -0.497618667632563f, 0.803738751805386f, -0.297857795605605f, -0.0992195435769564f, 0.0126039672622638f, 0.0322231006040782f}; /************************************************ * An efficient implementation of * the Fast Wavelet Transform using * Symmlet8 wavelets (FBI fingerprints standard) *************************************************/ class FastSymmlet8 { public: static void transform (int,float *); static void invTransform (int,float *); static void expand (int,float *); class NotAPowerOf2Exception{}; class NotDivisibleBy2Exception{}; static void invTransform(int,float *, int); static void transform(int,float *, int); private: }; void FastSymmlet8::transform(int length,float * v, int last) { float * ans=new float[last]; for(int k=0;k8;last/=2) { transform(length,v,last); } if(last!=8) { cout<< "Attention : n'est pas une puissance de 2 : " << length << endl; cout<< "Careful : not a power of 2 : " << length << endl; throw NotAPowerOf2Exception(); } } void FastSymmlet8::invTransform(int length, float * v, int last) { int ResultingLength=2*last; float * ans=new float[ResultingLength]; for(int k=0;k