Using Matlab If given a wav file such as speech.wav Write a code that would resa
ID: 2083640 • Letter: U
Question
Using Matlab
If given a wav file such as speech.wav
Write a code that would resample the speech.wav file using the resample function such as one variable like x or y = resample( another variable, 5, 3);
and then be able to plot the original wav file speech.wav and then plot the resampled wav file to comprare to each other
also write the code that would then play the sound of the new resampled wav file but won't play the original wav file
Note: do not use wavread to read the wavfile and instead use audioread like [y,Fs] = audioread('speech.wav');
Explanation / Answer
%Use the audioread function to read the file, speech.wav.
[y, Fs] = audioread(‘speech.wav’);
% where y is the raw signal and Fs is the sampling rate.
% The resample function is used to change the sampling rate of the raw signal to other rate which is
% decided by a ratio of two integers.
y_sample = resample(y,5,3);
plot(y)
hold on
plot(y_resample)
sound(y_resample) % this function plays the resampled sound
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.