Page 1 of 1

frequencys in a wavfile

Posted: Sat Apr 09, 2005 2:25 am
by Hroudtwolf
Dear Comunity, :)


I want to read only frequencys from a WAV-File by using the fileaccess function from purebasic.
Do anyone knows, how to realize it ?

Posted: Sat Apr 09, 2005 8:53 am
by Xombie
Hroudtwolf - not to be nosy but you're posting an awful lot of questions at once. What kind of project are you working on? Are all the questions related to the same project?

Posted: Sat Apr 09, 2005 12:59 pm
by Hroudtwolf
I want to show the frequencys as graficoutput.

Posted: Sat Apr 09, 2005 1:58 pm
by traumatic
Hroudtwolf, I told you more than once how to achieve this.

I gave you links to pages that explain how WAVE-data looks like and
how FFTing works, which is the only way to gain access to the frequency
information.

These pages even contain sample codes. What else do you need?

Audio programming can be a rather demanding and extensive topic but
is easy once you get the drill. Just read through the pages I proposed, chum
up with how the data is stored in .wav-files and learn some math needed
for audiocoding. You will soon see it's not that hard.

Audiosamples are signed values (8bit is unsigned as an exception) and
in stereo streams, they are stored as LEFT, RIGHT, LEFT, RIGHT etc.
That's about all you've got to know...

Here's what a simple FFT implementation could look like:

Code: Select all

Procedure SlowFourierTransform()
  For bin=0 To (#BUFFERSIZE/2)-1
    cosAmp.f = 0.0
    sinAmp.f = 0.0
    For k=0 To #BUFFERSIZE-1
      x.f = 2.0 * #PI * bin * k / #BUFFERSIZE
      sinAmp + InputData(k) * Sin(x)
      cosAmp + InputData(k) * Cos(x)
    Next
    AmpOutput(bin) = Sqr(sinAmp*sinAmp + cosAmp*cosAmp)
  Next
EndProcedure
Other than that, I'd like to repeat Xombie's question: What are you up to?
It seems like you're randomly asking questions on any and every topic.
No offense.

Posted: Sat Apr 09, 2005 11:05 pm
by Hroudtwolf
@Traumatic

Thank you at first.

Other than that, I'd like to repeat Xombie's question: What are you up to?
It seems like you're randomly asking questions on any and every topic.
No offense.
I have presently two firm projects. But all my question about sound and the other subjects are a training for me. A training for better understand interresting areas of the programming.
Is asking illegally.
I'm just nosy.
Programming is my hobby and I want learn about many things of it.