国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Audio-音頻降噪、回聲消除處理

這篇具有很好參考價(jià)值的文章主要介紹了Audio-音頻降噪、回聲消除處理。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

? ? ? ? 對(duì)音頻數(shù)據(jù)進(jìn)行處理時(shí)經(jīng)常會(huì)對(duì)mic陣列的選擇有很多特殊要求,當(dāng)原始錄取的音頻陣列排布有問(wèn)題時(shí),會(huì)進(jìn)行一些軟件的處理,使陣列排布達(dá)到一定的要求。

1.回聲消除對(duì)麥克陣列的特殊要求

Audio-音頻降噪、回聲消除處理

2.原始音頻MIC陣列排布處理

? ? ? ? ?對(duì)于4ch音頻數(shù)據(jù)而言,麥克陣列排列要求為mic1、mic2、ref1、ref2,但是通過(guò)tinycap采集的原始音頻數(shù)據(jù)的陣列排布為ref1、null、mic1、mic2,倆路mic分別對(duì)應(yīng)左右mic的音頻攝入,需要對(duì)mic陣列進(jìn)行一定處理。

Audio-音頻降噪、回聲消除處理

? ? ? ? check相關(guān)原始音頻pcm文件,ref通道攝入的是喇叭對(duì)應(yīng)的音頻,收集到的是設(shè)備播放音樂(lè)的聲音,同時(shí)mic通道也會(huì)攝入設(shè)備播放的音樂(lè)聲音,需要通過(guò)回聲消除處理對(duì)設(shè)備音進(jìn)行一定的處理。

Audio-音頻降噪、回聲消除處理?

? ? ? ? 針對(duì)麥克陣列排布不符合規(guī)定的代碼端處理,調(diào)整排列架構(gòu)符合要求。

struct pcm *pcm_open(unsigned int card, unsigned int device,
                     unsigned int flags, struct pcm_config *config)
{
    struct pcm *pcm;
    struct snd_pcm_info info;
    struct snd_pcm_hw_params params;
    struct snd_pcm_sw_params sparams;
    char fn[256];
    int rc;

    LOG("pcm_open card %d device %d channel %d period_size %d period_count %d format %d\n", card, device ,config->channels, config->period_size, config->period_count, config->format);

    ...
    ...

    if(card == 0 && device == 2 && config->rate == 64000){
        char *buffer;
        unsigned int ch1_first = 0, ch3_first = 0, i = 0;
        buffer = malloc(sizeof(char)*8);
        for(i = 0; i < 10 && ch1_first < 2 && ch3_first < 2; i++){
            pcm_mmap_read(pcm, buffer, 8);
            /* LOG("buffer[2] = 0x%x. buffer[3] = 0x%x buffer[6] = 0x%x. buffer[7] = 0x%x",
                *(buffer+2), *(buffer+i+3), *(buffer+6), *(buffer+7)); */
            if((*(buffer+2) == 0x00)&&(*(buffer+3) == 0x00))
                ch3_first++;
            if((*(buffer+6) == 0x00)&&(*(buffer+7) == 0x00))
                ch1_first++;
        }
        if(ch3_first > ch1_first){
            LOG("start channel ch3/4, do the conversion\n");
            printf("start channel ch3/4, do the conversion\n");
            pcm_mmap_read(pcm, buffer, 4);
        } else {
            LOG("start channel ch1/2 \n");
        }
        free(buffer);
    }

    LOG("pcm_open done pcm->fd = %d\n", pcm->fd);
    return pcm;
}

????????相關(guān)代碼執(zhí)行l(wèi)og

Audio-音頻降噪、回聲消除處理

Audio-音頻降噪、回聲消除處理

? ? ? ? 調(diào)整后的音頻pcm文件

Audio-音頻降噪、回聲消除處理

?

?3.音頻數(shù)據(jù)采樣精度、回采通道復(fù)用處理

? ? ? ? 原始錄取出來(lái)的音頻數(shù)據(jù)采樣精度為16bit,采樣頻率為16khz,且ref2因?yàn)橛布O(shè)計(jì)為null。為滿足麥克陣列的要求需對(duì)這樣的音頻數(shù)據(jù)進(jìn)行應(yīng)用層的處理,采樣精度:16bit -> 32bit,第二路回采信號(hào)復(fù)用第一路回采信號(hào)。

? ? ? ? 處理代碼如下:

