[linux-audio-dev] Re: chebychev

Steve Harris S.W.Harris at ecs.soton.ac.uk
Fri Nov 1 10:59:01 UTC 2002

On Fri, Nov 01, 2002 at 03:13:28 +0100, Tim Goetze wrote:
> >Blackman-Harris has the best sidelobe rejection, which is probably what we
> just to make sure we're talking about the same thing:
> double blackman (int i)
> {
>   return 0.42
>     - 0.5 * cos (2 * (double) i * M_PI / WINDOW)
>     + 0.08 * cos (4 * (double) i * M_PI / WINDOW);
> }

I have:

double arg = 2.0 * M_PI / (double)(FRAME_LENGTH-1);

for (i=0; i < FRAME_LENGTH; i++) {
	// Blackman-Harris
	window[i] = 0.35875f - 0.48829f * cos(arg * (float)i) + 0.14128f *
                    cos(2.0f * arg * (float)i) - 0.01168f *
                    cos(3.0f * arg * (float)i);
	// Gain correction
	window[i] *= 0.761f;

But mine could just be unoptimised.

> just did the same plot with applying the above window before the FT;
> it does not look fundamentally different. plot is at
> http://quitte.de/spectral-evolution-windowed.gif

Well, the noise floor is lower and the harmincs are sharper, which is what
you would expect for a better analysis window. It shows that the harmonics
really are coming and going though.

> >It does. Well in my randomly picked test set it did, when the harmonic
> >amplitudes are real it may be smoother. I'l clean up the code later, make
> >it LERP between harmonic sets and send it to you, but I have sleave for
> >work now.  
> could be we can get away with something like a simple four-sample
> xfade, though that could introduce unrelated harmonics. better
> than an unmasked discontinuity still. hmmm.

Well, I think its best to develop with maximum wuality, then when its
working, work out how much we can reduce the CPU cost and still have it
sound good.
> >Interesting. It takes 1/2 as much as a single (optimised) valve here.
> did some tests with valve and harmonic_gen at different frames/cycle,
> the results seem to support my above cache theory; the chebyshev
> is costing a lot less at larger block sizes than the valve. you run
> them at 128/44.1 i understand?

For realtime, but I do my performance test at 1024/44, silly really, but I
have a patched applyplugin that reports cycle cost.
> good god. know an alternative source for calculating the
> coefficients? Bill?

I have some text books that will have it in, I can compare that to NR.

- Steve

More information about the Linux-audio-dev mailing list