Forums

crackling sound after FIR filtration

Started by Decay February 27, 2008
>Hello, > > Even though the filter sum of coefficients is 1. It's output can > still go above +/- 1 (for input in the range of +/-1). This is > possible due to continous transients at input. So you should > check your filter for following inputs. > > 1. sinewave -> perform SNR analysis (check SNR_in and SNR_out). > 2. impulse response -> check that u get all the coefficients. > 3. step response -> check for overshoot/undershoot and rollovers. > 4. pseudo-random input -> check for max/min any node can reach. > > If input is 16 bits, then filter output will be 17 bits. You > need to put round+saturate module before you give out the output > as 16 bits. > > Also you need to perform SNR analysis to make sure you have > maintained enough bits on LSB side. > > Not sure, but maybe the band splitting also can be checked. > Instead of having simple split criteria like > Hlpf(w) + Hhpf(w) = 1. you may want to split using power law > criteria. Hlpf^2 + Hhpf^2 = 1. Vladimir might want to comment > more on this. > >Thanks and Regards >Bharat Pathak > >Arithos Designs >www.Arithos.com > >IP Development...........DSP Design Consultancy..........Training. > > >
Thank you Bharat! Will check all of your points!

Decay wrote:

>>First mistake. Don't use FIRs for the audio crossover. > > > Why?
It is inefficient. The FIR filter for crossover has to be ridiculously long. It will also introduce the significant amount of delay, which you will have to compensate by adding the delays to all other channels.
> IIR instead?
Yes. A Butterworth of the 4th order will suffice.
> What about non-linear phase?
...and the problem with the nonlinear phase is?
>>Second mistake. The filters are designed either by Remez or by windows. >>Remez and windows altogether do not make sense. > > > I'm not sure if it makes sense to gurus, but in my case simple Remez (at > lease as implemented in SPUC) didn't give me zero values at the ends of > the IR.
Parks-Mcclellan provides the optimal solution. It is a very strange idea to improve it by Black widow :)
> Blackman's window corrected that.
Corrected what? What was the problem? It looks like you are trying to make a soup by putting all kinds of good food in the pot at the same time :) It will taste only better if you try them one by one :) Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
>...and the problem with the nonlinear phase is?
Non-linear phase means that signal is distorted. It's not good by itself.. unless of course FIR processing introduces more distortion (while it's not related to phase). :)
> >Corrected what? What was the problem? >
Am I wrong or impulse response should fade out to zeros at both ends?
> >It looks like you are trying to make a soup by putting all kinds of good
>food in the pot at the same time :) It will taste only better if you try
>them one by one :)
I tried them one by one. Initially there was no window. But as I faced those crackles I thought that they may be caused by non-zero "wings" if the IR. There was no consultant by my side, so I nedded to chack it myself. ;) Will check Butterworth next, but I need FIR to start working properly first.
> > >Vladimir Vassilevsky >DSP and Mixed Signal Design Consultant >http://www.abvolt.com > >
bharat pathak wrote:
> Hello, > > Even though the filter sum of coefficients is 1. It's output can > still go above +/- 1 (for input in the range of +/-1). This is > possible due to continous transients at input. So you should > check your filter for following inputs. > > 1. sinewave -> perform SNR analysis (check SNR_in and SNR_out). > 2. impulse response -> check that u get all the coefficients. > 3. step response -> check for overshoot/undershoot and rollovers. > 4. pseudo-random input -> check for max/min any node can reach. > > If input is 16 bits, then filter output will be 17 bits. You > need to put round+saturate module before you give out the output > as 16 bits.
... The worst case occurs when the signal is +/-1, with the same sign as the coefficients. Then the output is the sum of the coefficient's absolute values. filter: [ 1 -4 6 -4 1] (sum = 0) signal [ 1 -1 1 -1 1] (sum = 1) product [ 1 4 6 4 1] (sum = 16) ... Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Decay wrote:
>> ...and the problem with the nonlinear phase is? > > Non-linear phase means that signal is distorted. It's not good by itself.. > unless of course FIR processing introduces more distortion (while it's not > related to phase). :) > >> Corrected what? What was the problem? >> > > Am I wrong or impulse response should fade out to zeros at both ends? >
So what do you have at the ends? Most filters have much smaller coefficients near the ends, but why would you expect them to reach zero? If your coefficients have a sinc'ish look to them it could take a very large number for their ripples to get really close to zero. You only need enough coefficients to meet your spectral goals.
>> It looks like you are trying to make a soup by putting all kinds of good > >> food in the pot at the same time :) It will taste only better if you try > >> them one by one :) > > I tried them one by one. Initially there was no window. But as I faced > those crackles I thought that they may be caused by non-zero "wings" if > the IR. There was no consultant by my side, so I nedded to chack it > myself. ;)
Crackling is not the outcome you would expect from strange coefficients. Crackling is normally the outcome of bugs. Buffer overflows are a typical cause.
> Will check Butterworth next, but I need FIR to start working properly > first.
Why do you still need the FIR? Noise shape a Butterworth, or use a really wide word, and you have the audio industry's usual answer to your requirement. Steve
> >Crackling is not the outcome you would expect from strange coefficients.
>Crackling is normally the outcome of bugs. Buffer overflows are a >typical cause. > >> Will check Butterworth next, but I need FIR to start working properly >> first. > >Why do you still need the FIR? Noise shape a Butterworth, or use a >really wide word, and you have the audio industry's usual answer to your
>requirement. > >Steve > >
Thank you Steve! Your points are well aligned with Vladimir's ones. I got them and will be moving in that direction. Thank you for paying attention! About the differencies between IIR and FIR: most of literature when comparing those two types mention only one advantage of IIR - performance. Are other differencies not that significant for audio processing? Or disadvatages can be compensated by using spare freedom given by improved performance? If we get back to phase - humans ears are sensitive to phase (at least at some frequencies). This can easily be checked by putting some sine wave into one channel, and the same wave with shifted phase to another and listening to resulting stereo signal. This will definetely differ from the signal with two coherent channels. Also, among analog active filters, those with linear phase are valued most. Is phase non-linearity of IIRs not audible in real life?
On 28 Feb, 17:33, "Decay" <dan_no...@mail.ru> wrote:

