分割音频信号

Posted

技术标签:

【中文标题】分割音频信号【英文标题】:Segmenting an audio signal 【发布时间】:2012-05-15 15:02:21 【问题描述】:

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

【问题讨论】:

【参考方案1】:

伪代码:

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;

【讨论】:

以上是关于分割音频信号的主要内容,如果未能解决你的问题,请参考以下文章

音频如何分割成两段音频?这些实用方法值得收藏

FFT怎样处理音频数字信号的

音频信号处理

把音频信号的左右声道连接起来,对电路有啥影响?

Python,pydub分割音频文件

Nios ii处理音频信号有何优点