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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:18:02+00:00 2026-05-29T12:18:02+00:00

I’ve been working on a guitar tuner Java application for quite some time and

  • 0

I’ve been working on a guitar tuner Java application for quite some time and have finally managed to get the pitch (fundamental frequency) detection to accurately determine the fundamental frequency of the input using an FFT and the Harmonic Product Spectrum. This works perfectly when I use my MacBook Pro’s default microphone, despite the fact that the signal is a little noisy, but I would ideally like to use my external USB audio sound interface (Lexicon Lambda) with an electric guitar directly plugged in. I have tried this with the exact same code that works perfectly for the mic input, but the pitch detected is different. Here are my results of fundamentals detected for each string (the guitar is in tune already).

Sample rate = 8000
Samples taken = 16000
Frequency resolution = 0.5Hz

E – Mic: 82.5Hz – Lexicon Lambda: 124.5Hz
A – Mic: 110.0Hz – Lexicon Lambda: 165.5Hz
D – Mic: 147.0Hz – Lexicon Lambda: 221.5Hz
G – Mic: 196.0Hz – Lexicon Lambda: 293.5Hz
B – Mic: 247.0Hz – Lexicon Lambda: 371.0Hz
E – Mic: 329.5Hz – Lexicon Lambda: 495.0Hz

I have messed around a bit with these numbers and it seems that the result found using the Lexicon Lambda is generally about 1.5 times the size of the accurate result. But rather than just adding this extra calculation to get to the right number I would like to make it so that both methods of obtaining audio data return accurate results.

Does anyone have any idea what the cause of this inconsistency might be?

Edit

So I am pretty sure that the problem is due to the Lambda using a bit-depth of 24 while my program (and the mic input) works with a bit-depth of 16. Rather than just changing it to deal with 24-bit data, does anyone know of a way to detect the available bit-depth of the current audio device?

Using the Lambda is the priority, since the signal is less noisy; however, I have just been trying to get things to work with a bit depth of 24 specified, and I get the IllegalArgumentException “No line matching interface TargetDataLine supporting format PCM_SIGNED 8000.0 Hz, 24 bit, mono, 3 bytes/frame, little-endian is supported.” I tried using 44.1kHz as well and I get the same error, which suggests the Lambda isn’t actually working with 24-bit audio or perhaps there is another issue. Does anyone have any experience working with 24-bit audio in Java Sound? It seems like there might be more to consider than just changing the bit-depth in order to make this work.

Thanks

  • 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-29T12:18:06+00:00Added an answer on May 29, 2026 at 12:18 pm

    1st idea


    The sample bitrate could be the key!!
    A professional audio interface will by default use 24 bits, 16 bits is an 80’s standard that is still used a lot in consumer electronics.

    If your FFT expects 16 bit values and you pass 24 bit, your sound will be “stretched”.
    ( Imagine a sine wave to make it clearer )

    This explains the frequency drift perfectly!!
    So you should either convert the 24 bits to 16 or rewrite the FFT.

    2nd idea


    I found out on the Lexikon website that the interface just supports 44.1 kHz and 48 kHz.
    So I guess the Lambda is by default set to 48 kHz.
    If you request an 8 kHz sample rate, the interface can’t handle that and stays at 48 kHz I suppose.

    So just try a common samplerate on both devices and compare again.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.