Hi everyone, i need your help. I'm a newbie in using matlab, so could you help me code this exercise : " Using reshape to split a file wav into some small files."
Thank you very much if you help me .

2 件のコメント

Image Analyst
Image Analyst 2021 年 10 月 20 日
Is it monaural or stereo?
Thanh Vu Phuong
Thanh Vu Phuong 2021 年 10 月 21 日
it's stereo

サインインしてコメントする。

回答 (1 件)

Star Strider
Star Strider 2021 年 10 月 20 日

1 投票

Unless it is absolutely necessary to use reshape, use buffer instead. It is just easier.
It only operates on one vector at a time, and returns a matrix of column vectors (regardless of the original vector orientation), so for a stereo signal, it will be necessary to do this for each column (channel) separately.
.

4 件のコメント

Thanh Vu Phuong
Thanh Vu Phuong 2021 年 10 月 21 日
Using reshape is obligatory. It's very hard for me
Star Strider
Star Strider 2021 年 10 月 21 日
The ‘some small files’ requirement is a bit ambiguous.
Choose an integral divisor of the number of rows in the file, then choose that number to be the second argument to reshape (the first is the matrix itself), then go for it!
wavmatrix = [1:20; 21:40]';
newmatrix = reshape(wavmatrix, 10, [])
newmatrix = 10×4
1 11 21 31 2 12 22 32 3 13 23 33 4 14 24 34 5 15 25 35 6 16 26 36 7 17 27 37 8 18 28 38 9 19 29 39 10 20 30 40
The first and second columns are the left channel, and the third and fourth columns are the right channel.
I leave the rest to you!
.
Thanh Vu Phuong
Thanh Vu Phuong 2021 年 10 月 21 日
Thanks a lot. I really appreciate it
Star Strider
Star Strider 2021 年 10 月 21 日
My pleasure!
.

サインインしてコメントする。

製品

リリース

R2016b

タグ

質問済み:

2021 年 10 月 20 日

コメント済み:

2021 年 10 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by