> If we get back to phase - humans ears are sensitive to phase (at least at > some frequencies). This can easily be checked by putting some sine wave > into one channel, and the same wave with shifted phase to another and > listening to resulting stereo signal. This will definetely differ from the > signal with two coherent channels.
How is that relevant? Why would you filter the L and R channels with different filters? Shouldn't the comparision be between both channels filtered with linear phase filters, and both channels filtered with non-linear phase filters? Rune
>On 28 Feb, 17:33, "Decay" <dan_no...@mail.ru> wrote: > >> If we get back to phase - humans ears are sensitive to phase (at least
at
>> some frequencies). This can easily be checked by putting some sine
wave
>> into one channel, and the same wave with shifted phase to another and >> listening to resulting stereo signal. This will definetely differ from
the
>> signal with two coherent channels. > >How is that relevant? Why would you filter the L and R channels >with different filters? Shouldn't the comparision be between >both channels filtered with linear phase filters, and both >channels filtered with non-linear phase filters? > >Rune >
Thanks Rune I see your point. Very reasonable. This example was given just to show that phase is not all-irrelevant for the ear. More practical example - we have 3-way speaker. Each of the speaker's drivers is fed by separate channel. Each channel is filtered using different filters (HP, LP, BP). Let's assume them being IIRs. Will all of them have the same nonlinearity? If so - there should be no issues. If no - there will be distortion in the signal in the joints between the bands. And you're right, in most cases left and right channel will be filtered the same way. For now we'll not take into account the compensation for irregulary placed speakers in multichannel system..
Decay wrote:
>> On 28 Feb, 17:33, "Decay" <dan_no...@mail.ru> wrote: >> >>> If we get back to phase - humans ears are sensitive to phase (at least > at >>> some frequencies). This can easily be checked by putting some sine > wave >>> into one channel, and the same wave with shifted phase to another and >>> listening to resulting stereo signal. This will definetely differ from > the >>> signal with two coherent channels. >> How is that relevant? Why would you filter the L and R channels >> with different filters? Shouldn't the comparision be between >> both channels filtered with linear phase filters, and both >> channels filtered with non-linear phase filters? >> >> Rune >> > > Thanks Rune > > I see your point. Very reasonable. > This example was given just to show that phase is not all-irrelevant for > the ear. > More practical example - we have 3-way speaker. Each of the speaker's > drivers is fed by separate channel. Each channel is filtered using > different filters (HP, LP, BP). Let's assume them being IIRs. > Will all of them have the same nonlinearity? If so - there should be no > issues. If no - there will be distortion in the signal in the joints > between the bands. > And you're right, in most cases left and right channel will be filtered > the same way. For now we'll not take into account the compensation for > irregulary placed speakers in multichannel system..
Some of your questions seem to indicate that you know little about the desirable features of crossover networks and their design. This is a well researched field, with the better part of a century's accumulated experience. You would do well to learn _what_ to do before concerning yourself with _how_ do do it. For example, matching phase is important, but only in the cross-over region, where sound from both drivers has comparable amplitude. Read http://www.rane.com/note160.html just for fun. There is material on crossovers on many sites on the web, in particular at http://www.linkwitzlab.com/crossovers.htm Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
>Some of your questions seem to indicate that you know little about the >desirable features of crossover networks and their design. This is a >well researched field, with the better part of a century's accumulated >experience. You would do well to learn _what_ to do before concerning >yourself with _how_ do do it. For example, matching phase is important, >but only in the cross-over region, where sound from both drivers has >comparable amplitude. Read http://www.rane.com/note160.html just for >fun. There is material on crossovers on many sites on the web, in >particular at http://www.linkwitzlab.com/crossovers.htm > >Jerry >-- >Engineering is the art of making what you want from things you can get. >??????????????????????????????????????????????????????????????????????? >
Jerry, Sometimes "what" comes out of "how". For instance, I know my "what" - I need to separate several bands of the sound freq. That's ultimae. Once I get to "how", and find out that there are two options - inefficient FIRs and nonlinear phase IIRs, the "what" evolves into "to separate several bands of sound freq so that phase is linear at the band joints". And so on... If everything was ideal the ultimate "what" could be reached without such details. But anyway, your first statement above is well taken and agreed upon. That's why I'm asking those questions which may seem stupid for you guys. Thank you for the links and your time!