1. Using a commonly used sound recorder, utter your first and last names and rec
ID: 3661985 • Letter: 1
Question
1. Using a commonly used sound recorder, utter your first and last names and record your speech. You can use a free version of a sound analysis program such as Wavesurfer or just use the default sound recorder of your computer's operating system. If you are using Windows, you can find the Sound Recorder under the accessories/entertainment. The default sampling rate of your recording will be 44.1kHz and 16bits. Turn on the record button and say your first and last names. Save your recording in a file. This file is .wav file, which you will analyze using MATLAB 2. Go to MATLAB, change to your current directory and load your .wav file using the MATLAB command wavread. [y, Fs, nbits]wavread("deneme.wav'); is the usage of this command. y is the data, Fs is the sampling rate of your recording and nbits is the bit number. 3. Depending on your sound recorder, y could be stereo or not. If it is stereo data, then use only a single channel, i.e. use y(:,1) or y(:,2). You can check if your recording is stereo or not using size command. If it is stereo, size(y) will return ans datalength 2, otherwise ans- datalength 1 Datalength is the number of samples of your recording, which depends on your recording time 4. Plot your recording using plot(y) or plot(y(:, 1)) or plot(y(:, 2)) command. Be sure that there is no clamping or too much background noise in your file. Clamping occurs when you are too close to the microphone while recording and you will observe that the signal envelope is flat in the clamped regions. To prevent background noise make your recording in a silent environment 5. Check the sampling rate (i.e. Fs should be 44.1KHz if you use Windows Sound Recorder) 6. Zooming on the plot, determine the samples where your speech starts and ends. You can use wavplay command to check. Also determine the phone boundaries of your first and last name using both the plot and listening to them. For example wavplay(y(300:5400), Fs) plays the sound starting from the 300th sample and ending at the 5400th sample. You should provide the sampling rate, which is 44100Hz in our case, as the second argument. By both zooming on your plot and listening to the pieces from your data, try to determine phone boundaries. For example, if a student's name is Ayla YILMAZ, phones are A, Y, L, A, Y, I, L, M, A, and ZExplanation / Answer
See the code below. It shows how to perform various tasks till cubic spline interpolation of exercise.
----------------------------------------------
wav_file="imperial_march.wav"; %path to .wav file to be read. replace this with your filename
%reading .wav file
[y,fs,nbits]=wavread(wav_file);
%checking whether sound is stereo
%if size() returns "datalength 2", then stereo otherwise
%if "datalength 1", then mono.
printf("size:%d ",size(y));
%plotting sample data
%my sample file is mono, so using only 'y' for plotting.
figure;
plot(y);
%checking sampling rate
printf("sampling rate:%.2f ",fs);
%playing .wav file
%wavplay(y,fs);
%extracting frequency characteristics
num_fft=10000; %num_fft point FFT
freq_props=fftshift(fft(y,num_fft));
%plotting frequency characteristics. only absolute values will be plotted
figure;
num_values=fs*(-num_fft/2:num_fft/2-1)/num_fft; %normalized sample points
plot(num_values,abs(freq_props),'b');
title("Plot of FFT");
xlabel("Frequency (Hz)");
ylabel("Values");
%upsampling the speech
M=2; %factor by which to upsample
y_up=upsample(y,M);
%cubic spline interpolation of speech data with upsampled data
pp=spline(y,y_up); %returns piecewise polynomial pp
----------------------------------------------------------------
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.