我有一个音频信号输入作为双精度数组。我想通过将其分割成 25 毫秒的汉明窗口分析帧来制作该信号的帧,重叠率为 50%。我有计算汉明窗的代码。有人可以告诉我如何将音频信号分割成帧吗?首选伪代码或 Java 代码。
问问题
1112 次
1 回答
3
伪代码:
Fs = 44100; // sample rate, e.g. 44.1 kHz
overlap = 0.5; // overlap = 50%
nw = Fs * 0.025; // no of samples in window
ns = nw * (1.0 - overlap); // no of samples to increment n0, n1
n0 = 0; // window sample no begin
n1 = n0 + nw; // window sample no end
N = 10 * Fs; // N = total no of samples to process, e.g. 10 seconds
do
get nw samples from n0 to (n1 - 1) into temporary buffer
apply window function to temporary buffer
apply FFT to temporary buffer
... etc ...
n0 += ns; // increment window start/end by no of overlap samples
n1 += ns;
while n1 <= N;
于 2012-05-15T16:52:03.897 回答