Update of /cvsroot/foo/foo/libfoo/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23620
Modified Files:
FOOGlobalsManager.m FOOModule.m FOOSineXoverXTable.m
Log Message:
FOOGlobalsManager: let schemeOutput: print to stdout instead of stderr.
FOOModule: ommit first 4 characters when printing (FOOM),
reenabled value printing of FOOMConstant (ugly, printing should be handled by subclasses later).
FOOSineXOverXTable: correct bug in bessel approximation. kaiser window still #undef. marked suspected bugs, but let alone so far.
Index: FOOModule.m
===================================================================
RCS file: /cvsroot/foo/foo/libfoo/src/FOOModule.m,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** FOOModule.m 17 Aug 2004 05:51:56 -0000 1.7
--- FOOModule.m 27 Aug 2004 06:19:10 -0000 1.8
***************
*** 41,47 ****
--- 41,50 ----
#include "FOO/FOONilModule.h"
+ // for printing. not nice.
+ #include "../modules/orthodox/FOOMConstant.h"
// static FOONilModule *_nilModule = nil;
+
@implementation FOOModule
***************
*** 196,211 ****
{
/* this is not the right place
! * should be overloaded in FOOConstant
*/
! // if ([self isKindOfClass: [FOOConstant class]])
! // {
! // sprintf(printBuffer + level, "(%s [%.6lg]",
! // [[[self class] description] cString],
! // (double)[((FOOConstant*)self) getValue]);
! // }
! // else
!
{
! sprintf(printBuffer + level, "(%s", [[[self class] description] cString]);
}
}
--- 199,213 ----
{
/* this is not the right place
! * should be overloaded in FOOMConstant
*/
! if ([self isKindOfClass: [FOOMConstant class]])
{
! sprintf(printBuffer + level, "(%s [%.6lg]",
! [[[self class] description] cString] + 4,
! (double)[((FOOMConstant*)self) getValue]);
! }
! else
! {
! sprintf(printBuffer + level, "(%s", [[[self class] description] cString] + 4);
}
}
Index: FOOSineXoverXTable.m
===================================================================
RCS file: /cvsroot/foo/foo/libfoo/src/FOOSineXoverXTable.m,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FOOSineXoverXTable.m 26 Aug 2004 09:47:52 -0000 1.3
--- FOOSineXoverXTable.m 27 Aug 2004 06:19:10 -0000 1.4
***************
*** 38,46 ****
#include "FOO/FOOSineXoverXTable.h"
! // #define KAISER_WINDOW // hanning window otherwise
#ifdef KAISER_WINDOW
! #define KAISER_KOEFF 5.6
static double
--- 38,48 ----
#include "FOO/FOOSineXoverXTable.h"
! // #define KAISER_WINDOW // hann window otherwise
#ifdef KAISER_WINDOW
! // what is the best value here?
! // #define KAISER_KOEFF 5.6
! #define KAISER_KOEFF 8.1
static double
***************
*** 54,58 ****
for (i = 1; i < 26; ++i)
{
! de *= y / x;
sde = de * de;
e += sde;
--- 56,60 ----
for (i = 1; i < 26; ++i)
{
! de *= y / (double)i;
sde = de * de;
e += sde;
***************
*** 92,119 ****
- (double) function: (double)x
{
! double xMax = _taps / 2 - .5;
if (x > xMax)
! {
! return 0;
}
! if (x == 0)
{
! return 1;
}
!
#ifdef KAISER_WINDOW
! double y = x * M_PI;
! y = sin(y) / y;
! y *= bessel0(KAISER_KOEFF * sqrt(1 - (2 * x * _scaler / ((_size - 1) * 2)) * (2 * x * _scaler / ((_size - 1) * 2)))) / _besselconst;
! return y;
! #else // hanning window
! x *= M_PI;
! return ((sin(x) / x) * (cos(x / xMax) / 2. + .5));
#endif
}
--- 94,126 ----
- (double) function: (double)x
{
! double xMax = _taps / 2 - .5; // bug ???
! // double xMax = _taps / 2;
! double y;
if (x > xMax)
! {
! y = 0;
}
! else if (x == 0)
{
! y = 1;
}
! else
! {
#ifdef KAISER_WINDOW
! y = x * M_PI;
! y = sin(y) / y;
! y *= bessel0(KAISER_KOEFF * sqrt(1 - (x * _scaler / _size) * (x * _scaler / _size))) / _besselconst;
! #else // hann window
! x *= M_PI;
! y = (sin(x) / x) * (cos(x / xMax) / 2. + .5);
#endif
+ }
+
+ return y;
}
Index: FOOGlobalsManager.m
===================================================================
RCS file: /cvsroot/foo/foo/libfoo/src/FOOGlobalsManager.m,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** FOOGlobalsManager.m 19 Aug 2004 20:51:05 -0000 1.7
--- FOOGlobalsManager.m 27 Aug 2004 06:19:09 -0000 1.8
***************
*** 103,108 ****
+ (void) schemeOutput: (NSString *)string
{
! fprintf(stderr, "%s", [string cString]);
! fflush(stderr);
}
--- 103,108 ----
+ (void) schemeOutput: (NSString *)string
{
! printf("%s", [string cString]);
! fflush(stdout);
}
|