Hi, I m working on QMF filters wherein I split the input audio into different bands and then reconstruct them. I wanted to know how can I compare the quality of the input audio and the reconstructed audio. Right now I m using mean square error which I feel is not sensible because the more the filter length I use more is the error that is showing up. Can I use cross correlation to compare the qualities. Please suggest any other quality measure. I also wanted to know if I can compare the quality using the frequency domain. Thanks in advance.

# Regarding comparison of audio quality

Started by ●June 26, 2008

Reply by ●June 26, 20082008-06-26

vasindagi wrote:> Hi, > I m working on QMF filters wherein I split the input audio into different > bands and then reconstruct them. I wanted to know how can I compare the > quality of the input audio and the reconstructed audio. > Right now I m using mean square error which I feel is not sensible because > the more the filter length I use more is the error that is showing up.Do you properly account for delay?> Can I use cross correlation to compare the qualities. Please suggest any > other quality measure. > I also wanted to know if I can compare the quality using the frequency > domain. > Thanks in advance.Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������

Reply by ●June 26, 20082008-06-26

vishur6@gmail.com wrote: > Vishwanath visited DSPRelated.com and clicked on your name from this page: > http://www.dsprelated.com/showmessage/99042.php > to contact you. His message follows: > > Hi Jerry, > I m relatively new in the dsp field. You asked whether I m accounting for delay while calculating the mean square error. Yes I m accounting for the delay but I m not sure whether its the correct way of doing it. > What I m doing is if the length of the filter is N then while calculating the mean square error I am leaving out the first (N-1) samples of the output. I wanted to know if this is the correct way of doing it. > Thanks in advance. You will get better answers by keeping the discussion in the newsgroup. The output of a filter is delayed relative to the input. For symmetric FIR filters with N taps, the delay is (N-1)/2. Filters with an odd number of taps have delays of whole numbers of samples. Your supposed delay is wrong, the error matters more as the filters become longer. Jerry -- "The rights of the best of men are secured only as the rights of the vilest and most abhorrent are protected." - Chief Justice Charles Evans Hughes, 1927 ���������������������������������������������������������������������

Reply by ●June 28, 20082008-06-28

>vishur6@gmail.com wrote: > > Vishwanath visited DSPRelated.com and clicked on your name from this >page: > > http://www.dsprelated.com/showmessage/99042.php > > to contact you. His message follows: > > > > Hi Jerry, > > I m relatively new in the dsp field. You asked whether I m accounting>for delay while calculating the mean square error. Yes I m accounting >for the delay but I m not sure whether its the correct way of doing it. > > What I m doing is if the length of the filter is N then while >calculating the mean square error I am leaving out the first (N-1) >samples of the output. I wanted to know if this is the correct way of >doing it. > > Thanks in advance. > >You will get better answers by keeping the discussion in the newsgroup. >The output of a filter is delayed relative to the input. For symmetric >FIR filters with N taps, the delay is (N-1)/2. Filters with an odd >number of taps have delays of whole numbers of samples. > >Your supposed delay is wrong, the error matters more as the filters >become longer. > >Jerry >-- > "The rights of the best of men are secured only as the > rights of the vilest and most abhorrent are protected." > - Chief Justice Charles Evans Hughes, 1927 >��������������������������������������������������������������������� >Hi, I was trying to figure out how to compensate for the delay caused by the FIR filters I use. In some of the sites I found that if my filter length is N then I have to pass my input through a filter that causes (N-1)/2 delay so that I can compare it with the ouput. i,e if x(n) is the input to the QMF filters.

Reply by ●June 28, 20082008-06-28

