DSPRelated.com
Forums

Validating an A-Weighted filter

Started by WaverlyE September 21, 2010

glen herrmannsfeldt wrote:
>>>WaverlyE wrote: >>> >>>>How can I validate an A-Weighted filter with data other than a sine >>>>wave? I have an A-Weighted filter, that I obtained from the >>>>the Internet. > > Then Vladimir Vassilevsky <nospam@nowhere.com> wrote in > >>>You got to match the phase response of the filter to the IEC specified >>>S-domain function as well as the amplitude response. > > and finally, Al Clark <aclark@danvillesignal.com> wrote: > >>Yes, The A Curve is specified in as a s domain function, however I don't >>think that there is a specific requirement for phase response matching in >>any of the standards that I have seen. > > > Maybe I misunderstand, but I would have to agree. As far as > I know, such filters are used for sources that don't have a > definite phase relationship. (Such as noise and, much of the > time, music.)
Now think about digital signal processing artifact measurement; like limit cycle noise or noise shaping residuals.
> At least in the usual usage, the filter output > goes to a square law detector, such as a power meter, and, > hopefully, has some time averaging done.
In order for the results to be comparable, you have to measure the same things in exactly the same way. Otherwise it would be like with OP's different filters giving somewhat different results. Although there is nothing special about the phase response of the IEC rec, I would stick to the specified s-domain curve. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com

Pete Fraser wrote:

> "Vladimir Vassilevsky" <nospam@nowhere.com> wrote in message > news:tf6dnXzEmpx5eQXRnZ2dnUVZ_gudnZ2d@giganews.com... > > >>Matlab is for students and their toy problems. > > What do you recommend instead?
I write my stuff entirely in C++. I do simulations in C++, too. Sometimes I use "Numerical Recipies" as a cookbook, but God forbid using any code directly from there. If I need to derive an integral in the closed form, I use online Mathematica.
> I'm new to Matlab (previously used C and Mathematica > mainly for FIR filter design and PLL simulation). > > I'm working on IIR stuff now, and feel like going back > to C for some of the design (some of the Matlab stuff feels > cumbersome, and not very transparent). I don't know how to > deal with large fixed-point numbers though. > > Did you write your own, use one of the bignum libraries, > or something else? I've also been toying with Python > for its support of large integer arithmetic. What do you > think of the relative merits of C and Python for this > purpose?
It is hard for me to understand why would anyone need something other then just one general purpose programming language. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On 09/22/2010 03:56 AM, WaverlyE wrote:
>> Keep in mind that any filtering you do in the digital domain will be >> colored by whatever anti-alias filtering is done to the signal to get it >> to your algorithm, and whatever reconstruction filtering is done when >> your algorithm is done with it. > > I am not using any other filter. The recorded data is always sampled at > 44100Hz.
Through an anti-aliasing filter. Just because _you_ aren't using it doesn't mean that _someone_ did.
>> Comparing your filter with a _known good_ filter is the ticket -- it >> sounds like perhaps what's lacking is that known good filter! Comparing >> the performance of the filter with specifications is probably the best >> you could do at that point. >> > > > Ultimately, I goal is to know the weighted decibel value of an audio > stream. When the data is passed through the filter and I compute the RMS, > I need ensure the results are as accurate as a sound level meter and even > more. The data is being tested for use in psychology experiments, so the > measurements need to be extremely accurate. Are there any known files are > protocols used to test filters. You are correct, I do not have a known > good filter.
You set alarm bells ringing. What, exactly, are you trying to accomplish with your experiments? Keep in mind that the A-weighted filter is itself the result of psychoacoustic research, and the ultimate aim of that research -- however serious the people involved -- was to make money for broadcast, recording, and telephone companies. Were I in your shoes I'd want to make damned sure that I understood all of the implications of using that filter, unless I'm trying to springboard off of someone else's work that also used the same filter.
> I feel the only way I have left to ensure this filter works properly is to > purchase a sound level meter and setup experiments comparing the meter with > the filter.
If you are going to be citing previous research, you should find out what they were using, and try to replicate that.
> Are there files that are used to test an A-Weighted filter for > accuracy.
One can hope, but I wouldn't know where to start looking aside from a web search and asking here.
> Other than using sine wave, I am at a loss for how to test the filter.
As I said, a sine wave should work well. Running various colored noise through it and comparing power before and after would work, too.
> I am about to show my lack of knowledge so please be patient with me. I am > a novice. Could I analyze a sound file using FFT, extract the frequencies > then use the accumulative values in the frequency domain to validate the > results?
You should be able to. I'm not sure if it'd be worthwhile, but you should be able to. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
Tim Wescott wrote:
>You set alarm bells ringing. What, exactly, are you trying to >accomplish with your experiments? Keep in mind that the A-weighted >filter is itself the result of psychoacoustic research, and the ultimate >aim of that research -- however serious the people involved -- was to >make money for broadcast, recording, and telephone companies. Were I in >your shoes I'd want to make damned sure that I understood all of the >implications of using that filter, unless I'm trying to springboard off >of someone else's work that also used the same filter. >
The original research delivered masked audio. The stimulus is defined in terms of sound pressure level of the signal relative to ambient. The unit of measurement is the decibel on the A scale. The ambient sound of the room or the mask, which includes white and pink noise is also measured on the A scale. The stimulus was found to have its greatest measurable effect at -15db for males and -25db for females, using GSR, EEG and other biomeasurement devices. Experiments were done to measure the effect of the stimulus on memory, anxiety and problem solving to name a few. The original research was done using loudspeakers and cassette tapes. I am working on experiments using digital audio and headphones. I do not intend to filter the audio but use the filter to ensure that I can accurately and precisely measure what is being delivered to through the headphones. The filter is used solely as a means of measurement, not to actually filter. For example, the mask is 40db(A), the stimulus would need to be 25db(A) in order to achieve the -15db(A) at the peek of the experimental window. If I intend to deliver masked audio at -15db(A) but actually deliver -13db(A), the experiment may not work. The masks may be white noise, pink noise, pure tones or music that has been stored digitally. The mask and the stimulus must be precisely mixed. I am writing a program that quickly measures and precisely mixes the audio data. This is why I am working hard to ensure my method of measurement is very precise. Although the word filter is being used, its output is used solely to measure what is delivered to the ear, as in the original experiments, not to change the content of the original audio data. Once I've determined what the RMS db(A) of the audio data, I can then precisely mix to get the desired result. Hopefully that explains what I am working towards. Thank you, Waverly
WaverlyE <waverly.edwards@n_o_s_p_a_m.genesys.com> wrote:
(snip)
 
