Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- FPGAs and Programmable Solutions
- FPGA Intellectual Property
- Round or truncate? 截取和舍入对滤波器输出精度影响？

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2011
03:44 AM

1,619 Views

Round or truncate? 截取和舍入对滤波器输出精度影响？

turncat and rounding on the accuracy of the filter output?

designing filter with Fpga, there are two output modes, turncut and rounding. What effect on accuracy on Both methods have? Is there any way to minimize errors in the output? ? In addition, the Internet, said the biggest interception of errors, will bring the DC noise, does is correct? and which book has detailed studies about this？ Thank you! ! ! 截取和舍入对滤波器输出精度影响？ fpga 设计滤波器，输出方式一般有两种， 截取和舍入。这两种方式对精度有什么影响？有什么方法可以使 输出的误差最小？？ 另外，网上说 截取误差最大，会带来直流噪声，请问 是否正确，那本书上有详细论证， 谢谢大家！！！Link Copied

14 Replies

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2011
04:58 PM

71 Views

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2011
07:37 PM

71 Views

Adding further details:

Truncation leads to noise(truncation noise) and dc bias. Noise is worst with direct truncation(no rounding) and results from random error of up to 1 LSB. It is similar to quantisation noise concept when sampling analogue signals and so its distribution is dependent on signal values probabilty. DC bias is negative due to 2's complement and is worst in direct truncation but also occurs in "nearest" below but here it is positive and dependant on probabilty of midvalues (ties) which is highest when discarding only one bit and gets less and less if discarding more bits. There are 4 examples of truncation algorithms below: (1) convergent : round to nearest even. gives unbiased rounding, commonly used in hardware. (2) nearest : simple, leads to dc bias, common in hardware. (3) round : ideal, no dc bias, minimum noise but method 1 more easily implementable in hardware (4) truncate only, dc bias and noise```
for midpoint values case (ties)
Convergent nearest round trunc
-7/2 -3.5 -4 -3 -4 -4
-5/2 -2.5 -2 -2 -3 -3
-3/2 -1.5 -2 -1 -2 -2
-0.5 0 0 -1 n/a
0.5 0 1 1 n/a
3/2 1.5 2 2 2 1
5/2 2.5 2 3 3 2
7/2 3.5 4 4 4 3
```

The above table represents worst case i.e. one bit discarding and midpoint values(ties). For non ties, both nearest and convergent are equivalent to round Finally, note that say 4.5 is as close to 5 as it is to 4 and so the notion that it must 5 is not exactly solid fact except at school.
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2011
08:22 PM

71 Views

http://www.ovro.caltech.edu/~dwh/correlator/pdf/esc-100paper_hawkins.pdf (http://www.ovro.caltech.edu/%7edwh/correlator/pdf/esc-100paper_hawkins.pdf)

http://www.ovro.caltech.edu/~dwh/correlator/pdf/esc-100slides_hawkins.pdf (http://www.ovro.caltech.edu/%7edwh/correlator/pdf/esc-100slides_hawkins.pdf) Look at p40 and p41 of the slides for examples of truncation noise and the different rounding methods available in MATLAB. The figures show the bias involved in all methods; and that convergent is the rounding method to select. Cheers, Dave
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2011
09:07 PM

71 Views

Hi Dave,

Interesting work and slides. I have been through dsp projects with/without rounding. The notion of dc unbiased version is relatively new. In most cases I had to please the rf engineer by removing a tiny speckle of dc in the spectrum centred on carrier frequency. I am however not clear about round() having positive/negative dc as in your slide. If you look at my table above then there is no way I can imagine dc bias as values are symmetrical around zero. However, I do have some doubts about why the stress has moved to convergent case. Any clarification appreciated. Kaz
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2011
09:20 PM

71 Views

Hi Kaz,

--- Quote Start --- I have been through dsp projects with/without rounding. The notion of dc unbiased version is relatively new. In most cases I had to please the rf engineer by removing a tiny speckle of dc in the spectrum centred on carrier frequency. --- Quote End --- It ends up being important if you do a lot of complex-valued baseband processing, since the quantization noise spike shown in the slides shows up the in 'middle' of your band. If you were only processed real-valued signals, then the DC channel is probably discarded anyway, so its not as critical. --- Quote Start --- I am however not clear about round() having positive/negative dc as in your slide. If you look at my table above then there is no way I can imagine dc bias as values are symmetrical around zero. However, I do have some doubts about why the stress has moved to convergent case. Any clarification appreciated. --- Quote End --- round() is interesting isn't it. There is no bias if you take all the data and perform a 'mean' on it, but you can see from the figure in the slide that the positive values of the signal have a slight positive bias, while the negative have a slight negative bias, due to the rounding of 0.5 values to the next whole value in magnitude, i.e., 2.5 rounds to 3, and -2.5 rounds to -3. Though, I'm not sure how you'd see this effect in practice. The convergent rounding operation is pretty simple to implement in VHDL, see the attached. Since its so simple, I just 'use it' :) Cheers, Dave
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2011
09:31 PM

71 Views

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2011
09:44 PM

71 Views

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2011
09:54 PM

71 Views

Very good example. In fact I am just doing some work on power and PAR meter modules and certainly you are right, I am sort of dc-biased myself with direct processing of bipolar signals !!

Thanks a lot.
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2011
09:59 PM

71 Views

Hi Kaz,

--- Quote Start --- I am just doing some work on power and PAR meter modules --- Quote End --- Put yourself to sleep reading these then: http://www.ovro.caltech.edu/~dwh/carma_board/digitizer_tests.pdf (http://www.ovro.caltech.edu/%7edwh/carma_board/digitizer_tests.pdf) http://www.ovro.caltech.edu/~dwh/wbsddc/correlator_efficiency.pdf (http://www.ovro.caltech.edu/%7edwh/wbsddc/correlator_efficiency.pdf) --- Quote Start --- I am sort of dc-biased myself with direct processing of bipolar signals !! --- Quote End --- :) Cheers, Dave
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-02-2011
08:31 AM

71 Views

Hi Kaz,

thanks a lot for yuor reply. I still has something unclear about "DC bias "and "Noise". Any clarification appreciated. In your table, how can "DC bias "and "Noise" for the 4 examples of truncation algorithms . Take the

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-02-2011
08:38 AM

71 Views

If you look at Dave's posts after mine, you will see very good description of both noise and dc bias for various truncation algorithms. The case of direct truncation leads to truncation error of up to 1 LSB. Other cases lead to 0.5 LSB error. The actual error power will then depend on probaility issues and can be modelled same as quantisation noise of ADC sampling.

--- Quote Start --- http://www.ovro.caltech.edu/~dwh/correlator/pdf/esc-100paper_hawkins.pdf (http://www.ovro.caltech.edu/%7edwh/correlator/pdf/esc-100paper_hawkins.pdf) http://www.ovro.caltech.edu/~dwh/correlator/pdf/esc-100slides_hawkins.pdf (http://www.ovro.caltech.edu/%7edwh/correlator/pdf/esc-100slides_hawkins.pdf) Look at p40 and p41 of the slides for examples of truncation noise and the different rounding methods available in MATLAB. The figures show the bias involved in all methods; and that convergent is the rounding method to select. --- Quote End ---
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-02-2011
11:15 AM

71 Views

Hi Dave,

thanks for your disguise！！！ In my project, the case is that I use the FIR compilier v9.0 to build a filter ，whic output width is 30 bits, but only 10 bits to need。So I choose the “round” output mode, and what different between this mode and the example of convergence you have given? ? ?
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-02-2011
11:17 AM

71 Views

Hi Dave,

thanks for your disguise！！！ In my project, the case is that I use the FIR compilier v9.0 to build a filter ，whic output width is 30 bits, but only 10 bits to need。So I choose the “round” output mode, and what different between this mode and the example of convergence you have given? ? ?
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-02-2011
04:06 PM

71 Views

For more complete information about compiler optimizations, see our Optimization Notice.