logSpace(frequency, 20000, 20,20000);
...
currentCurve->setSamples(frequency, amplitude, 20000);
...
#define qExp(x) ::exp(x)
#define qAtan2(y, x) ::atan2(y, x)
static void logSpace( double *array, int size, double xmin, double xmax )
{
if ( ( xmin <= 0.0 ) || ( xmax <= 0.0 ) || ( size <= 0 ) )
return;
const int imax = size - 1;
array[0] = xmin;
array[imax] = xmax;
const double lxmin = log( xmin );
const double lxmax = log( xmax );
const double lstep = ( lxmax - lxmin ) / double( imax );
for ( int i = 1; i < imax; i++ )
array[i] = qExp( lxmin + double( i ) * lstep );
}
logSpace(frequency, 20000, 20,20000);
...
currentCurve->setSamples(frequency, amplitude, 20000);
...
#define qExp(x) ::exp(x)
#define qAtan2(y, x) ::atan2(y, x)
static void logSpace( double *array, int size, double xmin, double xmax )
{
if ( ( xmin <= 0.0 ) || ( xmax <= 0.0 ) || ( size <= 0 ) )
return;
const int imax = size - 1;
array[0] = xmin;
array[imax] = xmax;
const double lxmin = log( xmin );
const double lxmax = log( xmax );
const double lstep = ( lxmax - lxmin ) / double( imax );
for ( int i = 1; i < imax; i++ )
array[i] = qExp( lxmin + double( i ) * lstep );
}
To copy to clipboard, switch view to plain text mode
Bookmarks