Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
my program is about to read a .wav file, then plot the frequenzy of the .wav file... and beside plot, i'm gonna use the frequency to calculate something... so i need to put the frequency to an array format which the index of the array is declare the time.

can someone help me got give me the code to take only the pitch (frequenzy) of the wav file.

i have read many source code, but sometimes its to complex, i just need the simple one...

thx all ..

God bless you
Posted

A starting point might be studying the Wave File specifications[^].
If you are lucky and have to deal with simple WAVEs then the implementation won't be too difficult.
 
Share this answer
 
Comments
endrudaud 30-Apr-11 20:37pm    
ok, thx for the solution.. i'll spend time to learn about the simple wave.. :D
Sergey Alexandrovich Kryukov 1-May-11 14:42pm    
No, based in what OP just confessed, it would be auto/music pitch recognition. As OP did not even know what this topic is about and expressed that even Fourier transform would be difficult, the case looks helpless. You got my 5 though.

Please look at my answer where I try to explain all that.
--SA
I don't know how much it will help you, but this [^]article has good content on sound. Just explore it.

Good luck !
 
Share this answer
 
Comments
endrudaud 1-May-11 3:27am    
thx, i'm gonna read it later.. thx..
What are you talking about? There is no single frequency.

Read this and try to understand what do you really want:
http://en.wikipedia.org/wiki/Spectrogram[^],
http://en.wikipedia.org/wiki/Fourier_transform[^],
http://en.wikipedia.org/wiki/Fast_Fourier_transform[^].

[EDIT]

Follow-up discussion:

"Pitch watch system that can change the Frequency of a signal to a note symbol."


It does not "change". This is a very complex problem of the musical pitch recognition. It's not a "note symbol". This question along shows how far you are. This is a task of recognition of the audio into, technically speaking, a MIDI sequence.

It looks like you have no idea how complex are the issues you're trying to thinks of. If you think that even relatively simple Fast Fourier transform is something difficult to translate in code, I cannot imaging that you can approach the problem of pitch recognition.

I can tell you one thing. I found some free programs for musical pitch recognition, and I worked with human voice recognition readily available on Windows. Even though human voice recognition seems much more complex, I found Microsoft engine quite successful; it works even with my accent in English pretty well and does not require teaching.

In contrast, all I tried for musical pitch recognition was only more or less close, but effectively failing. Even a relatively clear voice of electronic keyboard was barely recognized. The notation scores looked like a mess I would not easily play back, with multiple mistakes. I can understand it. There are no pure tones in any real-life record; music is a wealth of noises and over-tones but not in the frequency-phase space but in time. There is no clear definition of what a pitch is. You should not be mistaken by a easy of recognition by a trained human ear. Maybe the problem is that this task is not in high demand compared to speech recognition. Maybe these days you can find something much better (see below). Maybe, but…

To have an idea on what involved, look here:
http://www.eetimes.com/design/embedded/4006427/A-DSP-algorithm-for-frequency-analysis[^].

This is an available framework in Java:
http://marf.sourceforge.net/api-dev/[^].

Don't even try to discuss that this is a different computer language. The problem itself is many orders in magnitude more complex than the barrier between computer languages.

These are the C# articles on very basic techniques of working with audio input and spectral analysis:
Sound visualizer in C#[^],
Sound Activated Recorder with Spectrogram in C#[^].

Do this go get into it some more:
http://en.lmgtfy.com/?q=(audio+OR+music)+pitch+recognition+%22C%23%22[^],

or better

http://en.lmgtfy.com/?q=(audio+OR+music)+pitch+recognition[^].

I wish you luck. You would need a lot of luck just come close to the problem.

—SA
 
Share this answer
 
v8
Comments
endrudaud 1-May-11 3:26am    
hmm.. like a Pitch watch system that can change the Frequency of a signal to a note symbol.. i just wanna search some code like that.. btw,i ever read that article you gave to me.. but now i just wanna a code in C# so i can implement the teory.. *sorry for my bad english maybe
endrudaud 1-May-11 3:27am    
anyway thx for the help..
Sergey Alexandrovich Kryukov 1-May-11 14:37pm    
OK, look at my update. In a few words: maybe you're asking too much. You have no idea how difficult this problem is... OK, read some more.
--SA
endrudaud 1-May-11 20:05pm    
thank you. sorry if i have used wrong word when saying.
Sergey Alexandrovich Kryukov 1-May-11 20:16pm    
This is not a problem. This problem is that you probably need some more education for this task and that it's quite a big and difficult work.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900