Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8081141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:38:31+00:00 2026-06-05T16:38:31+00:00

I have a 64-tap FIR filter whose output format I am having trouble understanding.

  • 0

I have a 64-tap FIR filter whose output format I am having trouble understanding. The filter has been implemented using (signed) fixed-point math. In {B,F} format, where B is the word length, and F is the fraction length, the filter inputs are {16,0}, and the coefficients are {16,17}. The heart of the filter is as follows:

for (i = 0 ; i < 32 ; i++) {
    accumulator += coefficients[i] *
        (input[(inputIndex + 64 - i) % 64] +
        input[(inputIndex + 1 + i) % 64]);
}

Each iteration of the for loop produces an output whose format is given by:

{16,17} * ( {16,0} + {16,0} ) = {16,17} * {17,0}
                              = {33,17}

using the rules of fixed-point arithmetic. As there are 32 iterations, it is necessary to add 6 additional bits to the size of the accumulator to prevent overflow. The six bits come from using the (MATLAB) formula:

floor(log2(32)) + 1

as per this document. According to my reasoning, this should result in an output of format {39,17}. Why then does MATLAB report the filter output size as {34,17}? Furthermore, if I want the filter output to be the same format as the input, am I correct in thinking that I need to right-shift by (in the {39,17} case) 22 bits?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:38:33+00:00Added an answer on June 5, 2026 at 4:38 pm

    This looks fine:

    {16,17} * ( {16,0} + {16,0} ) = {16,17} * {17,0}
                                  = {33,17}
    

    With 32 iterations, you can generate 5 additional bits (not 6), so it’s {38,17}. MATLAB’s output couldn’t be right for all possible inputs. Is it considering particular inputs or the general case?

    The format of the input {16,0} is an integer with no fraction. So to achieve the same scale as the input, you want to merely shift the fraction out, a right shift of 15. This truncates. Consider adding 0x4000 ~= 1/2 before shifting, a form of rounding.

    If you actually want to match the input {16,0} exactly, you shift right by 22 (possibly adding 0x200000 first to round). This introduces a scale factor of 1/128 in the transfer function (giving away about -20dB of signal!). Fine if that’s what the problem demands.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button that loads a viewcontroller on tap using - (void)didTap_imageButton3:(id)sender forEvent:(UIEvent
I have a button that when i tap on it i want to invoke
I have a situation in which user can single tap a control, which show
I have an UITextField and I would like that for every tap on a
I have an app where i have an IBAction which recognizes a tap gesture
I have an activity view that I have added in AppDelegate class to tap
In view A, I have a text field. I tap a control to push
Have a matrix report now that has Position, Hours and Wages for a location
I have a tap counter and this is the Who Wins code. The app
I have created a listview using the default ArrayAdapter. However, to select an item

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.