//2mic: 4c 16k 16bit -> 4c 16k 32bit(copy 3ch -> 4ch)
    public static byte[] addCnFor2MicN4(byte[] data) {
        byte[] cpy=new byte[data.length*2];
        int j=0;

        //mic1 mic2 ref ref
        while(j<data.length/8) {
            cpy[16*j]=00;
            cpy[16*j+1]=  00;
            cpy[16 * j + 2] = data[8 * j +0];
            cpy[16* j + 3] = data[8 * j +1];

            cpy[16*j+4]=00;
            cpy[16*j+5]=  00;
            cpy[16 * j + 6] = data[8 * j +2];
            cpy[16* j + 7] = data[8 * j +3];

            cpy[16*j+8]=00;
            cpy[16*j+9]=  00;
            cpy[16 * j + 10] = data[8 * j +4];
            cpy[16* j + 11] = data[8 * j +5];

            cpy[16*j+12]=00;
            cpy[16*j+13]=  00;
            cpy[16 * j + 14] = data[8 * j +4];
            cpy[16* j + 15] = data[8 * j +5];

            j++;
        }
        return cpy;
    }

Audio-音頻降噪、回聲消除處理

? ? ? ? ?以下是一些項(xiàng)目中用到的對(duì)音頻數(shù)據(jù)進(jìn)行處理的方法:

    //6mic 8ch 32bits
    private byte[] addCnForMutiMic(byte[] data) {
        int datasize=data.length;
        byte[] newdata=new byte[datasize*2];//double to 16bit -> 32bit
        int j=0;
        int k=0;
        int index= 0;
        int step = datasize/2;

        while(j<step) {
            for (int i=1; i<9;i++) {
                k = 4*j;
                index= 2*j;
                newdata[k]=00;
                newdata[k+1]=00;
                newdata[k+2]=data[index];
                newdata[k+3]=data[index+1];
                j++;
            }

        }
        data = null;
        return newdata;
    }

    //4mic 8ch->6ch
    private byte[] adapeter4Mic(byte[] data) {
        //  int size = ((data.length/8)*2)*6;
        int size = (data.length/8)*6;
        byte[] cpy=new byte[size];
        int j=0;

        while(j<data.length/16) {

            cpy[12 * j + 0] = data[16 * j +0];
            cpy[12* j + 1] = data[16 * j +1];

            cpy[12 * j + 2] = data[16 * j +2];
            cpy[12* j + 3] = data[16 * j +3];


            cpy[12 * j + 4] = data[16 * j +4];
            cpy[12* j + 5] = data[16 * j +5];


            cpy[12 * j + 6] = data[16 * j +6];
            cpy[12* j + 7] = data[16 * j +7];

            cpy[12 * j + 8] = data[16 * j +12];
            cpy[12* j + 9] = data[16 * j +13];

            cpy[12 * j + 10] = data[16 * j +14];
            cpy[12* j + 11] = data[16 * j +15];

            j++;
        }
        return cpy;
    }

    //4mic:8ch -> 6ch
    private byte[] adapeter4Mic32bit(byte[] data) {
        //  int size = ((data.length/8)*2)*6;
        int size = (data.length/8)*6*2;

        byte[] cpy=new byte[size];
        int j=0;

        while(j<data.length/16) {

            cpy[24 * j + 0] = 0x00;
            cpy[24* j + 1] = 0x01;
            cpy[24 * j + 2] = data[16 * j +0];
            cpy[24* j + 3] = data[16 * j +1];

            cpy[24 * j + 4] = 0x00;
            cpy[24* j + 5] = 0x02;
            cpy[24 * j + 6] = data[16 * j +2];
            cpy[24* j + 7] = data[16 * j +3];

            cpy[24 * j + 8] = 0x00;
            cpy[24* j + 9] = 0x03;
            cpy[24 * j + 10] = data[16 * j +4];
            cpy[24* j + 11] = data[16 * j +5];

            cpy[24 * j + 12] = 0x00;
            cpy[24* j + 13] = 0x04;
            cpy[24 * j + 14] = data[16 * j +6];
            cpy[24* j + 15] = data[16 * j +7];

            cpy[24 * j + 16] = 0x00;
            cpy[24* j + 17] = 0x05;
            cpy[24 * j + 18] = data[16 * j +12];
            cpy[24* j + 19] = data[16 * j +13];

            cpy[24 * j + 20] = 0x00;
            cpy[24* j + 21] = 0x06;
            cpy[24 * j + 22] = data[16 * j +14];
            cpy[24* j + 23] = data[16 * j +15];

            j++;
        }
        return cpy;
    }

    //6mic 16bit-> 2mic 32bit
    private byte[] addCnFor2Mic(byte[] data) {
        byte[] cpy=new byte[data.length];
        int j=0;

        //mic1 mic2 ref ref
        while(j<data.length/16) {
            cpy[16 * j] = 00;
            cpy[16 * j + 1] = (byte) 1;
            cpy[16 * j + 2] = data[16 * j + 0];
            cpy[16 * j + 3] = data[16 * j + 1];

            cpy[16 * j + 4] = 00;
            cpy[16 * j + 5] = (byte) 2;
            cpy[16 * j + 6] = data[16 * j + 2];
            cpy[16 * j + 7] = data[16 * j + 3];

            cpy[16 * j + 8] = 00;
            cpy[16 * j + 9] = (byte) 3;
            cpy[16 * j + 10] = data[16 * j + 12];
            cpy[16 * j + 11] = data[16 * j + 13];

            cpy[16 * j + 12] = 00;
            cpy[16 * j + 13] = (byte) 4;
            cpy[16 * j + 14] = data[16 * j + 14];
            cpy[16 * j + 15] = data[16 * j + 15];

            j++;
        }
        return cpy;
    }

