Hello-- In a recent research project, I am using a loudspeaker and microphone setup to characterize acoustic materials. The loudspeaker emits a Maximum Length Sequence (MLS) which is used as the source signal. The reflection from an acoustic material is digitized by a microphone. I would like to remove the response of the loudspeaker so that I can better obtain the frequency response of an acoustic material. I've measured the frequency response of the loudspeaker in an anechoic chamber using an MLS. With the Fast Hadamard Transform (FHT), I am able to obtain the loudspeaker's impulse response. The discrete FFT could then be used to obtain the frequency response of the loudspeaker from this impulse response. What is the "best-practice" way to determine the filter kernel from the loudspeaker's frequency response? I would like to remove (as best as possible) the frequency response of the loudspeaker from the received signal, which would imply that a complex division in the frequency domain could be used. IMHO, most textbooks on DSP are strangely silent on how to reliably determine the filter kernel from an actual signal. Most filter kernels used for low-pass, high-pass, or "anything-block" or "anything-pass" filters can be constructed from equations or algorithms. Do I take a few (say 10) sequences of the loudspeaker impulse response, average the signals, take the FFT of the averaged signal, and then use a rotated version of this as the filter kernel? How many sequences should I use? Alternately, could I fit some sort of curve to the frequency response, and then use this curve to construct the filter kernel? I would have to take into consideration both the real and imaginary parts of the impulse response. This could be tricky, especially when plots of the real and imaginary parts of the kernel appear to be extremely complicated. Even more intriguingly, what happens if I have measured the frequency response of the loudspeaker at a certain frequency, and I would like to remove this loudspeaker response from a signal which is sampled at a different frequency than the signal used to construct the kernel? Do I downsample the kernel to perform deconvolution on the signal which is sampled at a different rate? What if the length of the kernel is not the same as the signal to which I would like to apply deconvolution? A similar issue could also arise if I was developing a piece of software to add a room response to an audio recording. Suppose that I would like to use DSP to make a particular piece of music sound as if it was recorded in the Teatro Dal Verme in Italy. I make the journey to this theater, being sure to pack a microphone and a loudspeaker. I then use an MLS to determine the room response at a number of locations. How can I turn these "measured" impulse responses into a kernel that can be convolved with the signal comprising my piece of music? Granted, there are perhaps easier ways to model the room response of the Teatro Dal Verme, but how would I reliably derive the kernel from the measured impulse response? Then I can place a sticker on the software box which claims "Derived from acoustic measurements taken at the Teatro Dal Verme." (In practice, I think that such a kernel could be developed primarily by mathematical modeling.) Another idea is to make a piece of music sound as if it has passed through the horn of a gramophone, using a filter kernel derived from measurements of the horn's impulse response. However, I digress - these are only examples that I've thought up to try and explain these concepts to myself. What is a reliable "best-practice" way to construct filter kernels from actual signals?
Developing filter kernels from signals
Started by ●January 29, 2010
Reply by ●January 29, 20102010-01-29
On 29 Jan, 06:34, Nicholas Kinar <n.ki...@usask.ca> wrote:> Hello-- > > In a recent research project, I am using a loudspeaker and microphone > setup to characterize acoustic materials. �The loudspeaker emits a > Maximum Length Sequence (MLS) which is used as the source signal. �The > reflection from an acoustic material is digitized by a microphone. �I > would like to remove the response of the loudspeaker so that I can > better obtain the frequency response of an acoustic material. > > I've measured the frequency response of the loudspeaker in an anechoic > chamber using an MLS. �With the Fast Hadamard Transform (FHT), I am able > to obtain the loudspeaker's impulse response. �The discrete FFT could > then be used to obtain the frequency response of the loudspeaker from > this impulse response. > > What is the "best-practice" way to determine the filter kernel from the > loudspeaker's frequency response? I would like to remove (as best as > possible) the frequency response of the loudspeaker from the received > signal, which would imply that a complex division in the frequency > domain could be used.It *could* be used, but it *should* not be used. That's the first apporach any DSP freshman attempts, an approach that leads to certain disaster.> IMHO, most textbooks on DSP are strangely silent on how to reliably > determine the filter kernel from an actual signal. �Most filter kernels > used for low-pass, high-pass, or "anything-block" or "anything-pass" > filters can be constructed from equations or algorithms.Ther's areason for that conspicuous silence. What you ask for is called 'inverse filter' and is one of the hardes tasks in DSP.> Do I take a few (say 10) sequences of the loudspeaker impulse response, > average the signals, take the FFT of the averaged signal, and then use a > rotated version of this as the filter kernel? �How many sequences should > I use? > > Alternately, could I fit some sort of curve to the frequency response, > and then use this curve to construct the filter kernel? �I would have to > take into consideration both the real and imaginary parts of the impulse > response. �This could be tricky, especially when plots of the real and > imaginary parts of the kernel appear to be extremely complicated.Technicalities don't matter when the approach is wrong.> Even more intriguingly, what happens if I have measured the frequency > response of the loudspeaker at a certain frequency, and I would like to > remove this loudspeaker response from a signal which is sampled at a > different frequency than the signal used to construct the kernel? �Do I > downsample the kernel to perform deconvolution on the signal which is > sampled at a different rate? �What if the length of the kernel is not > the same as the signal to which I would like to apply deconvolution?That's to ask for trouble. You are fiding the fact that what you want to do is difficult behind a smokescreen of technicalities.> A similar issue could also arise if I was developing a piece of software > to add a room response to an audio recording. �Suppose that I would like > to use DSP to make a particular piece of music sound as if it was > recorded in the Teatro Dal Verme in Italy. �I make the journey to this > theater, being sure to pack a microphone and a loudspeaker. �I then use > an MLS to determine the room response at a number of locations. �How can > I turn these "measured" impulse responses into a kernel that can be > convolved with the signal comprising my piece of music? �Granted, there > are perhaps easier ways to model the room response of the Teatro Dal > Verme, but how would I reliably derive the kernel from the measured > impulse response? �Then I can place a sticker on the software box which > claims "Derived from acoustic measurements taken at the Teatro Dal > Verme." �(In practice, I think that such a kernel could be developed > primarily by mathematical modeling.)Wrong again. You could find your sroom response by a simple impulse response measurement - if you have access to the location. Once you have the measurement, apply it to your data as a standard FIR filter.> Another idea is to make a piece of music sound as if it has passed > through the horn of a gramophone, using a filter kernel derived from > measurements of the horn's impulse response. > > However, I digress - these are only examples that I've thought up to try > and explain these concepts to myself. > > What is a reliable "best-practice" way to construct filter kernels from > actual signals?There aren't any, as the subject is riddled by all kinds of numercial and conseptual porblems. There *might* be a not entirely useless solution in any given case, but making that call (not to mention getting a method to work) would require intimite knowledge of the signal in question and the vailable DSP methods. Not something one would expect amateurs or newbies to masetr. Rune
Reply by ●January 29, 20102010-01-29
Hello Rune-- Thank you for your response.> > It *could* be used, but it *should* not be used. > That's the first apporach any DSP freshman attempts, > an approach that leads to certain disaster.Okay, so we need to head in a slightly different direction.> >> IMHO, most textbooks on DSP are strangely silent on how to reliably >> determine the filter kernel from an actual signal. Most filter kernels >> used for low-pass, high-pass, or "anything-block" or "anything-pass" >> filters can be constructed from equations or algorithms. > > Ther's areason for that conspicuous silence. What you > ask for is called 'inverse filter' and is one of the > hardes tasks in DSP. >Agreed, but since it has been done by other human beings (particularly seismologists), nothing is really too hard to implement or try.> > Wrong again. You could find your sroom response by a simple > impulse response measurement - if you have access to the > location. > > Once you have the measurement, apply it to your data as a > standard FIR filter.Sure, I've measured room responses using a Maximum Length Sequence, but this could also be done with other source signals such as frequency sweeps. So all that I would have to do is find the impulse response of the room, and apply it as an FIR filter? Would any signal averaging or windowing also be applied?>> >> What is a reliable "best-practice" way to construct filter kernels from >> actual signals? > > There aren't any, as the subject is riddled by all kinds of > numercial and conseptual porblems. There *might* be a not > entirely useless solution in any given case, but making that > call (not to mention getting a method to work) would require > intimite knowledge of the signal in question and the vailable > DSP methods. Not something one would expect amateurs or > newbies to masetr.Would you know of a paper/book/reference which may deal with the construction of such filters? Could you continue pointing me in the right direction? Once again, thank you for your help.
Reply by ●January 29, 20102010-01-29
> > Would you know of a paper/book/reference which may deal with the > construction of such filters? Could you continue pointing me in the > right direction?A paper which deals with the use of inverse filters to remove loudspeaker frequency response is: P. Cobo, A. Fernandez, M. Cuesta. 2007. Measuring short impulse responses with inverse filtered maximum-length sequences. Applied Acoustics 68: 820-830. However, the paper does not discuss how the inverse filter was designed. I am assuming that perhaps the investigators are simply constructing the filter to have the response that is required?
Reply by ●January 29, 20102010-01-29
Nicholas Kinar wrote:> Hello-- > > What is the "best-practice" way to determine the filter kernel from the > loudspeaker's frequency response?The standard practice is iterative algorithm to tweak ~8 parametric EQ stages for any desired response. That is very simple and it works good enough for most cases. BTW, as the target system is usually an IIR, the equalization of amplitude also equalizes the phase.> I would like to remove (as best as > possible) the frequency response of the loudspeaker from the received > signal,Keep in mind that the loudspeaker response depends on position of the mike wrt the speaker axis; you can equalize only for particular location.> which would imply that a complex division in the frequency > domain could be used.As Rune said, this is naive idea.> IMHO, most textbooks on DSP are strangely silent on how to reliably > determine the filter kernel from an actual signal.Eh? There is approximately a zillion of methods. LPC analysis filter comes to mind immediately. Greg Berchin's FDLS also. Google on "system identification".> Most filter kernels > used for low-pass, high-pass, or "anything-block" or "anything-pass" > filters can be constructed from equations or algorithms.Because there are neat closed form solutions for trivial cases.> Do I take a few (say 10) sequences of the loudspeaker impulse response, > average the signals, take the FFT of the averaged signal, and then use a > rotated version of this as the filter kernel?Huh?> How many sequences should I use?One (1). But that should be the good one.> What is a reliable "best-practice" way to construct filter kernels from > actual signals?The best practice is to practice until you get it working. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●January 29, 20102010-01-29
Nicholas Kinar wrote:> Hello-- > > In a recent research project, I am using a loudspeaker and microphone > setup to characterize acoustic materials. The loudspeaker emits a > Maximum Length Sequence (MLS) which is used as the source signal. The > reflection from an acoustic material is digitized by a microphone. I > would like to remove the response of the loudspeaker so that I can > better obtain the frequency response of an acoustic material.... What you're attempting is called deconvolution. It's hard to do reasonably well and in most cases impossible to do exactly. http://www.dspguide.com/ch17/2.htm bears on that. Be aware that fig. 17-2 relates to a previous section. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●January 29, 20102010-01-29
On 29 Jan, 16:41, Nicholas Kinar <n.ki...@usask.ca> wrote:> >> IMHO, most textbooks on DSP are strangely silent on how to reliably > >> determine the filter kernel from an actual signal. �Most filter kernels > >> used for low-pass, high-pass, or "anything-block" or "anything-pass" > >> filters can be constructed from equations or algorithms. > > > Ther's areason for that conspicuous silence. What you > > ask for is called 'inverse filter' and is one of the > > hardes tasks in DSP. > > Agreed, but since it has been done by other human beings (particularly > seismologists), nothing is really too hard to implement or try.The seimologists do something completely different from what you do: They use pulsed sources, and a very crude approcimation to the source signal for the inverse filter. And the results are as one might expect: Almost useless. But 'almost useless' is far enough from 'useless' to warrant the method - most huge oilfields in operation today was discovered using these techniques.> > Wrong again. You could find your sroom response by a simple > > impulse response measurement - if you have access to the > > location. > > > Once you have the measurement, apply it to your data as a > > standard FIR filter. > > Sure, I've measured room responses using a Maximum Length Sequence, but > this could also be done with other source signals such as frequency > sweeps. �So all that I would have to do is find the impulse response of > the room, and apply it as an FIR filter? �Would any signal averaging or > windowing also be applied?It could, but you could also eat donuts. What would the purpose either averaging or windowing be?> >> What is a reliable "best-practice" way to construct filter kernels from > >> actual signals? > > > There aren't any, as the subject is riddled by all kinds of > > numercial and conseptual porblems. There *might* be a not > > entirely useless solution in any given case, but making that > > call (not to mention getting a method to work) would require > > intimite knowledge of the signal in question and the vailable > > DSP methods. Not something one would expect amateurs or > > newbies to masetr. > > Would you know of a paper/book/reference which may deal with the > construction of such filters?No.>�Could you continue pointing me in the > right direction?You haven't understood a word of what I've said, have you? Rune
Reply by ●January 29, 20102010-01-29
Thank you so much for your response, Vladimir!>> >> What is the "best-practice" way to determine the filter kernel from >> the loudspeaker's frequency response? > > The standard practice is iterative algorithm to tweak ~8 parametric EQ > stages for any desired response. That is very simple and it works good > enough for most cases. BTW, as the target system is usually an IIR, the > equalization of amplitude also equalizes the phase.This describes what I am looking for, and it is neat to know that equalization of amplitude and phase will also occur.> >> I would like to remove (as best as possible) the frequency response of >> the loudspeaker from the received signal, > > Keep in mind that the loudspeaker response depends on position of the > mike wrt the speaker axis; you can equalize only for particular location.I've seen that the loudspeaker will have a non-uniform response when the microphone is situated at various angles to the speaker.> >> which would imply that a complex division in the frequency domain >> could be used. > > As Rune said, this is naive idea.Yes - I agree on that point.> >> IMHO, most textbooks on DSP are strangely silent on how to reliably >> determine the filter kernel from an actual signal. > > Eh? There is approximately a zillion of methods. LPC analysis filter > comes to mind immediately. Greg Berchin's FDLS also. Google on "system > identification".I had to smile when I read this paragraph. I like the fact that Greg Berchin's work was discussed here on this newsgroup.> >> Most filter kernels used for low-pass, high-pass, or "anything-block" >> or "anything-pass" filters can be constructed from equations or >> algorithms. > > Because there are neat closed form solutions for trivial cases. >Absolutely. That's the reason why these methods are widely used.>> Do I take a few (say 10) sequences of the loudspeaker impulse >> response, average the signals, take the FFT of the averaged signal, >> and then use a rotated version of this as the filter kernel? > > Huh?Once again, not a very wise idea.>> How many sequences should I use? > > One (1). But that should be the good one.Yes - I've taken a number of measurements in the anechoic chamber, and I am hoping that one of them should be good enough to use.> >> What is a reliable "best-practice" way to construct filter kernels >> from actual signals? > > The best practice is to practice until you get it working. >Yes - I agree completely with this particular statement. Once again, thank you so much for your help!
Reply by ●January 29, 20102010-01-29
Hello Jerry--> > What you're attempting is called deconvolution. It's hard to do > reasonably well and in most cases impossible to do exactly. > http://www.dspguide.com/ch17/2.htm bears on that. Be aware that fig. > 17-2 relates to a previous section.Thank you for your response. I understand that there may not be a complete solution to the problem, and that each approach is tailored to the physics of the situation. Thank you for the link.
Reply by ●January 29, 20102010-01-29
>Eh? There is approximately a zillion of methods. LPC analysis filter >comes to mind immediately. Greg Berchin's FDLS also. Google on "system >identification".> >Vladimir Vassilevsky >DSP and Mixed Signal Design Consultant >http://www.abvolt.com >I did some googling on Greg Berchin and FDLS. I found several links back to this news group, but I haven't been able to track down the algorithm itself. It looks like he may post here occasionally. Does anyone know if that paper is available anywhere to read? Thanks, Jacob






