The course design is written to make use of MATLAB Voice acquisition analysis of small procedures , For your reference .   :)

be careful : Audio files to be compatible with Matlab Project documents together .

The first procedure : Read the recorded audio for time domain analysis and generate pictures .
%123.m4a Is the name of the audio file I recorded , When using it, change it to your own audio file name [yy,fs]=audioread('123.m4a');% Read in audio file grid
on; % Gridlines hold on; % Set image retention YY=fft(yy);% Fourier transform of speech subplot(2,1,1);
plot(yy,'b');% Speech time domain waveform title(' Speech time domain waveform '); subplot(2,1,2); plot(abs(YY),'b');% Speech frequency domain waveform
title(' Speech frequency domain waveform '); sound(yy,fs);% Play voice

 

The second procedure : Generating noise , The noise is analyzed in time domain and frequency domain :
noise=0.1*randn(161791,2);% Call random function to produce noise NOISE=fft(noise);% Fourier transform of noise
sound(noise,fs);% Play noise subplot(2,1,1); plot(noise,'b');% Noise time domain waveform title(' Noise time domain waveform ');
subplot(2,1,2); plot(abs(NOISE),'b');% Noise frequency domain waveform title(' Noise frequency domain waveform ');

The third procedure : Add noise to speech signal . Analysis of frequency domain and time domain waveform .
[yy,fs]=audioread('123.m4a');% Read in audio file noise=0.1*randn(161791,1);% Call random function to produce noise
yynoise=noise+yy; YYNOISE=fft(yynoise); subplot(2,1,1);
plot(yynoise,'b');% Time domain waveform of audio plus noise title(' Time domain waveform '); subplot(2,1,2);
plot(abs(YYNOISE),'b');% Frequency domain waveform of audio plus noise title(' Frequency domain waveform '); sound(yynoise,fs);% Play noisy audio

 

 

Technology