How to gender recognition with fft
20 views (last 30 days)
Show older comments
Hello everyone!
I'm new to Matlab and for a project I need to do a "simple" exercise.
I need to record a voice and decide if it's a male or female voice.
How?
Simple:
- record a wave
- use fft on wave
- use statistics that counts the frequencies
- if there're more lower frequencies then the voice is from male
- if there're more upper frequencies then the voice is from female
(I know it's not very accurate, but this is my task)
I searched the internet for content and I was able to:
- record voice from microphone
- convert audiorecorder file to wav
- use fft on wav file
- but I don't know how to count the frequencies and decide the gender
I put a link here to the .m file where I'm at right now:
Advices, tips, codes are welcome.
Thanks!
ps: I found out that the MatLab FFT function only returns on vector of amplitudes. Is this a problem?
3 Comments
Umr Nawaz
on 10 Jun 2022
@kalsoom fatima thanks for the consideration. My email address is rumarnawaz@gmail.com
Answers (3)
Star Strider
on 24 Nov 2014
Interesting problem!
A free online article ‘Phonetic differences between male and female speech’ goes into significant detail. Also ‘The frequency range of the voice fundamental in the speech of male and female adults’ will give you some general guidance. I would certainly do a PubMed search for more information.
See the documentation for fft to understand how to calculate a frequency vector for your fft. You have to know your sampling frequency ‘Fs’, and the rest is straightforward.
If this was my project, my initial approach would use two appropriately-designed bandpass filters (Signal Processing Toolbox), and then compare the RMS values of the outputs of the respective filters to determine the gender. Your final design will depend on how robust you want your classification scheme to be.
19 Comments
Akshat Dashore
on 17 May 2018
please replace file name present inside wav.read and read with other downloaded audio file
Richard Tony
on 22 May 2020
Hi, can you please tell me in your code, why do you use the value of 0.14 to compare with the meanfreq?? how did you deduce the value?
Brian Hemmat
on 12 Apr 2019
The Audio Toolbox includes an example on gender identification using LSTM networks:
The example requires Audio Toolbox and Deep Learning Toolbox.
0 Comments
kalsoom fatima
on 20 Dec 2021
hi.can i get the complete source code of your project please.
thankyou
0 Comments
See Also
Categories
Find more on Spectral Measurements 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!