>vishur6@gmail.com wrote: > > Vishwanath visited DSPRelated.com and clicked on your name from this >page: > > http://www.dsprelated.com/showmessage/99042.php > > to contact you. His message follows: > > > > Hi Jerry, > > I m relatively new in the dsp field. You asked whether I m accounting>for delay while calculating the mean square error. Yes I m accounting >for the delay but I m not sure whether its the correct way of doing it. > > What I m doing is if the length of the filter is N then while >calculating the mean square error I am leaving out the first (N-1) >samples of the output. I wanted to know if this is the correct way of >doing it. > > Thanks in advance. > >You will get better answers by keeping the discussion in the newsgroup. >The output of a filter is delayed relative to the input. For symmetric >FIR filters with N taps, the delay is (N-1)/2. Filters with an odd >number of taps have delays of whole numbers of samples. > >Your supposed delay is wrong, the error matters more as the filters >become longer. > >Jerry >-- > "The rights of the best of men are secured only as the > rights of the vilest and most abhorrent are protected." > - Chief Justice Charles Evans Hughes, 1927 >��������������������������������������������������������������������� >Hi, I was trying to figure how to compensate for the delay caused by the filters. I found in some of the sites that I will have to pass the delay through another filter that causes the same amount of delay (using fractional delay filters). i.e., If x(n) is the input to the QMF filters. y(n) is the reconstructed signal (output signal). N is the length of the filter. so the filter delay is (N-1)/2 Now to compare quality difference between x(n) and y(n) I ll have to delay x(n) by (N-1)/2. Is this correct? If yes how do I do this? 1. By using a fractional delay filter 2. Or by just leaving out the first (N-1)/2 samples of x(n)? Thanks

Reply by ●June 28, 20082008-06-28

vasindagi wrote:>> vishur6@gmail.com wrote: >>> Vishwanath visited DSPRelated.com and clicked on your name from this >> page: >>> http://www.dsprelated.com/showmessage/99042.php >>> to contact you. His message follows: >>> >>> Hi Jerry, >>> I m relatively new in the dsp field. You asked whether I m accounting > >> for delay while calculating the mean square error. Yes I m accounting >> for the delay but I m not sure whether its the correct way of doing it. >>> What I m doing is if the length of the filter is N then while >> calculating the mean square error I am leaving out the first (N-1) >> samples of the output. I wanted to know if this is the correct way of >> doing it. >>> Thanks in advance. >> You will get better answers by keeping the discussion in the newsgroup. >> The output of a filter is delayed relative to the input. For symmetric >> FIR filters with N taps, the delay is (N-1)/2. Filters with an odd >> number of taps have delays of whole numbers of samples. >> >> Your supposed delay is wrong, the error matters more as the filters >> become longer....> Hi, > > I was trying to figure how to compensate for the delay caused by the > filters. I found in some of the sites that I will have to pass the delay > through another filter that causes the same amount of delay (using > fractional delay filters). > i.e., If x(n) is the input to the QMF filters. > y(n) is the reconstructed signal (output signal). > N is the length of the filter. > so the filter delay is (N-1)/2 > Now to compare quality difference between x(n) and y(n) I ll have to delay > x(n) by (N-1)/2. Is this correct?Yes> If yes how do I do this? > 1. By using a fractional delay filterYou can avoid the need for a fractional (half of a sample interval) filter by using an odd number of taps in the QMF (What's that?) filter.> 2. Or by just leaving out the first (N-1)/2 samples of x(n)? > ThanksThere's bit more to it than that. Filters take time to settle when the signal is first applied. Until the delay line of the FIR is completely filled with real data, it will produce transient error. You need to discard the first N samples of the output before you begin to compare.Then you compare each output sample with the input sample of (N-1)/2 sample intervals before. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������

Reply by ●June 28, 20082008-06-28

