I'm using the code in this book: Algorithms for the constrained design of digital filters with arbitrary phase and magnitude responses to compute nearly-linear-phase IIR EQs.
fvtool()
shows the correct Eq mag and phase, but when I try to apply the coefficients to some real sound, the output is very very high (silence due to overlimit), it seems very unstable.
Anyone could tell me why fvtool()
is ok but filter()
is wrong, maybe try the software?
http: vadkudr.org/Algorithms/LangIIR/LangIIR_examples.html
Jeff
EDIT:
Try these coefficients:
a =
1.00
-7057018074799500.00
7419034985051048.00
-2710509977123811.00
3321548070644472.50
19380841977826980.00
-10366336133286466.00
-17395746351478384.00
-241875435346629.44
1537628108108181.70
-7101604243654517.00
7251792090687912.00
23447717670347684.00
-11610491157524712.00
-10852963123569024.00
5000000000000001.00
b =
-65252253992.00
29593281937568.00
31626970863960.00
-7964372882016.00
-32245859702352.00
-25890947971080.00
-10668161380760.00
-4361278103120.00
11507726488128.00
24495364570416.00
6689249360480.00
and the code to write the ouput file:
input= wavread('sine+noiz.wav');
output2=filter(b,a,input);
output2=output2/norm(output2);
wavwrite(output2, 44100, 'e:\sine+noiz2_out.wav');
EDIT 2:
Here is full working code and audio files
EDIT 3:
Okay I figured out where the problem was coming from: to make a lowpass at a very low frequency, you have to add more Zeros : the lower the cutoff frequency, the higher the number of zeros necessary...so then it works
But I still don't know why fvtool()
shows an ok filter but then the actual computation of an audio file fails...
a
are the denominator coefficients, i.e. you want 45 poles??? Also, these coefficients do not correspond to any of the examples on Vadim's site. If you give me the design specs, I can come up with a reasonable design. The specification of the desired phase requires some experience. $\endgroup$