I have audio sample with size of 58 x 32. And I want to convert this sample into a 4 x4 matrix. Can anyone help me?

3 件のコメント

Clayton Gotberg
Clayton Gotberg 2021 年 4 月 26 日
There's not really enough information here to help. Do you mean that you want to turn this 56x32 matrix into a bunch of 4x4 matrices?
If you want to represent this matrix as a single 4x4 matrix, what information is in this matrix and what information needs to be in the 4x4 matrix? How was this matrix generated? Why does it need to be 4x4 instead of 56x32?
Winda Mariana
Winda Mariana 2021 年 4 月 26 日
sorry sir. I mean, i want to turn this 56x32 matrix into a bunch of 4x4 matrices
Winda Mariana
Winda Mariana 2021 年 4 月 26 日
So there will be 116 x 16 samples

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

 採用された回答

Clayton Gotberg
Clayton Gotberg 2021 年 4 月 26 日

0 投票

If I understand your new message correctly, you want to get all of the possible 4x4 matrices from this 56x32 matrix. In that case, try:
for j = 1:size(voice_frame,1)-3
for k = 1:size(voice_frame,2)-3
local_matrix{j,k} = voice_frame(j:j+3,k:k+3)
end
end
After this, the {j,k}th cell of local_matrix will be the 4x4 matrix in voice_frame that starts at (j,k).
If instead, you just want to break the big matrix up into smaller matrices, maybe this is closer:
for j = 1:size(voice_frame,1)/4
for k = 1:size(voice_frame,2)/4
local_matrix{j,k} = voice_frame(4*j-3:min(4*j,end),4*k-3:min(4*k,end))
end
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by