FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > DSP

DSP comp.dsp newsgroup, mailing list

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-29-2009, 01:52 PM
bogdank
Guest
 
Posts: n/a
Default A-weighting digital filter coefficients revisited

I found an old thread here while searching for the A-weighting digita
filter implementation. I could not find anywhere anything that would be a
good as what I need.

Here is my solution to this problem. Sampling rate is 48kHz. The analo
version was scaled for 0dB at 1kHz. Digital is a bit off, but you ma
rescale in case you need. The fit is within 0.01dB at the R10 frequencie
above 50Hz. I added the Nyquist as well (24kHz).

B =

0.589214923483986
-1.354062869116401
0.365725446154873
1.052098932622697
-0.648244326067481
-0.087685125674506
0.082953018596832

A =

1.000000000000000
-2.899480964464376
2.328381892680661
0.600615787272711
-1.702946701651670
0.789025253163357
-0.115591999005265

Poles =

-0.797259721522729
0.996014228151547
0.986008381848943
0.908480310415752
0.403139874571216
0.403097890999647

As you can see, one of the poles will end up relatively close to the uni
circle. If you're doing floating point, that should be OK. If you're doin
16-bit fixed point, you will need bi-quads and/or lattice to try avoidin
getting that pole to be pushed outside due to quantization.

I hope you will find this result useful.

Bogdan


Reply With Quote
  #2 (permalink)  
Old 05-29-2009, 05:04 PM
Vladimir Vassilevsky
Guest
 
Posts: n/a
Default Re: A-weighting digital filter coefficients revisited



bogdank wrote:

> I found an old thread here while searching for the A-weighting digital
> filter implementation. I could not find anywhere anything that would be as
> good as what I need.


Did you check the FDLS algorithm of Greg Berchin? It is specifically
designed for the problems like that. You can make the approximation as
close to the original analog function as you like.


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
Reply With Quote
  #3 (permalink)  
Old 05-29-2009, 05:40 PM
robert bristow-johnson
Guest
 
Posts: n/a
Default Re: A-weighting digital filter coefficients revisited

On May 29, 7:52*am, "bogdank" <bogd...@ti.com> wrote:
> I found an old thread here while searching for the A-weighting digital
> filter implementation. I could not find anywhere anything that would be as
> good as what I need.
>
> Here is my solution to this problem. Sampling rate is 48kHz. The analog
> version was scaled for 0dB at 1kHz. Digital is a bit off, but you may
> rescale in case you need. The fit is within 0.01dB at the R10 frequencies
> above 50Hz. I added the Nyquist as well (24kHz).
>
> B =
>
> * *0.589214923483986
> * -1.354062869116401
> * *0.365725446154873
> * *1.052098932622697
> * -0.648244326067481
> * -0.087685125674506
> * *0.082953018596832
>
> A =
>
> * *1.000000000000000
> * -2.899480964464376
> * *2.328381892680661
> * *0.600615787272711
> * -1.702946701651670
> * *0.789025253163357
> * -0.115591999005265
>
> Poles =
>
> * -0.797259721522729
> * *0.996014228151547
> * *0.986008381848943
> * *0.908480310415752
> * *0.403139874571216
> * *0.403097890999647
>
> As you can see, one of the poles will end up relatively close to the unit
> circle. If you're doing floating point, that should be OK. If you're doing
> 16-bit fixed point, you will need bi-quads and/or lattice to try avoiding
> getting that pole to be pushed outside due to quantization.
>
> I hope you will find this result useful.
>


