From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: RFC: Generic Fixed-Point IIR Filter Date: Thu, 26 Mar 2015 18:05:14 +0100 Organization: cbb software GmbH Message-ID: <130av1lss2on0.1hnyecu4tvyoo$.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: w2sqUGEBZqsVBYNL7Ky3Kg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:25265 Date: 2015-03-26T18:05:14+01:00 List-Id: On Thu, 26 Mar 2015 09:25:25 -0700 (PDT), Patrick Noffke wrote: > I realize my range and precision for Filter_Value_Type are not > necessarily ideal (the range depends on the filter coefficients, the > filter architecture, as well as the filter order). Do you know of any > references or have suggestions for how to analyze a filter to determine > the ideal range and precision? Intermediate values should have some physical sense. E.g. acceleration when you calculate dv/dt from v and t. Such values are limited by the process and thus you could estimate their ranges. This is also a good argument against using a single fixed-point type in calculations. This is not a problem with floating-point types as they designed to accommodate all possible intermediate values of practically any process, though maybe losing some accuracy. But with fixed-point types one should go after proper dimensional arithmetic with *different* types of *different* precision for each physical value, intermediates included. Unfortunately there is basically no support in Ada (or in any other language I know) for this. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de