how to convert audio signal having (4.82MB size ,44100 as sampling frequency , stereo signal ) to different frame length that is 1024 samples,512 samples and 2048 samples?Whether I should resample it if not than how is it possible in matlab?
1 次查看(过去 30 天)
显示 更早的评论
my second question is that Can I convert this signal to different sampling rate also I mean at 22050Hz,48000hz etc.?or at different time interval 14.34 seconds,57.36seconds ?And its actual length in seconds is 28.68 seconds and total number of samples is 1264896?
0 个评论
采纳的回答
Walter Roberson
2015-8-24
framesize = 1024;
framedSignal = permute(reshape(YourSignal.', 2, framesize, []), [2 1 3]);
Now the first dimension of framedSignal is the sample number, the second dimension is the channel number, and the third dimension is the frame number.
2 个评论
Walter Roberson
2015-8-25
I should have written
framedSignal = permute(reshape(YourSignal.', size(YourSignal,2), framesize, []), [2 1 3]);
to account for the possibility that your signal has only 1 channel.
However, you told us that you had 1264896 samples and now your error message is as if you have only 12 samples.
1264896 samples is divisible into frames of length 256 but not into frames of length 512, 1024, or 2048. You have not defined how you want to handle the partial frames.
You should consider using buffer() once for each channel.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!