[Kst] kdeextragear-2/kst/plugins/pass_filters
Barth Netterfield
netterfield at astro.utoronto.ca
Sat Aug 28 00:24:46 CEST 2004
Good point. Will do.
cbn
On August 27, 2004 05:48 pm, Andrew Walker wrote:
> Shouldn't this also be done for the bandstop filter?
>
> -----Original Message-----
> From: Barth Netterfield [mailto:netterfield at astro.utoronto.ca]
> Sent: Friday, August 27, 2004 12:01 PM
> To: kde-cvs at kde.org
> Cc: kst at kde.org
> Subject: [Kst] kdeextragear-2/kst/plugins/pass_filters
>
>
> CVS commit by netterfield:
>
> Change the defaults to something possibly more useful
>
> The bandpass limits were not being used correctly: fixes this.
>
>
> M +14 -10 butterworth_bandpass/butterworth_bandpass.cpp 1.5
> M +3 -3 butterworth_bandpass/butterworth_bandpass.xml 1.7
> M +2 -2 butterworth_highpass/butterworth_highpass.xml 1.6
> M +2 -2 butterworth_lowpass/butterworth_lowpass.xml 1.6
>
>
> ---
> kdeextragear-2/kst/plugins/pass_filters/butterworth_bandpass/butterworth_ba
>ndpass.cpp #1.4:1.5 @@ -8,4 +8,5 @@
> #include <math.h>
> #include "../filters.h"
> +#include <gsl/gsl_pow_int.h>
>
> extern "C" int filter_bandpass(const double *const inArrays[], const int
> inArrayLens[], @@ -34,8 +35,11 @@ double filter_calculate( double dFreqVal
> double dValue;
>
> + int order2 = int(2.0*inScalars[0]);
> + double lp = inScalars[1] + 0.5*inScalars[2];
> + double hp = lp - inScalars[2];
> +
> if( dFreqValue > 0.0 ) {
> - dValue = (dFreqValue * dFreqValue) - (inScalars[1] * inScalars[1]);
> - dValue /= ( dFreqValue * inScalars[2] );
> - dValue = 1.0 / ( 1.0 + pow( dValue, 2.0 * (double)inScalars[0] ) );
> + dValue = 1.0 / ( 1.0 + gsl_pow_int( dFreqValue / lp, order2) );
> + dValue *= 1.0 / ( 1.0 + gsl_pow_int( hp / dFreqValue, order2) );
> } else {
> dValue = 0.0;
>
> ---
> kdeextragear-2/kst/plugins/pass_filters/butterworth_bandpass/butterworth_ba
>ndpass.xml #1.6:1.7 @@ -16,11 +16,11 @@
> </input>
> <input>
> -<float name="Order" descr="Order of the band pass filter." />
> +<float name="Order" descr="Order of the band pass filter." default="4"/>
> </input>
> <input>
> -<float name="Central frequency/sample rate" descr="Central frequency of
> the band pass filter." default="1" /> +<float name="Central
> frequency/sample rate" descr="Central frequency of the band pass filter."
> default="0.052" /> </input>
> <input>
> -<float name="Band width" descr="Width of the band pass filter."
> default="1" /> +<float name="Band width" descr="Width of the band pass
> filter." default="0.096" /> </input>
>
>
> ---
> kdeextragear-2/kst/plugins/pass_filters/butterworth_highpass/butterworth_hi
>ghpass.xml #1.5:1.6 @@ -16,8 +16,8 @@
> </input>
> <input>
> -<float name="Order" descr="Order of the high pass filter." />
> +<float name="Order" descr="Order of the high pass filter." default="4"/>
> </input>
> <input>
> -<float name="Cutoff frequency/sample rate" descr="Cutoff frequency of the
> high pass filter." default="1" /> +<float name="Cutoff frequency/sample
> rate" descr="Cutoff frequency of the high pass filter." default="0.02" />
> </input>
>
>
> ---
> kdeextragear-2/kst/plugins/pass_filters/butterworth_lowpass/butterworth_low
>pass.xml #1.5:1.6 @@ -16,8 +16,8 @@
> </input>
> <input>
> -<float name="Order" descr="Order of the low pass filter." />
> +<float name="Order" descr="Order of the low pass filter." default="4"/>
> </input>
> <input>
> -<float name="Cutoff frequency/sample rate" descr="Cutoff frequency of the
> low pass filter." default="1" /> +<float name="Cutoff frequency/sample
> rate" descr="Cutoff frequency of the low pass filter." default="0.1" />
> </input>
>
>
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
More information about the Kst
mailing list