4.回聲消除效果

? ? ? ? 經(jīng)過(guò)回聲消除之后輸出的音頻數(shù)據(jù)是16k、16bit、單聲道數(shù)據(jù),經(jīng)過(guò)與之前的pcm文件對(duì)比可以看出數(shù)據(jù)的音樂(lè)聲音被消除,基本只留下了之前mic聲道里面說(shuō)話的聲音。

Audio-音頻降噪、回聲消除處理

?

總結(jié)

? ? ? ? 回聲消除和噪聲抑制都是音頻處理中必須要進(jìn)行的一些過(guò)程,這篇只是對(duì)這些處理之前的音頻數(shù)據(jù)進(jìn)行轉(zhuǎn)化的內(nèi)容進(jìn)行一下說(shuō)明,回聲消除與噪聲抑制的具體處理涉及到算法的優(yōu)化與解決,很難搞!文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-403788.html

到了這里,關(guān)于Audio-音頻降噪、回聲消除處理的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 回聲消除(AEC)原理、算法及實(shí)戰(zhàn)——AEC背景介紹

    回聲消除(AEC)原理、算法及實(shí)戰(zhàn)——AEC背景介紹

    回聲就是聲音信號(hào)經(jīng)過(guò)一系列反射之后,又聽到了自己講話的聲音,這就是回聲。 一些回聲是必要的,比如劇院里的音樂(lè)回聲以及延遲時(shí)間較短的房間回聲;而大多數(shù)回聲會(huì)造成負(fù)面影響,比如在有線或者無(wú)線通信時(shí)重復(fù)聽到自己講話的聲音(回想那些年我們開黑打游戲時(shí),

    2024年02月09日
    瀏覽(18)
  • 回聲消除(AEC)原理、算法及實(shí)戰(zhàn)——LMS(Least Mean Square)

    回聲消除(AEC)原理、算法及實(shí)戰(zhàn)——LMS(Least Mean Square)

    回聲消除是語(yǔ)音通信前端處理中的一種重要技術(shù),產(chǎn)生的原因是:在實(shí)時(shí)音視頻通話中,揚(yáng)聲器播放的聲音有再次錄進(jìn)了麥克風(fēng)去。 在即時(shí)通訊應(yīng)用中,需要進(jìn)行雙方,或是多方的實(shí)時(shí)語(yǔ)音交流,在要求較高的場(chǎng)合,通常都是采用外置音箱放音,這樣必然會(huì)產(chǎn)生回音,即一方

    2024年02月04日
    瀏覽(27)
  • Android 9 Audio系統(tǒng)筆記:AudioFlinger音頻流處理流程

    好久沒寫了,今天碰巧有個(gè)小伙伴問(wèn)我關(guān)于音頻流這一塊的,久了還有點(diǎn)記不起來(lái),我就順便寫一下,后面就不用又找一遍代碼了,所謂好記性不如爛筆頭。 所以,這里是關(guān)于如何從AudioTrack 寫入數(shù)據(jù)到audioflinger,以及audioflinger如何寫入到hal層的音頻流處理流程,主要寫一下

    2023年04月08日
    瀏覽(27)
  • chatgpt賦能python:Python音頻降噪處理:使用Python減少噪音并提升聲音質(zhì)量

    在日常生活中,使用音頻通信是非常普遍的。但是,由于各種原因,我們可能會(huì)遇到許多噪音干擾,從而降低語(yǔ)音質(zhì)量并影響通信的效果。為了解決這個(gè)問(wèn)題,我們可以使用Python來(lái)降噪音。 我們每天聽到的聲音都是由許多不同頻率的聲音波形組成的。噪音是指在聲音中添加了

    2024年02月03日
    瀏覽(25)
  • 探索音頻預(yù)處理的藝術(shù):Audio-Preprocessing-Scripts

    項(xiàng)目地址:https://gitcode.com/innnky/audio-preprocessing-scripts 在數(shù)據(jù)科學(xué)和人工智能領(lǐng)域,尤其是語(yǔ)音識(shí)別和音樂(lè)分析中,高質(zhì)量的音頻預(yù)處理是成功的關(guān)鍵步驟。今天,我們要介紹的是一個(gè)名為 Audio-Preprocessing-Scripts 的開源項(xiàng)目,它提供了豐富的工具和腳本,旨在幫助開發(fā)者和研究人

    2024年04月27日
    瀏覽(21)
  • 音頻處理:Audio DJ Studio for .NET-Crack

    音頻處理:Audio DJ Studio for .NET-Crack

    Audio DJ Studio for .NET ?is a .NET Windows Forms custom control developed by MultiMedia Soft that makes it easy to add sound playback and mixing capabilities to? Winform? and ?WPF applications ?written with? Microsoft Visual Studio ; thanks to the integration with DirectShow codecs and with the BASS library, both allowing decoding capabilities for the

    2024年01月23日
    瀏覽(20)
  • chatgpt賦能python:Python音頻降噪:如何利用Python降噪音頻?

    隨著音頻技術(shù)的不斷發(fā)展,音頻處理已經(jīng)成為了我們生活中不可或缺的一部分。在音頻處理的過(guò)程中,降噪技術(shù)是非常重要的一環(huán)。Python作為一種高級(jí)編程語(yǔ)言,已經(jīng)成為了音頻降噪領(lǐng)域的常用工具。在本篇文章中,我們將探討如何利用Python降噪音頻。 音頻降噪是指在音頻信

    2024年02月07日
    瀏覽(19)
  • 05|音頻降噪概述(1)一傳統(tǒng)降噪方法

    05|音頻降噪概述(1)一傳統(tǒng)降噪方法

    目錄 一. 噪聲的分類: 加性噪聲和乘性噪聲: 穩(wěn)態(tài)噪聲和非穩(wěn)態(tài)噪聲: 二. 如何降噪 1.線性濾波器: 2.譜減法 3.基于統(tǒng)計(jì)模型的實(shí)時(shí)降噪算法 3.1 核心思想: 3.2 基于兩個(gè)假設(shè): ?3.3 維納濾波 WebRTC原生降噪算法的三個(gè)特點(diǎn): 3.4 改進(jìn)方法OMLSA IMCRA 4.子空間算法 思想: 算法:

    2024年02月02日
    瀏覽(14)
  • 使用matlab進(jìn)行回聲處理(三重回聲)-數(shù)字信號(hào)處理課設(shè)

    使用matlab進(jìn)行回聲處理(三重回聲)-數(shù)字信號(hào)處理課設(shè)

    1.錄制一段聲音信號(hào),作為原音頻信號(hào),生成頻域與時(shí)域圖形,觀察與分析其時(shí)域 與頻域圖形。 2.對(duì)該音頻信號(hào)進(jìn)行時(shí)域處理,并且實(shí)現(xiàn)對(duì)該聲音信號(hào)添加第一層回聲。 3.對(duì)該音頻信號(hào)再繼續(xù)一次進(jìn)行時(shí)域處理,實(shí)現(xiàn)對(duì)該聲音信號(hào)添加第二層回聲。 4.將三段音頻信號(hào)進(jìn)行合成

    2024年02月03日
    瀏覽(33)
  • 音頻降噪模型匯總

    音頻降噪模型匯總

    從事語(yǔ)音降噪增強(qiáng)算法開發(fā)多年了,上學(xué)期間和入行的前段都是做傳統(tǒng)信號(hào)處理算法。19年以后基于深度學(xué)習(xí)的語(yǔ)音降噪模型憑借其優(yōu)秀的處理效果,一時(shí)風(fēng)頭無(wú)兩,似乎每個(gè)人都開始走上了模型降噪的路子。 特別是從2020年微軟開始舉辦的Deep Noise Suppression Challenge – INTERSP

    2023年04月23日
    瀏覽(22)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包