Jump to content
  • Advertisement
Sign in to follow this  
dev578

Matching digital sound data with a sine equation

This topic is 4521 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to match digital sound data with some type of sine equation? Like, over the time of one second, could a graph match my digital sound data? Thank you, Dev578

Share this post


Link to post
Share on other sites
Advertisement
Hmm, well I need it to stretch the sound wave horizontally to make it a set length. Would the discrete fourier transform make this possible?


Dev578

Share this post


Link to post
Share on other sites
Quote:
Original post by dev578
Hmm, well I need it to stretch the sound wave horizontally to make it a set length. Would the discrete fourier transform make this possible?


The Fourier transform gives you the frequency decomposition of the signal. That is, the amplitude and phase of the sine waves you would need to add up to reproduce the signal.

Share this post


Link to post
Share on other sites
You can use a DFT to perform time stretching, but the results will generally be of middling quality due to the tradeoffs inherent in DFTs. A simpler, faster, and better algorithm involves fading between overlapped sections of the clip. More info here.

BTW: At the high end, this is an impressively complicated area. I'd suggest checking out the open source program "Audacity"; I seem to recall that it can do this well.

Share this post


Link to post
Share on other sites
Are you wondering about display of sound data on a screen, or are you wondering about sound processing?

To display it, you can do whatever you want. It's just bits.

To process it, you have to be very careful, because signals don't follow the same rules as, say, triangle meshes. If you want to stretch or compress the duration of a sound, you end up wanting to do "time stretching," of which there are a number of approaches. Check out musicdsp.com for some references.

If you want to analyze it (e g, "what's the basic fundamental tone in this section") then you either want auto-correlation, or you want a fast fourier transform. More words to google for :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!