> The original research delivered masked audio. The stimulus is defined in > terms of sound pressure level of the signal relative to ambient. The unit > of measurement is the decibel on the A scale. The ambient sound of the > room or the mask, which includes white and pink noise is also measured on > the A scale.
(big snip) Does the A-weighting specification include the low pass filter on the output? That may have been due to the inertia of the analog meter movement in the case of analog meters. Now you need to do it in the digital domain. -- glen
glen wrote:

>Does the A-weighting specification include the low pass filter >on the output? That may have been due to the inertia of the >analog meter movement in the case of analog meters. Now you >need to do it in the digital domain. >
Unfortunately, there is no documentation of what device was used in the original experiment. I felt that since I am taking the RMS over the entirety of the audio file, less silence, it is the best I can do. I am sampling in 50ms windows. Any 50ms segment less than 44db unweighted is considered silence. The reason I went in this direction is that if I have an audio file that is one minute in length but contained 20 seconds of continuous tone, then my ears would not suggest that the RMS of the tone is based on one minute but rather just the 20 seconds of tone. I should therefore only measure what is not considered silence. Since there is no significan silence contributing to the RMS then I do not have the concern of inertia. W.
glen wrote:

>Does the A-weighting specification include the low pass filter >on the output? That may have been due to the inertia of the >analog meter movement in the case of analog meters. Now you >need to do it in the digital domain. >
Unfortunately, there is no documentation of what device was used in the original experiment. I felt that since I am taking the RMS over the entirety of the audio file, less silence, it is the best I can do. I am sampling in 50ms windows. Any 50ms segment less than 44db unweighted is considered silence. The reason I went in this direction is that if I have an audio file that is one minute in length but contained 20 seconds of continuous tone, then my ears would not suggest that the RMS of the tone is based on one minute but rather just the 20 seconds of tone. I should therefore only measure what is not considered silence. Since there is no significan silence contributing to the RMS then I do not have the concern of inertia. W.
WaverlyE <waverly.edwards@n_o_s_p_a_m.genesys.com> wrote:
(I wrote)
 
>>Does the A-weighting specification include the low pass filter >>on the output? That may have been due to the inertia of the >>analog meter movement in the case of analog meters. Now you >>need to do it in the digital domain.
> Unfortunately, there is no documentation of what device was used in the > original experiment. I felt that since I am taking the RMS over the > entirety of the audio file, less silence, it is the best I can do.
(snip) I meant the question to apply in general, but I am also interested in your answer. I sometimes do digital recordings of concerts, and want to equalize the level between tracks. As classical music has a large dynamic range, it isn't obvious if one wants peak, RMS, or something in between. (At least the peaks have to stay below the saturation point of the CD.) -- glen