>vasindagi wrote: >>> vishur6@gmail.com wrote: >>>> Vishwanath visited DSPRelated.com and clicked on your name from this>>> page: >>>> http://www.dsprelated.com/showmessage/99042.php >>>> to contact you. His message follows: >>>> >>>> Hi Jerry, >>>> I m relatively new in the dsp field. You asked whether I maccounting>> >>> for delay while calculating the mean square error. Yes I m accounting>>> for the delay but I m not sure whether its the correct way of doingit.>>>> What I m doing is if the length of the filter is N then while >>> calculating the mean square error I am leaving out the first (N-1) >>> samples of the output. I wanted to know if this is the correct way of>>> doing it. >>>> Thanks in advance. >>> You will get better answers by keeping the discussion in thenewsgroup.>>> The output of a filter is delayed relative to the input. For symmetric>>> FIR filters with N taps, the delay is (N-1)/2. Filters with an odd >>> number of taps have delays of whole numbers of samples. >>> >>> Your supposed delay is wrong, the error matters more as the filters >>> become longer. > > ... > >> Hi, >> >> I was trying to figure how to compensate for the delay caused by the >> filters. I found in some of the sites that I will have to pass thedelay>> through another filter that causes the same amount of delay (using >> fractional delay filters). >> i.e., If x(n) is the input to the QMF filters. >> y(n) is the reconstructed signal (output signal). >> N is the length of the filter. >> so the filter delay is (N-1)/2 >> Now to compare quality difference between x(n) and y(n) I ll have todelay>> x(n) by (N-1)/2. Is this correct? > >Yes > >> If yes how do I do this? >> 1. By using a fractional delay filter > >You can avoid the need for a fractional (half of a sample interval) >filter by using an odd number of taps in the QMF (What's that?) filter. > >> 2. Or by just leaving out the first (N-1)/2 samples of x(n)? >> Thanks > >There's bit more to it than that. Filters take time to settle when the >signal is first applied. Until the delay line of the FIR is completely >filled with real data, it will produce transient error. You need to >discard the first N samples of the output before you begin to >compare.Then you compare each output sample with the input sample of >(N-1)/2 sample intervals before. > >Jerry >-- >Engineering is the art of making what you want from things you can get. >����������������������������������������������������������������������� >Hi Jerry, 1. You suggested me that I can avoid the fractional delay filter if I use odd number of taps, but I m using the filters for QMF, for which the necessary condition is that the length of the filter has to be even (i.e., the order has to be odd). 2. I found a book on google. The link is http://books.google.co.in/books?id=RncdRGynIZYC&pg=PA126&lpg=PA126&dq=how+to+account+for+fir+filter+delay+&source=web&ots=ZFjqclLFms&sig=KBKKqNS-WNL8hiW93JBr8Ofan20&hl=en&sa=X&oi=book_result&resnum=2&ct=result#PPA126,M1 It suggests that I have to left shift the output by (N-1)/2 before comparing with the input which is essentially what you said. Am I right?

Reply by ●June 28, 20082008-06-28

vasindagi wrote:>> vasindagi wrote: >>>> vishur6@gmail.com wrote: >>>>> Vishwanath visited DSPRelated.com and clicked on your name from this > >>>> page: >>>>> http://www.dsprelated.com/showmessage/99042.php >>>>> to contact you. His message follows: >>>>> >>>>> Hi Jerry, >>>>> I m relatively new in the dsp field. You asked whether I m > accounting >>>> for delay while calculating the mean square error. Yes I m accounting > >>>> for the delay but I m not sure whether its the correct way of doing > it. >>>>> What I m doing is if the length of the filter is N then while >>>> calculating the mean square error I am leaving out the first (N-1) >>>> samples of the output. I wanted to know if this is the correct way of > >>>> doing it. >>>>> Thanks in advance. >>>> You will get better answers by keeping the discussion in the > newsgroup. >>>> The output of a filter is delayed relative to the input. For symmetric > >>>> FIR filters with N taps, the delay is (N-1)/2. Filters with an odd >>>> number of taps have delays of whole numbers of samples. >>>> >>>> Your supposed delay is wrong, the error matters more as the filters >>>> become longer. >> ... >> >>> Hi, >>> >>> I was trying to figure how to compensate for the delay caused by the >>> filters. I found in some of the sites that I will have to pass the > delay >>> through another filter that causes the same amount of delay (using >>> fractional delay filters). >>> i.e., If x(n) is the input to the QMF filters. >>> y(n) is the reconstructed signal (output signal). >>> N is the length of the filter. >>> so the filter delay is (N-1)/2 >>> Now to compare quality difference between x(n) and y(n) I ll have to > delay >>> x(n) by (N-1)/2. Is this correct? >> Yes >> >>> If yes how do I do this? >>> 1. By using a fractional delay filter >> You can avoid the need for a fractional (half of a sample interval) >> filter by using an odd number of taps in the QMF (What's that?) filter. >> >>> 2. Or by just leaving out the first (N-1)/2 samples of x(n)? >>> Thanks >> There's bit more to it than that. Filters take time to settle when the >> signal is first applied. Until the delay line of the FIR is completely >> filled with real data, it will produce transient error. You need to >> discard the first N samples of the output before you begin to >> compare.Then you compare each output sample with the input sample of >> (N-1)/2 sample intervals before....> Hi Jerry, > 1. You suggested me that I can avoid the fractional delay filter if I use > odd number of taps, but I m using the filters for QMF, for which the > necessary condition is that the length of the filter has to be even (i.e., > the order has to be odd).Why? Is the reason related to behavior at Fs/2?> 2. I found a book on google. The link is > http://books.google.co.in/books?id=RncdRGynIZYC&pg=PA126&lpg=PA126&dq=how+to+account+for+fir+filter+delay+&source=web&ots=ZFjqclLFms&sig=KBKKqNS-WNL8hiW93JBr8Ofan20&hl=en&sa=X&oi=book_result&resnum=2&ct=result#PPA126,M1 > > It suggests that I have to left shift the output by (N-1)/2 before > comparing with the input which is essentially what you said. Am I right?Yes. What about the time to recombine the channels? That delay needs to be accounted for too. Don't forget to discard the first N output samples, those corrupted by the startup transient. With good code, the only difference ought to be due to finite-precision arithmetic and filter ripple. Jerry -- Engineering is the art of making what you want from things you can get.

