Reply by robert bristow-johnson October 15, 20062006-10-15
Randy Yates wrote:
> Ray Andraka <ray@andraka.com> writes: > > > Randy, > > > > I have to disagree with you regarding the coefficient quantization, at > > least somewhat.
...
> Hi Ray, > > I agree with you. I was interpreting Rikard's question too narrowly, > i.e., I was assuming he meant "implementation noise."
not an unreasonable "assumption" considering Rikard wrote:
> > ... However a large order FIR filter involves > a lot of multiplications, introducing quantization noise. Each quantized > Coefficient will contribute with noise and will most surely degrade the SNR > of the signal of interest, since we are adding noise in each multiplication. > The noise added in each multiplication will be filtered of the rest of the taps > in the filter....
it sure seems in these sentences he was talking about quantization noise and Randy's earlier comments were completely valid. r b-j
Reply by Randy Yates October 14, 20062006-10-14
Ray Andraka <ray@andraka.com> writes:

> Randy, > > I have to disagree with you regarding the coefficient quantization, at > least somewhat. True, quantization alters the filter, so that you > aren't getting exactly the same filter you would have with unlimited > precision. Practically speaking however, the effect of quantizing the > coefficients is that it puts bumps in the stop-band so that your > stop-band rejection is not as good as with the ideal filter. That in > turn allows out-of-band signal into your desired signal, which > directly affects the observed SNR in the presence of wideband noise. > A rule thumb for stop-band rejection noise vs coefficient bits is 5dB > reduction per bit.
Hi Ray, I agree with you. I was interpreting Rikard's question too narrowly, i.e., I was assuming he meant "implementation noise." In a subsequent post I acknowledged that the change in the filter's response brought about by coefficient quantizatioin can degrade the "signal noise." -- % Randy Yates % "Bird, on the wing, %% Fuquay-Varina, NC % goes floating by %%% 919-577-9882 % but there's a teardrop in his eye..." %%%% <yates@ieee.org> % 'One Summer Dream', *Face The Music*, ELO http://home.earthlink.net/~yatescr
Reply by Ray Andraka October 13, 20062006-10-13
Randy,

I have to disagree with you regarding the coefficient quantization, at 
least somewhat.  True, quantization alters the filter, so that you 
aren't getting exactly the same filter you would have with unlimited 
precision.  Practically speaking however, the effect of quantizing the 
coefficients is that it puts bumps in the stop-band so that your 
stop-band rejection is not as good as with the ideal filter.  That in 
turn allows out-of-band signal into your desired signal, which directly 
affects the observed SNR in the presence of wideband noise.  A rule 
thumb for stop-band rejection noise vs coefficient bits is 5dB reduction 
  per bit.

Randy Yates wrote:

> > Hi Rikard, > > I've read your post a couple of times and I cannot understand > exactly what question you are asking. > > In a nutshell, we can talk about two different phenomena: > a) roundoff error of the coefficients, and b) quantization > error that results in converting the result in the accumulator, > which on most fixed-point DSPs is big enough to handle > the multiply-accumulates without any error, to the data > path width. > > Coefficient round-off error simply results in a filter different > than the one you thought you had. It does not contribute at all > to any degradation of SNR in the signal path.
> > The quantization error from b) can definitely degrade your input SNR > if done incorrectly. If done correctly, you should see about 6N dB SNR > at the output with an N-bit output data path. > > These are two unrelated and non-interacting phenomena, but it seems > you make reference to both. If you could clarify your question, maybe > we could help you better.
Reply by Randy Yates October 6, 20062006-10-06
"Rikard" <rikard.hellberg@se.flextronics.com> writes:

