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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:09:46+00:00 2026-05-19T17:09:46+00:00

I am attempting to extract a fundamental frequency from a sound source. maybe someone

  • 0

I am attempting to extract a fundamental frequency from a sound source. maybe someone is singing A3 into the microphone, so I want to be detecting ~ 110Hz

my approach is:

  • FFT 1024 floats
  • use the phase of each bin to accurately determine its precise frequency
  • determine peaks (typically 50 or so)
  • order them with the loudest first

(Peak[0].power=1063.343750, .freq=2032.715088
(Peak[1].power=1047.764893, .freq=3070.605225
(Peak[2].power=1014.986877, .freq=5925.878418
(Peak[3].power=1011.707825, .freq=6963.769043
(Peak[4].power=1009.152954, .freq=4022.363037
(Peak[5].power=995.199585, .freq=4974.120605
(Peak[6].power=987.243713, .freq=8087.792480
(Peak[7].power=533.514832, .freq=908.691833

  • (MARKER1) start with the loudest, and match it against all remaining peaks, so if I had N peaks, I will have at this point N-1 peak-pairs
  • examine each peak-pair for harmonicity; ie how close is it to some fraction a/b, ie can we find a/b with b<20 such that |peakA.freq/peakB.freq – a/b| < 0.01 (this would match harmonics up to the 20th one)
  • we now have a refined list of peaks that are considered harmonic with one another

    Harmonic PeakPair: (0,1)=2/3, error:0.00468 => f0 @ 1019.946289
    Harmonic PeakPair: (0,2)=1/3, error:0.00969 => f0 @ 2004.003906
    Harmonic PeakPair: (0,3)=2/7, error:0.00618 => f0 @ 1005.590820
    Harmonic PeakPair: (0,4)=1/2, error:0.00535 => f0 @ 2021.948242
    Harmonic PeakPair: (0,5)=2/5, error:0.00866 => f0 @ 1005.590820
    Harmonic PeakPair: (0,6)=1/4, error:0.00133 => f0 @ 2027.331543
    Harmonic PeakPair: (0,7)=9/4, error:0.01303 => f0 @ 226.515106

My question is: how can I devise an algorithm that will correctly identify the above fundamental as ~1000Hz?

It is by no means guaranteed that there will be a higher concentration of values at ~1000 than at ~2000 or ~3000 etc. it isn’t even guaranteed that there will be any entry ~1000. we could have ~5000 x one entry, ~4000 x three entries, ~3000 x 2 entries, and a couple of bogus values floating around, like the 226 in the above list.

I guess I can repeat the procedure again, weeding out suggested fundamentals which are not ‘harmonic’ with the rest of the list. this would at least get rid of the bogus values…

it may be that I’m not even asking the right question. Maybe this whole approach sucks. But I think it makes sense to pick the strongest peak and extract a set of harmonics associated with that peak.

in theory that should generate a load of ratios, say if how original strongest peak was the third harmonic, then this set of peaks should contain 3/1 3/2 3/3 3/4 3/5 3/6 3/7 etc … although some may be missing.

realistically I have a feeling it’s always going to be either a fundamental or the first harmonic that has the greatest strength. but I don’t know if I can rely on this…

so many factors, it is making my head swim. I apologise in advance for such a messy question. Hopefully I can tidy it up posthumously.

  • 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-19T17:09:47+00:00Added an answer on May 19, 2026 at 5:09 pm

    I have rephrased the question, and provided an answer here: How to take in a set of numbers like {301,102,99,202,198,103} and throw out ~100?

    I had looked at several approaches, and this is considerably more succinct than anything else I’ve found. I have tested it and it works very well.

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

Sidebar

Related Questions

I'm looking to extract pitches from a sound signal. Someone on IRC just explained
I am attempting to extract all instances of a particular format from a string:
I just found a weird behavior when attempting to extract a string from the
I have a DateTime column. I want to extract all records, lets say, from
I'm attempting to write an application to extract properties and code from proprietary IDE
I'm attempting to run preg_match to extract the SRC attribute from the first IMG
I'm attempting to use C# and System.Diagnostics.FileVersionInfo to extract the version information from a
I'm attempting to extract data from log files and organise it systematically. I have
I'm attempting to extract urls from a string, they aren't standardized so some are
I am attempting to extract all data from a file with one regex expression.

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.