Reply by ●June 30, 20082008-06-30

On Thu, 26 Jun 2008 02:34:20 -0500, "vasindagi" <vishur6@gmail.com> wrote:>Hi, >I m working on QMF filters wherein I split the input audio into different >bands and then reconstruct them. I wanted to know how can I compare the >quality of the input audio and the reconstructed audio. >Right now I m using mean square error which I feel is not sensible because >the more the filter length I use more is the error that is showing up. >Can I use cross correlation to compare the qualities.(others have given good answers to this)>Please suggest any >other quality measure.In audio-related situations where a measure of quality is desired, quality is often determined by an old-fashioned technique known as listening. One listens to the input audio and the reconstructed audio, and makes a judgement on how much alike they sound. While this may seem subjective, it is actually one of the more objective techniques available. It can be especially powerful if one uses several listeners and statistical techniques to combine their observations. Google abx test, and you will find plenty of info. Or were you asking for attempts at audio quality measurement that are programming-only, and that do not have human intervention or interpretation?>I also wanted to know if I can compare the quality using the frequency >domain.Yes, I'm sure you can with consecutive/operlapping windowed FFT's (I recall a recent thread on what that was officially called), and my guess is this would be preferable (that is, it may more closely correlate to quality as judged by listening) to comparing samples (corresponding and correctly-shifted for delay) in the time domain.>Thanks in advance.

Reply by ●July 1, 20082008-07-01

>On Thu, 26 Jun 2008 02:34:20 -0500, "vasindagi" <vishur6@gmail.com> >wrote: > >>Hi, >>I m working on QMF filters wherein I split the input audio intodifferent>>bands and then reconstruct them. I wanted to know how can I compare the >>quality of the input audio and the reconstructed audio. >>Right now I m using mean square error which I feel is not sensiblebecause>>the more the filter length I use more is the error that is showing up. >>Can I use cross correlation to compare the qualities. > > (others have given good answers to this) > > >>Please suggest any >>other quality measure. > > In audio-related situations where a measure of quality is desired, >quality is often determined by an old-fashioned technique known as >listening. One listens to the input audio and the reconstructed audio, >and makes a judgement on how much alike they sound. While this may >seem subjective, it is actually one of the more objective techniques >available. It can be especially powerful if one uses several listeners >and statistical techniques to combine their observations. > > Google abx test, and you will find plenty of info. > > Or were you asking for attempts at audio quality measurement that >are programming-only, and that do not have human intervention or >interpretation? > >>I also wanted to know if I can compare the quality using the frequency >>domain. > > Yes, I'm sure you can with consecutive/operlapping windowed FFT's >(I recall a recent thread on what that was officially called), and my >guess is this would be preferable (that is, it may more closely >correlate to quality as judged by listening) to comparing samples >(corresponding and correctly-shifted for delay) in the time domain. > >>Thanks in advance. > >Yes Ben I was asking for methods which are programming only and dont need human intervention... something like mean square error... but I dont know whether mean square error is a good measure or not.