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

  • SEARCH
  • Home
  • 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 6073761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:18:23+00:00 2026-05-23T10:18:23+00:00

As part learning exercise, part hobby project, I am implementing my own interpretation of

  • 0

As part learning exercise, part hobby project, I am implementing my own interpretation of the Cooley-Tukey FFT algorithm on an AVR using fixed point math. I haven’t dealt much with fixed point math before, and am wondering how best to go about part of the implementation. I guess the gist of this question is a request to confirm that I’m thinking about the issues involved correctly.

The heart of the C-T algorithm involves a set of multiplications and additions on complex-valued data in the following fashion (in pseduocode):

temp1 = cosine(increment)*dataRealPart[increment1] 
-sine(increment)*dataImaginaryPart[increment1]

temp2 = cosine(increment)*dataImaginaryPart[increment1] 
+ sine(increment)*dataRealPart[increment1]

dataRealPart[increment1] = dataRealPart[increment2] - temp1

etc.

The cosine and sine data will be 8 bit signed binary fractions of the form S.XXX’XXXX, the input data will also be 8 bit signed binary fractions of the form SXXX.XXXX, and the multiplications will generate a 16 bit signed fraction product. As I see it, for particularly “bad” values of sine and cosine and the real and imaginary part of the data, temp1 or temp2 will come pretty close to the limits of a 16 bit signed integer.
If both the real part and imaginary part of the data are, say, b0111.1111, a little work in Wolfram Alpha shows that, with “bad” values of sine and cosine, the output can be up to 1.4 times larger than what simply multiplying the maximum value of a sine times the maximum value of the input would be.

For example, if the sine argument is b0111.1111 and the input value is b0111.111, the output would be b0111111.00000001, or 16129 in decimal. 1.4 times that would be about 22580. This won’t overflow the positive range of a signed 16 bit int, but in the next lines these products are added and subtracted from the input data, and assuming the input data here is converted to sixteen bit, it’s likely that an overflow will occur.

It looks to me like the trade off is: either increase the internal processing resolution of the data, which increases the processing time, or make sure the input data stays lower than the amplitude which causes overflow, decreasing signal-to-noise ratio. Is that about the size of things?

  • 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-05-23T10:18:24+00:00Added an answer on May 23, 2026 at 10:18 am

    One option is to reduce your sine and cosine values to Q6 (6 bit to the right of the decimal) This would make them +/-64. Notice that by going one bit more precision, -1 is representable but +1 is not (i.e. +128). Also, after you multiply there will be 2 sign bits in the result which means a sum of 2 products can probably be added with no problem. With this extra bit from reduced resolution you should really be able to avoid overflow. Another point – if your complex value is limited to a magnitude of 1 (real*real+img*img <=1) then the resulting sum will not exceed 1, as opposed to the 1.4 figure you found – that’s because when sine is 1, cosine is zero. You’re essentially taking a dot-product of a unit vector (cos,sin) and the complex vector. Beyond that, you can shift your 16bit products right a few bits prior to adding them, probably with rounding – you don’t really have 16 bits precision anyway since both data and trig functions were rounded to 7 bits.

    One last point. If you’re taking a sum of many numbers and you know the result will always be within your representable range, you do not need to worry about overflows of the intermediate results. It will all just work out in the end (the bits that you throw away all sum to zero anyway).

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

Sidebar

Related Questions

I'm learning DirectX as part of a hobby project. I've been looking for some
I am learning to use LabVIEW as part of my honours project, and was
I am very new to Erlang and as part of my learning exercise, I
As part of learning WPF I just finished working through an MS Lab Exercise
query level: beginner As part of a learning exercise I have written code that
As a part of learning process, I am writing simple IM app, using Remoting
As part of learning jQuery, I decided to do a simple tic-tac-toe game in
I just uploaded my first ASP.NET (as part of my learning of vb.net) and
As part of learning android, I am following the NotePad tutorial One thing I
As part of my learning, i am developing a google maps V3 application, to

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.