how to create speech waves with equal loudness in matlab ?

ana · Mar 29, 2024 · 2.1K views
Question
hi frnds i want matlab command or code for making speech waves with equal loudness in matlab i.e speech waves with same intensity and frequency.  
Expert Answer
Profile picture of Neeta Dsouza
Neeta Dsouza PhD Expert
Answered Aug 21, 2026
I suggest you to use Microsoft Anna (Text to Speech) and save the sound in a *.wav file or *.mp3 file.
 
Then import the sound file to MATLAB.
 
To equalize the loudness you could try this options:
  • Use the soundsc command:

 

 [y1,Fs1] = audioread('myRecord1.wav');
 [y2,Fs2] = audioread('myRecord2.wav');
  y1n = soundsc(y1,Fs1);
  y2n = soundsc(y2,Fs2);
  • Use FFT to equalize the median dB:

 

 Pxx1 = abs(fft(y1));
 Pxx2 = abs(fft(y2));
 dB1 = median(10*log10(Pxx1(1:(end/2)).^2));
 dB2 = median(10*log10(Pxx2(1:(end/2)).^2));
 dB = [dB1 dB2];
 k = sqrt(10.^((max(dB)-dB)/10));
 y1n = k(1)*y1;
 y2n = k(2)*y2;

 

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!