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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:20:12+00:00 2026-06-08T20:20:12+00:00

The short version of my question: How do I go from an array of

  • 0

The short version of my question:

How do I go from an array of audio samples (as Int16) to Complex structs used by common FFT libraries such as AForge?

The long version of my question:

I am new to audio processing and am looking to analyze audio in music (locating beats, tempo etc). After a couple of days reading up on this, the Fast Fourier Transform (FFT) algorithm seems to be a step in the right direction.

To get going and not having to implement the algorithms from scratch, I’ve downloaded a couple of open source libraries, Exocortex and AForge.net.

I am decoding the audio to a memory buffer. On each cycle for my 16 bit 48kHz audio stereo track, I get 48000 bytes or 24000 samples. These are currently copied into an array of short’s (Int16). I now need to convert my array to Complex structs (in the case of AForge). This in turn is initialized with a “real” and an “imaginary” double value. But what exactly are these and how do I go from my array to these two double values? Also, do I need to split up the left/right channel before passing it on?

Unfortunately, I am terrible at reading math formulas as long as it is not presented as code. On nearly all sites I’ve visited so far, greeek symbols and complex math formulas quickly arises to help explain the algorithm. As a result, I get lost in translation right away. Believe me, I tried hard finding a “FFT algorithms for dummies”. 😉

Note to moderators : This is not a duplicate of Convert Audio samples from bytes to complex numbers? even though the question is similar.

  • 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-06-08T20:20:15+00:00Added an answer on June 8, 2026 at 8:20 pm

    You need to either split the channels and process them separately, or average them to a single mono channel – which is best depends on what you ultimately are trying to accomplish.

    As for converting data types – every real number is also a complex number that has an “imaginary” part of 0, so the conversion is essentially to create an array of complex numbers with the sample (preferably normalized – in this case divide by 32768 so you have values in the range [-1,+1]) in the real part and zero in the imaginary part.

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

Sidebar

Related Questions

Short version: It's common to return large objects—such as vectors/arrays—in many programming languages. Is
Short version question : Is there navigator.mozIsLocallyAvailable equivalent function that works on all browsers,
SHORT VERSION OF QUESTION: So basically my question is: How can I set the
The short version of the question - why can't I do this? I'm restricted
The short version of the question: I do: x = y . Then I
I have a short version of the question: I start a thread like that:
This is basically a rails 3 version of this question . Short of parsing
Short version of the question: If you have a table with a large number
To short version of this question is that I want to accomplish something along
So the short version of my question is, how are we supposed to encode

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.