DSPRelated.com
Forums

Coefficients for A-weighting filter

Started by Robert Adams December 15, 2006
On Sun, 17 Dec 2006 07:50:21 -0500, Greg Berchin <gberchin@comicast.net>
wrote:

>And here's a nice 48 kHz set:
Unfortunately, I just discovered that it's unstable. It happens, sometimes, with approximation functions. I'll keep working on it and post a stable solution if I find one. -- Greg
"Jerry Avins" <jya@ieee.org> wrote in message 
news:9r-dnZb60rzTthnYnZ2dnUVZ_u2mnZ2d@rcn.net...
> Al Clark wrote: >> Jerry Avins <jya@ieee.org> wrote in >> news:RoWdnS_wtccSihnYnZ2dnUVZ_qDinZ2d@rcn.net: >> >>> Greg Berchin wrote: >>>> On 15 Dec 2006 22:23:53 -0800, "robert bristow-johnson" >>>> <rbj@audioimagination.com> wrote: >>>> >>>>> it oughta be okay to just apply the BLT* to the poles/zeros to get a >>>>> digital filter. >>>> Depends upon the sampling rate. That 12200 Hz pole pair makes life >>>> very >>>> difficult for the Bilinear Transform method if the sampling is 44100. >>> What about upsampling before the filter and downsampling after it? >>> Anyhow, is there a phase spec too? I see no reason for one in a >>> weighting scheme. >>> >>> Jerry >> >> This has always been one of my solution approaches. It costs a bit more >> in computation. You still need to over sample by quite a bit if you want >> the curve to be very accurate since warping is still significant at >> 20-30KHz. > > Prewarping will put the corner frequencies in the right place. The problem > lies in the curve between them. It probably won't depart too severely even > with a 3:1 oversampling rate, and 2:1 might be good enough. Has anyone > tried? Experience beats speculation every time. >
I would speculate that you are right, but...
> Jerry > -- > Engineering is the art of making what you want from things you can get. > &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"robert bristow-johnson" <rbj@audioimagination.com> schrieb im Newsbeitrag 
news:1166377947.282558.324210@t46g2000cwa.googlegroups.com...
> > Gerold Schrutz wrote: >> Hello Bob, >> >> I'll send it to you via email. >> > > why not post it? c'mon! spread the joy. it's the christmas season. > > r b-j >
Hello Robert, I've got an C++ Object with coefs, filter structure, ..., so its hard to post it! If you want to have it, just give me a note. Regards Gerold
Presumably the order of this filter is low enough that one of the
factoring programs would work on it (to get cascaded biquads); if so,
then I would guess that some of the large coefficients causing rbj's
incontinence issues would be dramatically lower.


Bob




Greg Berchin wrote:
> And here's a nice 48 kHz set: > > B = > > 0.0788042432386599 > 1.98740981801491 > 8.73124941247807 > 4.85523075703508 > -24.0633322613029 > -25.9677083336681 > 18.4836542507029 > 29.3655876043784 > -0.12131067674808 > -10.1662534649231 > -3.09813678180496 > -0.0851945103082358 > > > A = > > 1 > 9.83985722696 > 14.2961663538284 > -27.8332539559425 > -47.4356190712194 > 27.1537187137894 > 49.4127654955485 > -9.81477544218375 > -19.1853035970187 > 0.994392652452719 > 1.82439680111452 > -0.251378021490288 > -- Greg
On 18 Dec 2006 04:05:04 -0800, "Robert Adams" <robert.adams@analog.com>
wrote:

>Presumably the order of this filter is low enough that one of the >factoring programs would work on it (to get cascaded biquads);
That's actually how I discovered that it was unstable -- I did a partial fraction decomposition and found to my horror that some of the poles lie outside the unit circle. Greg
robert bristow-johnson <rbj@audioimagination.com> wrote:
> > Gerold Schrutz wrote: >> Hello Bob, >> >> I'll send it to you via email. >> > > why not post it? c'mon! spread the joy. it's the christmas season.
My solution : ======================== fs=48000; % Analog filter B=[1 0 0 0 0]; Ar=[-20.6 -20.6 -107.7 -737.9 -12200 -12200 ]*2*pi; A=poly(Ar); % Digital filter b=[1 -1]; b=conv(b,b); b=conv(b,b); b=conv(b,[1 .3 ]); % Magic differentiator correction - to be optimized a=poly(exp(Ar/fs/2)); f=linspace(0,fs/2,16*1024); H=freqs(B,A,2*pi*f); H=H/max(abs(H)); h=freqz(b,a,f/fs*pi); h=h/max(abs(h)); %semilogx(f,[abs(H);abs(h)]); loglog(f,[abs(H);abs(h)]); %semilogx(f,[unwrap(angle(H));unwrap(angle(h))]); disp('b='); fprintf('%0.16f\n',b) disp('a='); fprintf('%0.16f\n',a) ======================= b= 1.0000000000000000 -3.7000000000000002 4.7999999999999998 -2.2000000000000002 -0.2000000000000000 0.3000000000000000 a= 1.0000000000000000 -4.8431509604790124 9.5812763956502831 -9.8758665218481614 5.5715967697266429 -1.6249444537578395 0.1910887708899461
As promised, here's a STABLE 48kHz set.  See other thread if interested
in explanation as to why the previous set was unstable.

This set is designed for best performance between 20 Hz and 20 kHz.

-- Greg

B =

          0.01147155239724
       -0.0248548824653166
        0.0323052801494283
       -0.0555571372813964
         0.233784933167266
         0.392882400411297
        -0.633249911806281
        -0.479494344932334
         0.322061493940389
         0.197659563091056
       0.00299879461389451


A =

                         1
        -0.925699454182466
        -0.992471193943543
         0.837650096562845
          0.22307303912603
        -0.158404327757755
        0.0184103295763937

>> r = roots(A)
r = 0.984489804082767 0.908244149298272 -0.769257838893508 -0.610778368915081 0.206500854305008 + 0.0343422917678848i 0.206500854305008 - 0.0343422917678848i
>>
Greg Berchin wrote:
> As promised, here's a STABLE 48kHz set. See other thread if interested > in explanation as to why the previous set was unstable. > > This set is designed for best performance between 20 Hz and 20 kHz.
so what did you have to do? reflect the unstable poles into the interior of the unit circle? r b-j
On 21 Dec 2006 14:10:13 -0800, "robert bristow-johnson"
<rbj@audioimagination.com> wrote:

>so what did you have to do? reflect the unstable poles into the >interior of the unit circle?
Naw, I just implemented the algorithm CORRECTLY. Greg
Greg Berchin <gberchin@comicast.net> writes:

> On 21 Dec 2006 14:10:13 -0800, "robert bristow-johnson" > <rbj@audioimagination.com> wrote: > >>so what did you have to do? reflect the unstable poles into the >>interior of the unit circle? > > Naw, I just implemented the algorithm CORRECTLY.
Hi Greg, What I hear you saying is that, for a specific design, you had a problem in your implementation that resulted in an unstable set of coefficients. What I'm wondering is if it can be proven that the algorithm in general will produce a stable IIR transfer function, i.e., how can you guarantee the poles it generates are always inside the unit circle? -- % Randy Yates % "And all that I can do %% Fuquay-Varina, NC % is say I'm sorry, %%% 919-577-9882 % that's the way it goes..." %%%% <yates@ieee.org> % Getting To The Point', *Balance of Power*, ELO http://home.earthlink.net/~yatescr