looks very useful. are the B's on the top or are the A's on top? (i
haven't plopped this into Octave yet to see it.)

r b-j


Reply With Quote
  #4 (permalink)  
Old 05-29-2009, 07:28 PM
bogdank
Guest
 
Posts: n/a
Default Re: A-weighting digital filter coefficients revisited

Robert wrote:

>looks very useful. are the B's on the top or are the A's on top? (i
>haven't plopped this into Octave yet to see it.)


B is the numerator. A is the denominator. So, B's are on the top.

Bogdan

Reply With Quote
  #5 (permalink)  
Old 05-29-2009, 07:33 PM
bogdank
Guest
 
Posts: n/a
Default Re: A-weighting digital filter coefficients revisited

Vladimir wrote:

>Did you check the FDLS algorithm of Greg Berchin? It is specifically
>designed for the problems like that. You can make the approximation as
>close to the original analog function as you like.


No. I did not know about it. Thanks for pointing that out to me. I'll tr
to find it and check it out.

One concern I have is to keep the filter order as low as possible. I hav
seen many methods that require much higher filter orders to get th
solution to this type of problems. Actually, more general the algorith
less likely for it to work well in all cases.

For A-weighting type filter you may intuitively assume that the filte
order should not need to be too high due to relative simplicity of th
spectral response.

Thanks again for the information.

Bogdan
Reply With Quote
  #6 (permalink)  
Old 05-29-2009, 08:12 PM
Vladimir Vassilevsky
Guest
 
Posts: n/a
Default Re: A-weighting digital filter coefficients revisited



bogdank wrote:

> Vladimir wrote:
>
>>Did you check the FDLS algorithm of Greg Berchin? It is specifically
>>designed for the problems like that. You can make the approximation as
>>close to the original analog function as you like.

>
>
> No. I did not know about it. Thanks for pointing that out to me. I'll try
> to find it and check it out.


The MatLab and C code should be available on the net. Greg is the active
member of this NG also.

> One concern I have is to keep the filter order as low as possible.


With FDLS, you can try all sorts of combinations of denominator and
numerator orders and incurred delays. It is not obvious which one would
be the best.

> I have
> seen many methods that require much higher filter orders to get the
> solution to this type of problems. Actually, more general the algorithm
> less likely for it to work well in all cases.


How did you get your filter coefficients?

> For A-weighting type filter you may intuitively assume that the filter
> order should not need to be too high due to relative simplicity of the
> spectral response.


It would be straightforward if the sample rate is set, say, at 192kHz.
The hard part is the approximation in the vicinity of the Nyquist
frequency; this is where the filter order starts to increase.


> Thanks again for the information.
>
> Bogdan



Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
Reply With Quote
  #7 (permalink)  
Old 05-29-2009, 10:14 PM
bogdank
Guest
 
Posts: n/a
Default Re: A-weighting digital filter coefficients revisited

Vladimir wrote:


>How did you get your filter coefficients?


All I can say is that I optimized the zero and pole locations to fit th
A-weighting frequency response. I paid special attention to the following:

1. choice of frequencies used in sampling of the frequency response
2. constraints on locations of poles and zeros
3. choice of objective function used in optimization
4. choice of optimization algorithm

I cannot disclose further details.


>It would be straightforward if the sample rate is set, say, at 192kHz.
>The hard part is the approximation in the vicinity of the Nyquist
>frequency; this is where the filter order starts to increase.


Not as a general rule. That would depend on the choices you make. It woul
also depend on the type of spectral response. The A-weighting has nothin
special about Nyquist for 48kHz (or any other lower sampling rate). Th
spectral response is very simple, smooth and does not require much effor
at any specific frequency. In optimization you often have more troubl
getting good initial conditions or estimating gradients or spending time t
provide analytical form for the gradients.

Since this type of filter is often used only for power measurement, th
phase response is not an issue.

The only real concern is the quantization (in case of fixed poin
implementation) and possibility of getting poles to be kicked out of th
unit circle in the process. In that case you need to spend additional wor
on getting the proper filter structure and possibly convert it int
bi-quads and/or lattice...

Regards,
Bogdan
Reply With Quote
  #8 (permalink)  
Old 05-30-2009, 04:29 PM
Vladimir Vassilevsky
Guest
 
Posts: n/a
Default Re: A-weighting digital filter coefficients revisited



bogdank wrote:

> Vladimir wrote:
>
>
>
>>How did you get your filter coefficients?

>
>
> All I can say is that I optimized the zero and pole locations to fit the
> A-weighting frequency response. I paid special attention to the following:
>
> 1. choice of frequencies used in sampling of the frequency response
> 2. constraints on locations of poles and zeros
> 3. choice of objective function used in optimization
> 4. choice of optimization algorithm
>
> I cannot disclose further details.


Secret voodoo magic.

>>It would be straightforward if the sample rate is set, say, at 192kHz.
>>The hard part is the approximation in the vicinity of the Nyquist
>>frequency; this is where the filter order starts to increase.


>
> Not as a general rule. That would depend on the choices you make.


The lower is F/Fsa, the closer is the behavior of the digital filter to
the analog prototype, the more applicable are the standard methods like
Bilinear or Impulse Invariant.

> It would
> also depend on the type of spectral response. The A-weighting has nothing
> special about Nyquist for 48kHz (or any other lower sampling rate).


Oh, yes. A-weighting has something special about the high frequencies,
especially as there could be a lot of shaped noise there.

> Since this type of filter is often used only for power measurement, the
> phase response is not an issue.


Incorrect assertion.

Phase response does matter since it affects the result of the
measurement. Especially as the signal may contain the correlated
components. If you pretend to model the analog filter to the accuracy of
0.01 dB, that implies the error vector (module, phase) is within 1e-3
from the analog prototype. So, back to the drawing board.

> The only real concern is the quantization (in case of fixed point
> implementation) and possibility of getting poles to be kicked out of the
> unit circle in the process. In that case you need to spend additional work
> on getting the proper filter structure and possibly convert it into
> bi-quads and/or lattice...


That is a minor technical problem. BTW, the original A-filter has the
real poles, so the stability should not be an issue.


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital filters for audio : coefficients - interpolation mot56k DSP 6 12-19-2008 11:45 AM
Calculating filter coefficients from magnitude squared filter [email protected] DSP 2 06-29-2007 07:46 PM
Coefficients for A-weighting filter Robert Adams DSP 40 12-22-2006 12:37 AM
FIR filter coefficients - are they ever zero?? elp02rap DSP 5 08-16-2005 08:30 PM
FIR Lattice Filter Reflection Coefficients in Terms of Direct Coefficients? Randy Yates DSP 11 11-02-2004 05:50 AM


All times are GMT +1. The time now is 03:32 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved