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 4382442
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:46:47+00:00 2026-05-21T12:46:47+00:00

I have made an app that paints FFT to the screen realtime (from mic).

  • 0

I have made an app that paints FFT to the screen realtime (from mic). Time on x-axis, frequency on y-axis and the color of the pixel represents the amplitude (pretty much a vanilla FFT spectrogram).

My problem is that even though I can see a pattern from the music there is also a lot of noise. Googling it I see people applying a logarithmic calculation to the amplitude. Should I be doing this? And if so, what would the formula look like? (I’m using C#, but I can translate the math into code so any sample is ok.)

I can bypass this problem by applying a color scheme showing lower values as darker colors. I’m just not sure if the audio is correctly represented without a logarithmic calculation on it.

  • 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-21T12:46:48+00:00Added an answer on May 21, 2026 at 12:46 pm

    Representation of the amplitude on a logarithmic scale approximates the sensitivity of the human auditory system, and therefore gives you a better representation of what you hear, as compared to a non-logarithmic scale. Mathematically, all you have to do is:

    Alog = 20*log10 (abs (A))
    

    Where A is the amplitude of the FFT data, and Alog is the output. the factor of 20 is just a convention and has no effect on the image, which you probably scale anyway to a color-scheme.

    EDIT

    Explanation regarding the 20 factor: The dB (decibel) unit is a logarithmic unit measuring ratios: it represents a scale on which the distance between 100 and 10, is the same as between 1000 and 100 (since they have the same ratio: 1000/100 = 100/10). If you measure it in dB you get:

    10*log10 (1000/100) = 10*log10 (100/10) = 10
    

    The factor of 10 is because deci means tenth, which means 1 Bel is 10 deciBels, (like 1 kilogram is 1000 grams)

    Since the human auditory system is also (approximately) measuring ratios, it makes sense to measure sound level on a logarithmic scale, i.e measure the ratio of sound level to some reference value. Since the level of a sound is associated with the power (in Watts) of the sound wave, you actually measure the ratio of powers P/Pref. Also, the power is proportional to the amplitude squared, so all in all you get:

    10*log10 (P/Pref) = 10*log10 (A^2 / Aref^2) = 20*log10 (A/Aref)
    

    by the log rules. That’s the origin of the 20 factor – remember that in the computer the audio is represented by the instantaneous amplitude of the sound wave.

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

Sidebar

Related Questions

I have made an app that gets an array of addresses from a web
I have made an app that implements the iPhone's camera. When the user finishes
I have a django app that I made and have implemented a plist into
I have a new app that I made and put in the store yesterday.
An app that I have made works great on any regular android device, but
I'm making a new version of an app that use Three20. I have made
I have made a Linux CUI app that communicates between processes via Message-quene. There
I have made an app that starts a service, which starts a timer, which
I have made an app that sets notifications in the drop-down status bar of
I have made an App that can connect to a program that I am

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.