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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:53:40+00:00 2026-05-28T06:53:40+00:00

I am trying to do spectral analysis on a WAV file using the jTransforms

  • 0

I am trying to do spectral analysis on a WAV file using the jTransforms library: Official Site

But I have problems on how to convert the WAV file into an acceptable input for FFT using jTransforms, and how can I display a frequency spectrum after FFT? I have searched around Google and found I need to somehow convert the WAV file into a double[] or Complex[], and afterwards how should I interpret the output?

Sorry I am very new to FFT so this question may sound extremely stupid. Many 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-28T06:53:40+00:00Added an answer on May 28, 2026 at 6:53 am

    I don’t know your library but i guess they have extensive documentation on how to apply the transforms.

    Regarding the interpretation, if you use a complex transform you can interpret the real part as energy for the corresponding freuqncy bin and the imaginary as phase of the sinusoid.
    The power spectral density (PSD) can be computed by

    real(fftData)*conj(fftData) 
    

    which is equal to

    abs(fftData^2)
    

    (so multiply the real parts by their complex conjugate).

    One thing you might have to consider is rescaling your fft output. Some algorithms scale the output proportional to the fftSize. So you will have to multiply the output by 1/fftSize.

    And the last thing in case you are not aware of, you only have to take half of the fft output since the spectrum is symmetric.
    The middle bin (fftSize/2) is usually the mirrored fundamental frequency and is equal to fftData[0]. This marks the Nyquist frequency which is the highest frequency you can analyze with the given fftSize.
    So if you want to display frequencies upto 22kHz make sure your fftSize is at least 44k.

    There are many pitfalls with FFT, so be sure you read up on some parts and understand what you are doing there. The mathematics itself are not that important if you just want to use it, so you might skip them.

    EDIT: There is even more. Consider to weight your input data with a tapered window (gaussian, hamming, hanning…) to avoid nasty edge effects if you don’t feed your whole wav file as input. Otherwise you will get artificial high frequencies into your fft output which are simply not present in the original.

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

Sidebar

Related Questions

Trying to do this sort of thing... WHERE username LIKE '%$str%' ...but using bound
Trying to insert values with Unicode Chars into a MySQL-database using Delphi 2010 and
Trying to figure out how to convert how to covert 5 variables I have
Trying to figure out how to do this. I have the style but I'd
Trying to execute a Powershell cmdlet from a MVC 3 Controller using impersonation but
Trying to make a MySQL-based application support MS SQL, I ran into the following
I'm trying to save a number of spectral measurements in a data.frame. Each measurement
Trying to write a windows speech recognition macro. Written using XML and scripting language
Trying to load a page fragment, or at least jump to a div but
Trying to figure out how to read in multiple variables through a file. for

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.