Using RMS output of bandpass filters to determine voice gender
조회 수: 8(최근 30일)
표시 이전 댓글
Muhammad Taimoor 2022년 12월 9일
답변: Gokul Nath S J 2022년 12월 14일
I am currently working on a project of a "Signals and Systems" undergraduate course, where I have to convert a male voice to a female voice and vice versa. For this to work, I first need to identify if the given voice is a male voice or a female voice.
To do this, I followed the following steps:
- Design bandpass filters for characteristic male and female voices using "filterDesigner".
- Pass the input signal through both the bandpass filters.
- Calculate the RMS value of both the outputs.
This was taken from the first answer on this link: https://www.mathworks.com/matlabcentral/answers/164116-how-to-gender-recognition-with-fft
Now I am confused regarding how to use the RMS values to determine the gender. I shall be grateful if someone here can tell me how to do it.
My code is given below:
% "Sample.wav" is a recording of a male voice
info=audioinfo('Sample.wav'); %Provides us info about the .wav file
[y,Fs] = audioread('Sample.wav'); %Will read the audio data from .wav file
t = 0:seconds(1/Fs):seconds(info.Duration);
t = t(1:end-1); %Time axis along which original signal will be plotted
%Plot the signal
plot(t,y) %Plots the original speech signal
c=conv(y,A); %Plot the signal after it is passed through the male bandpass filter
rms(c) %RMS value of male bandpassed signal
title('male-pass filtered ')
c=conv(y,A); %Plot the signal after it is passed through the female bandpass filter
rms(c) %RMS value of female bandpassed signal
Both of my bandpass filters are also attached. Thank you in advance for your help!
P.S: My 'Sample.wav' file can be found on this link: https://drive.google.com/file/d/12EUvFqIu35FGOQzCPpy9hsYSqOdi3xSC/view?usp=sharing
Gokul Nath S J 2022년 12월 14일
Hi Muhammad Taimoor,
As per my understanding, you need to distinguish whether the given voice is male or female. As per the steps, it’s evident that you might need to design a bandpass filter for characteristic male and female voices.
In the next step, you passed the input signal through a bandpass filter (both). In frequency domain, this operation is equivalent to multiplying the signal with a bandpass filter. This operation filters away all the other frequency component except the one at ω and
Male Voice + Male Bandpass filter
Say male bandpass filter is extending from while the male voice range in frequency domain is within this bandpass filter level. Once you multiply it and takes the RMS value of the resulting signal, one will get a considerable value.
Male Voice + Female Bandpass filter
Say male bandpass filter is extending from while the male voice range in frequency domain is not within this bandpass filter level. Once you multiply it and takes the RMS value of the resulting signal, one will get a value less than the one obtained in case 1.
To put it together, the voice characteristics are determined by the RMS value. The RMS value corresponding to the characteristic bandpass filter having the higher RMS value can be assigned male/female status accordingly.
Find more on Single-Rate Filters 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!