Make a new vector y3 consisting of the values of y corresponding to the first three seconds of sound. Play this sound (perhaps you recognise it?) using the command sound().
Can someone please give me hints to solve this question?
Thank you.

댓글 수: 5

Geoff Hayes
Geoff Hayes 2020년 8월 20일
What is y? Have you been given some audio data with a sampling frequency that you need to extract the first three seocnds from?
Walter Roberson
Walter Roberson 2020년 8월 20일
Hint: if your sample frequency is 8000 then one second is 8000 rows, two seconds is 16000 rows..
Le Tien Dung Doan
Le Tien Dung Doan 2020년 8월 20일
Here is the information of y: "There are a couple of predefined sound vectors in MATLAB. As one example, run the command load handel; to load a vector y and a sampling rate Fs into your workspace." Moreover, the value of sampling frequency is 8192hz.
I try to write the code as below but I think it might be wrong.
load handel.mat
y = 3*8192+1;
y3 = y;
sound(y3)
y is the array of audio samples so you will want to extract the data from this array.
y3 = y(1:3*8192,:);
In your code, you are overwriting the y with a scalar.
Le Tien Dung Doan
Le Tien Dung Doan 2020년 8월 21일
I got it. Thank you so much

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

제품

릴리스

R2020a

태그

질문:

2020년 8월 20일

댓글:

2020년 8월 21일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by