I have a set of data which consists of male and female voices. They are pronunciation of a same sentence. What's the appropriate method for getting an average spectrum for the male and female voices separately and comparing them? I can take fft of each voice but what's the next step to get an average spectrum? Also Welch's method can be applied to one voice each time. I know that this is in fact a random process and each of the voices is a realization but how can we estimate PSD using these realizations?

Edit: Thanks to Marcus Müller, here is the result which I've got using $$\frac{1}{N}( |\text{FFT}(x_1)|^2 + \dots + |\text{FFT}(x_n)|^2)$$ enter image description hereAnd here is the code:

  male = fft(k.');  %k: male voices
  male1 = (abs(male)).^2;
  male2 = sum(male1.')/36; %36: number of male voices

  female = fft(s.');  %s: female voices
  female1 = (abs(female)).^2;
  female2 = sum(female1.')/13;    %13: number of female voices

  plot(f , fftshift(male2) , f , fftshift(female2))

It would be really nice to see the other ways for estimation of PSD in this case.

  • $\begingroup$ why do you think that Welch's method wouldh't work? It's the standard method of this sort of thing. $\endgroup$
    – Hilmar
    Dec 19, 2020 at 19:13
  • $\begingroup$ @Hilmar It's straightforward to apply it on a single voice using pwelch command but I don't know how to apply it on all of the voices. $\endgroup$
    – S.H.W
    Dec 19, 2020 at 19:20
  • $\begingroup$ @S.H.W sounds like you're asking us how to calculate an average? $\endgroup$ Dec 19, 2020 at 20:55
  • $\begingroup$ @MarcusMüller I really don't know how to get a good estimation of PSD for this random process using different voices. $\endgroup$
    – S.H.W
    Dec 19, 2020 at 21:09
  • 1
    $\begingroup$ well, so calculating the average would be a start, wouldn't it? Otherwise, there's really a big load of literature on classification. It's kind of a popular application of artifical neural networks, too, but classical classifiers (see what I did there?) is also something you might want to look into. $\endgroup$ Dec 19, 2020 at 21:58

1 Answer 1


in my opinion and limited experience, you can't just compare spectra of male and female voices to identify which is which.

2 decades ago i worked on two products called PurePitch and PitchDoctor that was able to shift the pitch of a voice independently of shifting the formants. it also had the ability to increase or reduce the amount of pitch inflection of the voice (all the way to monotone). the products had factory-supplied "presets", one was called "testosterone" and the other was called "estrogen", that could convincingly make a female voice sound masculine or a male voice sound feminine.

anyway, i don't remember the numerical parameters that were researched literally by my boss in usage of the alpha version of the product. but it was something like 300 or 400 cents difference between the male and female voices and less than that for the difference between formants.

i think you might need a pitch detector and get lotsa words and do some statistics on the pitch to get a good machine idea of whether the pitch is or was more likely male or female.

  • $\begingroup$ Thanks for this valuable answer. My main goal was finding a way to estimate PSD using various realizations. Most of the methods which I found uses only one realization of random process. $\endgroup$
    – S.H.W
    Dec 20, 2020 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.