>>"Rikard" <rikard.hellberg@se.flextronics.com> writes: >> >>> Hi, >>> >>> I have a problem understanding the effect of noise in fix-point >>> FIR-filter implementations. Expecially SNR degradation due to >>> large order filter. >>> >>> The maxum error I will experience after quantization will be: >>> >>> e=sum(abs(Q(h(n))-h(n))) >>> >>> The round off power from the Coeff for the whole filter will be: >>> >>> (Q^2/12)*N, where Q is quantization step and N is the order of the >>> filter. >>> >>> >>> Well, if I have a 200-tap symmetric filter quantize to 18-bit (17-bit >>> frac) >>> in twos complement. My input signal is comming from a 14-bit ADC > (13bit >>> frac) twos complement. >>> >>> How can I calculate the SNR after the filter?? >>> >>> Best regards >>> Rikard >> >>Hi Rikard, >> >>I've read your post a couple of times and I cannot understand >>exactly what question you are asking. >> >>In a nutshell, we can talk about two different phenomena: >>a) roundoff error of the coefficients, and b) quantization >>error that results in converting the result in the accumulator, >>which on most fixed-point DSPs is big enough to handle >>the multiply-accumulates without any error, to the data >>path width. >> >>Coefficient round-off error simply results in a filter different >>than the one you thought you had. It does not contribute at all >>to any degradation of SNR in the signal path. >> >>The quantization error from b) can definitely degrade your input SNR >>if done incorrectly. If done correctly, you should see about 6N dB SNR >>at the output with an N-bit output data path. >> >>These are two unrelated and non-interacting phenomena, but it seems >>you make reference to both. If you could clarify your question, maybe >>we could help you better. >>-- >>% Randy Yates % "Watching all the days go by... >>%% Fuquay-Varina, NC % Who are you and who am I?" >>%%% 919-577-9882 % 'Mission (A World Record)', >>%%%% <yates@ieee.org> % *A New World Record*, ELO >>http://home.earthlink.net/~yatescr >> > > > Hi Randy
Hi Rikard,
> I think you are wrong here.
It's very possible.
> I should get a better SNR when I filter a signal, since I suppress > the out of band noise
Oh, well, yes, in that sense that is true. I misinterpreted this part of your post. You seem to be speaking of two completely different types of noise here. One is the type of noise that is present in the signal which you're attempting to filter out with an FIR. I'll call this type of noise "SIGNAL NOISE" during this post. The other type of noise is the kind generated by the implementation of the filter itself, such as the quantization noise caused by truncating the long accumulated values back to the datapath length. I'll call this "IMPLEMENTATION NOISE."
> in the stop band of the filter. However a large order FIR filter > involves a lot of multiplications, introducing quantization noise.
If you're trying to say that each multiplication introduces quantization noise, then that may or may not be true. It depends on the architecture of the machine and the underlying number representation. In a nutshell, if you're using floating point numbers on a "standard" processor, that's correct. However, if you're using fixed-point numbers on a DSP, then that's incorrect. For example, as I just recently responded in another thread, the C54x has a 16-bit data path, 17-bit multiplier, and a 40-bit accumulator. A minimum of 256 multiply-accumulates can be performed on this machine without losing even one bit of accuracy. It is only when you "quantize" the 40-bit accumulator back to the [typical] datapath length of 16 bits that you introduce quantization noise, but that happens once for each output sample, not once each multiply.
> Each quantized Coefficient
^^^^^^^^^^^^^^^^^^^^^
> will contribute with noise and will most surely degrade the SNR of > the signal of interest, since we are adding noise in each > multiplication.
You're confusing different issues, Rikard. First of all, coefficient quantization does NOT introduce quantization noise (i.e., IMPLEMENTATION NOISE). It simply changes the frequency response of your filter. This is well-known and proven in many textbooks on DSP. See, for example, section 9.4, "Analysis of Coefficient Quantization Effects" in [mitra]. However, it may be the case that coefficient quantization changes your filter's ferquency response enough so that more SIGNAL NOISE gets through the filter than you expected. Lastly, there is some IMPLEMENTATION NOISE introduced by the filter implementation, as I discused above.
> The noise added in each multiplication will be filtered of the rest > of the taps in the filter.
As I said, there is no noise in "each multiplication" when using a fixed-point DSP.
> Question: > > We have a received a signal and sampled it with a 14-bit ADC, > Fs=10MHz. Lets say that we have a signal with a bandwidth of 1MHz > and the SNR of the signal of interest is 18dB. I would like to > improve this by lowpass filtering. > > If a design a filter with 200taps (coef is 18bit, 17frac) thats has > a stopband attenuation @ 1.5MHz of 30dB. > > What SNR will I have @ the output of the filter??
There's no way to tell without knowing the noise spectrum. If the noise is flat across the entire digital frequency range (0 to Fs/2), then you should realize about 10 * log_10(5 / 1.5) = 5.23 dB increase in SNR, so the output SNR should be about 23 dB. And this is just a rough guess since I'm assuming a brick-wall filter. The actual SNR improvement (assuming again a flat noise spectrum) would be less thatn 5.23 dB.
> What am I missing??
As I attempted to explain above, it seems you're confusing different issues. I suggest you get ahold of a few DSP texts and see what they have to say. Specifically, I recommend [mitra] which I mentioned above, and also [proakis], which has a lot of material analyzing coefficient quantization. @BOOK{mitra, title = "{Digital Signal Processing: A Computer-Based Approach}", author = "Sanjit~K.~Mitra", publisher = "McGraw-Hill", edition = "second", year = "2001"} @BOOK{proakis, title = "{Digital Signal Processing: Principles, Algorithms, and Applications}", author = "John~G.~Proakis and Dimitris~G.~Manolakis", publisher = "Prentice Hall", edition = "third", year = "1996"} PS: Proakis/Manolakis have a new fourth edition of their book out. -- % Randy Yates % "How's life on earth? %% Fuquay-Varina, NC % ... What is it worth?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr
Reply by Rikard October 6, 20062006-10-06
>"Rikard" <rikard.hellberg@se.flextronics.com> writes: > >> Hi, >> >> I have a problem understanding the effect of noise in fix-point >> FIR-filter implementations. Expecially SNR degradation due to >> large order filter. >> >> The maxum error I will experience after quantization will be: >> >> e=sum(abs(Q(h(n))-h(n))) >> >> The round off power from the Coeff for the whole filter will be: >> >> (Q^2/12)*N, where Q is quantization step and N is the order of the >> filter. >> >> >> Well, if I have a 200-tap symmetric filter quantize to 18-bit (17-bit >> frac) >> in twos complement. My input signal is comming from a 14-bit ADC
(13bit
>> frac) twos complement. >> >> How can I calculate the SNR after the filter?? >> >> Best regards >> Rikard > >Hi Rikard, > >I've read your post a couple of times and I cannot understand >exactly what question you are asking. > >In a nutshell, we can talk about two different phenomena: >a) roundoff error of the coefficients, and b) quantization >error that results in converting the result in the accumulator, >which on most fixed-point DSPs is big enough to handle >the multiply-accumulates without any error, to the data >path width. > >Coefficient round-off error simply results in a filter different >than the one you thought you had. It does not contribute at all >to any degradation of SNR in the signal path. > >The quantization error from b) can definitely degrade your input SNR >if done incorrectly. If done correctly, you should see about 6N dB SNR >at the output with an N-bit output data path. > >These are two unrelated and non-interacting phenomena, but it seems >you make reference to both. If you could clarify your question, maybe >we could help you better. >-- >% Randy Yates % "Watching all the days go by... >%% Fuquay-Varina, NC % Who are you and who am I?" >%%% 919-577-9882 % 'Mission (A World Record)', >%%%% <yates@ieee.org> % *A New World Record*, ELO >http://home.earthlink.net/~yatescr >
Hi Randy I think you are wrong here. I should get a better SNR when I filter a signal, since I suppress the out of band noise in the stop band of the filter. However a large order FIR filter involves a lot of multiplications, introducing quantization noise. Each quantized Coefficient will contribute with noise and will most surely degrade the SNR of the signal of interest, since we are adding noise in each multiplication. The noise added in each multiplication will be filtered of the rest of the taps in the filter&#2013266053;. Question: We have a received a signal and sampled it with a 14-bit ADC, Fs=10MHz. Lets say that we have a signal with a bandwidth of 1MHz and the SNR of the signal of interest is 18dB. I would like to improve this by lowpass filtering. If a design a filter with 200taps (coef is 18bit, 17frac) that&#2013266066;s has a stopband attenuation @ 1.5MHz of 30dB. What SNR will I have @ the output of the filter?? What am I missing??
Reply by Randy Yates October 5, 20062006-10-05
"Rikard" <rikard.hellberg@se.flextronics.com> writes:

> Hi, > > I have a problem understanding the effect of noise in fix-point > FIR-filter implementations. Expecially SNR degradation due to > large order filter. > > The maxum error I will experience after quantization will be: > > e=sum(abs(Q(h(n))-h(n))) > > The round off power from the Coeff for the whole filter will be: > > (Q^2/12)*N, where Q is quantization step and N is the order of the > filter. > > > Well, if I have a 200-tap symmetric filter quantize to 18-bit (17-bit > frac) > in twos complement. My input signal is comming from a 14-bit ADC (13bit > frac) twos complement. > > How can I calculate the SNR after the filter?? > > Best regards > Rikard
Hi Rikard, I've read your post a couple of times and I cannot understand exactly what question you are asking. In a nutshell, we can talk about two different phenomena: a) roundoff error of the coefficients, and b) quantization error that results in converting the result in the accumulator, which on most fixed-point DSPs is big enough to handle the multiply-accumulates without any error, to the data path width. Coefficient round-off error simply results in a filter different than the one you thought you had. It does not contribute at all to any degradation of SNR in the signal path. The quantization error from b) can definitely degrade your input SNR if done incorrectly. If done correctly, you should see about 6N dB SNR at the output with an N-bit output data path. These are two unrelated and non-interacting phenomena, but it seems you make reference to both. If you could clarify your question, maybe we could help you better. -- % Randy Yates % "Watching all the days go by... %% Fuquay-Varina, NC % Who are you and who am I?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr
Reply by Rikard October 5, 20062006-10-05
Hi,

I have a problem understanding the effect of noise in fix-point
FIR-filter implementations. Expecially SNR degradation due to
large order filter.

The maxum error I will experience after quantization will be: 

e=sum(abs(Q(h(n))-h(n)))

The round off power from the Coeff for the whole filter will be:

(Q^2/12)*N, where Q is quantization step and N is the order of the
filter.


Well, if I have a 200-tap symmetric filter quantize to 18-bit (17-bit
frac)
in twos complement. My input signal is comming from a 14-bit ADC (13bit
frac) twos complement.

How can I calculate the SNR after the filter??

Best regards
Rikard