分割音频信号

时间:2012-05-15 15:02:22

标签: java algorithm audio signal-processing

我输入的音频信号为double数组。我想通过将其分成具有50%重叠的25毫秒汉明窗口分析帧来制作该信号的帧。我有计算汉明窗口的代码。有人可以告诉我如何将音频信号分割成帧吗?伪代码或Java代码首选。

1 个答案:

答案 0 :(得分:2)

伪代码:

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;