diff --git a/rexperiment.c b/rexperiment.c deleted file mode 100644 index db4fee5168f6e4bab27f3cbd3c7f168e5d55bb64..0000000000000000000000000000000000000000 --- a/rexperiment.c +++ /dev/null @@ -1,295 +0,0 @@ -/* - * - * postfish - * - * Copyright (C) 2002-2004 Monty and Xiph.Org - * - * Postfish is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * Postfish is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Postfish; see the file COPYING. If not, write to the - * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - */ - -/* arbitrary reconstruction filter. Postfish uses this for declipping. - - Many thanks to Johnathan Richard Shewchuk and his excellent paper - 'An Introduction to the Conjugate Gradient Method Without the - Agonizing Pain' for the additional understanding needed to make the - n^3 -> n^2 log n jump possible. Google for it, you'll find it. */ - -#include -#include "smallft.h" - -static void drft_forward_transpose(drft_lookup *fft, double *x){ - int i; - - for(i=1;in-1;i++)x[i]*=.5; - drft_backward(fft,x); -} - -static void drft_backward_transpose(drft_lookup *fft, double *x){ - int i; - - drft_forward(fft,x); - for(i=1;in-1;i++)x[i]*=2.; -} - -#include "postfish.h" -#include "test.h" - -static void sliding_bark_average(double *f,double *w, int n){ - int lo=0,hi=0,i; - double acc=0.; - - { - double bark=toBark(0); - int newhi=rint(fromBark(bark+.5)*n/44100.)+5; - acc+=fabs(f[0]); - for(hi=1;hin/2)newhi=n/2; - - for(;hie*e*phi_0;i++){ - compute_AtAx(fft,d,w,flag,1,n,q); - alpha=phi_new/inner_product(d,q,n); - for(j=0;je*e*phi_0;i++){ - compute_AtAx(fft,d,w,flag,1,n,q); - alpha=phi_new/inner_product(d,q,n); - for(j=0;j=.2 || work[i]<=-.2)flag[i]=1; - } - - for(i=0;i<512;i++)work[i]*=window[i]; - - for(i=0;i<512;i++)_analysis("pcm",i,work,512,0,0); - memcpy(freq,work,sizeof(work)); - drft_forward(&fft,freq); - for(i=0;i<512;i++)_analysis("freq",i,freq,512,1,1); - - sliding_bark_average(freq,w,blocksize); - _analysis("w",0,w,512,1,1); - - for(i=0;i<512;i++)w[i]= 1./(w[i]*w[i]); - - reconstruct2(&fft,work,w,flag,0,blocksize,blocksize); - -} - -