How to find the frequency of a sound file using fft on matlab?
6 views (last 30 days)
Show older comments
Hello i have multiple sound recording which I need to find the frequency of, how can i do this using fft and matlab, how do i get the frequency by uploading the file?
Please help! Thank you!
5 Comments
Walter Roberson
on 23 Nov 2017
There is no possible solution to this. When all that is available is the data, then it is absolutely impossible to tell the difference between a 10 Hz sine wave recorded at 20 samples per second, compared to a 20000 Hz sine wave recorded at 40000 Hz.
Now, if you happened to know that the data represented human speech, then it would be potentially possible to estimate the sampling frequency. But this gets into the category of having a component of (approximately) known frequency, which you indicated earlier is not your situation.
Answers (1)
Walter Roberson
on 20 Nov 2017
Sorry, unless you have something known about the data, then it is not possible to determine the frequency. For example, the data for a 10 Hz tone for 5 seconds is exactly the same as the data for a 5 Hz tone sampled for 10 seconds.
If the data is in the form of an audio file such as an mp3 file, then those have a sampling frequency recorded in them that can be used to analyze the data. However, if you just have raw data there is nothing you can do.
6 Comments
Hamza Ashraf
on 29 Jan 2020
Edited: Hamza Ashraf
on 29 Jan 2020
oki thank you i understand that. can you tell me how to measure dopler of the sound from the mic? i want to do comparison between siren of ambulances at different distances from mic(sound capturing device).
Walter Roberson
on 29 Jan 2020
https://www.mathworks.com/help/phased/ug/doppler-effect-for-sound.html
See Also
Categories
Find more on Audio I/O and Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!