MATLAB: I have 6 audio signals each of length 2.32 sec,sampled at 44.1KHZ sampling rate with 16 bits floating point ,I want to divide these signals into frames each of length 23.2 msec(1024 samples) in matlab

audio to frame

length of signal=2.32 second, sampling frequency=441000 Hz, bits/sample=16

Best Answer

Use the reshape function:
signal = rand(2.32*44100, 6); % Create Data
for k1 = 1:6
colsize = fix(size(signal(:,k1),1)/1024)*1024; % Maximum Length For ‘reshape’
sig_mtx{k1} = reshape(signal(1:colsize, k1), 1024, []); % Columns Are Frames
end
I used a cell array here. You can use a 3D array if you prefer.
Related Question