3

I'am building a voice morphing system using MATLAB and I need to divide the source and target, training and test samples into frames of 128 samples so that I can then apply DWT on each of the frame. So please guide me how to divide the vector into frames?

4

2 回答 2

6

You can change a vector into a matrix of equally-sized columns/rows (i.e. frames) using the reshape function:

x = rand(128 * 100, 1);
X = reshape(x, 128, 100);
% X is a 128-by-100 matrix; the i-th column of 128 elements 
% is addressed by X(:,i)
于 2012-01-22T15:59:02.363 回答
0

如果您有可用的信号处理工具箱,则使用 reshape 的替代方法是使用缓冲区。简单地 。. .

y = buffer(x,128)

..在你的例子中。如果原始信号 (x) 中的元素数不是 128 的整数倍,则缓冲区命令还将在最后一帧添加尾随零。

于 2012-04-18T17:37:01.493 回答