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?

3 views (last 30 days)
length of signal=2.32 second, sampling frequency=441000 Hz, bits/sample=16

Accepted Answer

Star Strider
Star Strider on 20 Aug 2015
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.

More Answers (1)

Walter Roberson
Walter Roberson on 20 Aug 2015
See the buffer() function if you have the signal processing toolbox. It is especially useful if you need to overlap the buffers.
  8 Comments
Walter Roberson
Walter Roberson on 22 Aug 2015
You cannot have an entity less than 1 bit, which is about 1E-4 Kilobyte. 3E-42 Kilobyte is getting down into the range of 1E-25 electrons -- not physically measurable without very very high precision equipment.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!