亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? activlev.m

?? voice box tool box for matlab
?? M
字號:
function [lev,af,fso]=activlev(sp,fs,mode)
%ACTIVLEV Measure active speech level as in ITU-T P.56 [LEV,AF,FSO]=(SP,FS,MODE)
%
%Inputs: SP is the speech signal (with better than 20dB SNR)
%        FS is the sample frequency in Hz (see also FSO below)
%        MODE is a combination of the following:
%            r - raw omit input filters (default is 200 Hz to 5.5 kHz)
%            0 - no high pass filter (i.e. include DC)
%            4 - high pass filter at 40 Hz (but allows mains hum to pass)
%            1 - use cheybyshev 1 filter
%            2 - use chebyshev 2 filter (default)
%            e - use elliptic filter
%            h - omit low pass filter at 5.5 kHz
%            d - give outputs in dB rather than power

%Outputs:
%        LEV gives the speech level in units of power (or dB if mode='d')
%            if mode='l' is specified, LEV is a row vector with the "long term
%            level" as its second element (this is just the mean power)
%        AF  is the activity factor (or duty cycle) in the range 0 to 1 
%        FSO is a column vector of intermediate information that allows
%            you to process a speech signal in chunks. Thus:
%
%            fso=fs; for i=1:inc:nsamp, [lev,fso]=activlev(sp(i:i+inc-1),fso,mode); end
%
%            is equivalent to:                lev=activlev(sp(1:nsamp),fs,mode)
%
%            but is much slower. The two methods will not give identical results
%            because they will use slightly different threshods.

%For completeness we list here the contents of the FSO structure:
%
%   ffs : sample frequency
%   fmd : mode string
%    nh : hangover time in samples
%    ae : smoothing filter coefs
%    bl : 200Hz HP filter numerator
%    al : 200Hz HP filter denominator
%    bh : 5.5kHz LP filter numerator
%    ah : 5.5kHz LP filter denominator
%    ze : smoothing filter state
%    zl : 200Hz HP filter state
%    zh : 5.5kHz LP filter state
%    zx : hangover max filter state
%  emax : maximum envelope exponent + 1
%   ssq : signal sum of squares
%    ns : number of signal samples
%    ss : sum of speech samples (not actually used here)
%    kc : cumulative occupancy counts

%      Copyright (C) Mike Brookes 2008
%      Version: $Id: activlev.m,v 1.7 2008/04/04 08:19:21 dmb Exp $
%
%   VOICEBOX is a MATLAB toolbox for speech processing.
%   Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   This program is free software; you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as published by
%   the Free Software Foundation; either version 2 of the License, or
%   (at your option) any later version.
%
%   This program is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You can obtain a copy of the GNU General Public License from
%   http://www.gnu.org/copyleft/gpl.html or by writing to
%   Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

persistent nbin thresh c25zp c15zp e5zp
if isempty(nbin)
    nbin=20;    % 60 dB range at 3dB per bin
    thresh=15.9;    % threshold in dB
    % High pass s-domain zeros and poles of filters with passband ripple<0.25dB, stopband<-50dB, w0=1
    %    w0=fzero(@ch2,0.5); [c2z,c2p,k]=cheby2(5,50,w0,'high','s');
    %    function v=ch2(w); [c2z,c2p,k]=cheby2(5,50,w,'high','s'); v= 20*log10(prod(abs(1i-c2z))/prod(abs(1i-c2p)))+0.25;
    c25zp=[0.37843443673309i 0.23388534441447i; -0.20640255179496+0.73942185906851i -0.54036889596392+0.45698784092898i];
    c25zp=[[0; -0.66793268833792] c25zp conj(c25zp)];
    %       [c1z,c1p,c1k] = cheby1(5,0.25,1,'high','s');
    c15zp=[-0.659002835294875+1.195798636925079i -0.123261821596263+0.947463030958881i];
    c15zp=[zeros(1,5); -2.288586431066945 c15zp conj(c15zp)];
    %      [ez,ep,ek] = ellip(5,0.25,50,1,'high','s')
    e5zp=[0.406667680649209i 0.613849362744881i; -0.538736390607201+1.130245082677107i -0.092723126159100+0.958193646330194i];
    e5zp=[[0; -1.964538608244084]  e5zp conj(e5zp)];
    %    w=linspace(0.2,2,100);
    %    figure(1); plot(w,20*log10(abs(freqs(real(poly(c15zp(1,:))),real(poly(c15zp(2,:))),w)))); title('Chebyshev 1');
    %    figure(2); plot(w,20*log10(abs(freqs(real(poly(c25zp(1,:))),real(poly(c25zp(2,:))),w)))); title('Chebyshev 2');
    %    figure(3); plot(w,20*log10(abs(freqs(real(poly(e5zp(1,:))),real(poly(e5zp(2,:))),w)))); title('Elliptic');
end

if ~isstruct(fs)                        % no state vector given
    if nargin<3
        mode=' ';
    end
    fso.ffs=fs;                       	% sample frequency
    if any(mode=='r')                   % included for backward compatibility
        mode=['0h' mode];               % abolish both filters
    elseif fs<14000
        mode=['h' mode];               % abolish lowpass filter at low sample rates
    end
    fso.fmd=mode;                      % save mode flags
    ti=1/fs;
    g=exp(-ti/0.03);                    % pole position for envelope filter
    fso.ae=[1 -2*g g^2]/(1-g)^2;        % envelope filter coefficients (DC gain = 1)
    fso.ze=zeros(2,1);
    fso.nh=ceil(0.2/ti)+1;              % hangover time in samples
    fso.zx=-Inf;                        % initial value for maxfilt()
    fso.emax=-Inf;                      % maximum exponent
    fso.ns=0;
    fso.ssq=0;
    fso.ss=0;
    fso.kc=zeros(nbin,1);               % cumulative occupancy counts
    % s-plane zeros and poles of high pass 5'th order filter -0.25dB at w=1 and -50dB stopband
    if any(mode=='1')
        szp=c15zp;            % Chebyshev 1
    elseif any(mode=='e')
        szp=e5zp;             % Elliptic
    else
        szp=c25zp;            % Chebyshev 2
    end
    if all(mode~='0')
        if any(mode=='4')
            fl=40;               % 40 Hz cutoff
        else
            fl=200;              % 200 Hz cutoff
        end
        zl=2./(1-szp*tan(fl*pi/fs))-1;      % 200 Hz LF limit
        al=real(poly(zl(2,:)));              % high pass filter
        bl=real(poly(zl(1,:)));
        sw=1-2*rem(0:5,2).';
        fso.bl=bl*(al*sw)/(bl*sw);                  % scale to give HF gain of 1
        fso.al=al;
        fso.zl=zeros(5,1);                   % LF filter state
    end
    if all(mode~='h')
        zh=2./(szp/tan(5500*pi/fs)-1)+1;
        ah=real(poly(zh(2,:)));
        bh=real(poly(zh(1,:)));
        fso.bh=bh*sum(ah)/sum(bh);
        fso.ah=ah;
        fso.zh=zeros(5,1);
    end
else
    fso=fs;             % use existing structure
end
md=fso.fmd;
ns=length(sp);
if ns                       % process this speech chunk
    % apply the input filters to the speech
    if all(md~='0')
        [sp,fso.zl]=filter(fso.bl,fso.al,sp(:),fso.zl);     % highpass filter
    end
    if all(md~='h')
        [sp,fso.zh]=filter(fso.bh,fso.ah,sp(:),fso.zh);     % lowpass filter
    end
    fso.ns=fso.ns+ns;      % count the number of speech samples
    fso.ss=fso.ss+sum(sp);  % sum of speech samples
    fso.ssq=fso.ssq+sum(sp.*sp);    % sum of squared speech samples
    [s,fso.ze]=filter(1,fso.ae,abs(sp(:)),fso.ze);     % envelope filter
    [qf,qe]=log2(s.*s);         % take efficient log2 function, 2^qe is upper limit of bin
    qe(qf==0)=-Inf;           % fix zero values
    [qe,qk,fso.zx]=maxfilt(qe,1,fso.nh,1,fso.zx);       % apply the 0.2 second hangover
    oemax=fso.emax;
    fso.emax=max(oemax,max(qe)+1);
    if fso.emax==-Inf
        fso.kc(1)=fso.kc(1)+ns;
    else
        qe=min(fso.emax-qe,nbin);   % force in the range 1:nbin
        wqe=ones(length(qe),1);
        % below: could use kc=cumsum(accumarray(qe,wqe,nbin)) but unsure about backwards compatibility
        kc=cumsum(full(sparse(qe,wqe,wqe,nbin,1)));    % cumulative occupancy counts
        esh=fso.emax-oemax;         % amount to shift down previous bin counts
        if esh<nbin-1
            kc(esh+1:nbin-1)=kc(esh+1:nbin-1)+fso.kc(1:nbin-esh-1);
            kc(nbin)=kc(nbin)+sum(fso.kc(nbin-esh:nbin));
        else
            kc(nbin)=kc(nbin)+sum(fso.kc);
        end
        fso.kc=kc;
    end
end
if fso.ns                       % now calculate the output values
    if fso.ssq>0
        aj=10*log10(fso.ssq*(fso.kc).^(-1));
        % equivalent to cj=20*log10(sqrt(2).^(fso.emax-(1:nbin)-1));
        cj=10*log10(2)*(fso.emax-(1:nbin)-1);   % lower limit of bin j in dB
        mj=aj'-cj-thresh;
        jj=find(mj*sign(mj(1))<=0); % Find threshold
        if isempty(jj)
            jj=length(mj)-1;
            jf=1;
        else
            jj=max(jj(1)-1,1);                   % integer part of j (>=1 in case mj(1)=0)
            jf=1/(1-mj(jj+1)/mj(jj));   % fractional part of j using linear interpolation
        end
        lev=aj(jj)+jf*(aj(jj+1)-aj(jj)); % active level in decibels
        lp=10.^(lev/10);
        if all(md~='d')
            lev=lp;
        end
        af=fso.ssq/(fso.ns*lp);
    else
        af=0;
        if all(md~='d')
            lev=0;
        else
            lev=-200;
        end
    end
end
if ~nargout
    lev=10*log10(lp);
    subplot(211);
    plot((1:ns)/fso.ffs,[sp s (qe<=jj)*sqrt(lp)]);
    xlabel('Time (s)');
    title(sprintf('Active Level = %.2g dB, Activity = %.0f%% (ITU-T P.56)',lev,100*af));
    ylabel('Amplitude');
    legend('Signal','Smoothed envelope','Active Level','Location','SouthEast');
    subplot(212);
    plot(cj,repmat(lev,nbin,1),'k:',cj,[aj(:) cj(:)+thresh cj(:)]);
    xlabel('Threshold (dB)');
    ylabel('Active Level (dB)');
    legend('Active Level','Speech Level',sprintf('Threshold+%.1f dB',thresh),'Threshold','Location','SouthEast');
end

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品粉嫩aⅴ一区二区三区四区| 国产一区二区在线影院| 宅男在线国产精品| 粉嫩13p一区二区三区| 一区二区三区日韩| 久久久久9999亚洲精品| 欧美精品久久久久久久久老牛影院| 国产成人日日夜夜| 首页欧美精品中文字幕| 亚洲综合丁香婷婷六月香| 自拍偷拍亚洲欧美日韩| 国产精品久久久久久福利一牛影视| 亚洲成人一二三| 三级不卡在线观看| 蜜臀av亚洲一区中文字幕| 极品少妇xxxx偷拍精品少妇| 免费看精品久久片| 亚洲午夜一二三区视频| 亚洲欧洲综合另类| 亚洲一区二区视频在线| 亚洲高清免费在线| 激情综合色综合久久综合| 国产福利一区二区| 国产91清纯白嫩初高中在线观看| 国产·精品毛片| 国产a区久久久| 色综合久久久久久久久久久| 色吊一区二区三区| 欧美伊人精品成人久久综合97 | 国产一区二区免费在线| 国精产品一区一区三区mba桃花 | 91国内精品野花午夜精品| 欧美日韩一区精品| 日韩精品一区二区三区视频在线观看 | 日韩av电影免费观看高清完整版| 亚洲五月六月丁香激情| 日韩av成人高清| 成人免费视频一区二区| 欧美一区二区三区四区高清| 欧美va天堂va视频va在线| 国产精品久久久久久户外露出 | 国产成人综合自拍| 欧美日韩国产免费| 亚洲国产激情av| 日本色综合中文字幕| 成人午夜在线免费| 日韩精品专区在线影院重磅| 亚洲女同女同女同女同女同69| 麻豆精品久久久| 欧美视频完全免费看| 亚洲欧洲av另类| 国产精品一区二区在线观看不卡 | 中文久久乱码一区二区| 男女男精品视频| 欧美综合一区二区| 亚洲区小说区图片区qvod| 国产福利一区二区三区| 综合网在线视频| 激情图片小说一区| 久久久久综合网| 久久精品国产**网站演员| 91国偷自产一区二区三区观看 | 国产欧美日韩久久| 国产乱对白刺激视频不卡| 精品国产凹凸成av人导航| 激情另类小说区图片区视频区| 欧美电影一区二区| 成人精品国产一区二区4080| 国产欧美一区二区三区沐欲| 国产福利一区二区三区视频在线 | 欧美日韩国产综合一区二区| 日韩国产欧美视频| 欧美一区二区三区免费| 国模娜娜一区二区三区| 国产婷婷色一区二区三区| 国产99久久久国产精品潘金网站| 久久久777精品电影网影网| 国产精品一二三| 1区2区3区精品视频| 91蜜桃网址入口| 一区二区三区欧美在线观看| 欧美日韩国产三级| 蜜臀av在线播放一区二区三区| 日韩欧美国产三级电影视频| 韩国av一区二区三区四区 | 国产精品亲子乱子伦xxxx裸| 97精品国产露脸对白| 丝瓜av网站精品一区二区| 精品国产百合女同互慰| 色综合咪咪久久| 韩国女主播成人在线| 亚洲国产精品嫩草影院| 亚洲伦在线观看| 欧美一区二区三区免费在线看| 福利91精品一区二区三区| 亚洲国产一区二区a毛片| 国产亚洲精品超碰| 在线播放一区二区三区| 成人精品国产免费网站| 久久精品国产一区二区三区免费看| 国产精品激情偷乱一区二区∴| 日韩一区和二区| 91久久精品午夜一区二区| 国产一区二区三区免费观看| 一区二区高清免费观看影视大全| 精品欧美一区二区久久| 欧美性xxxxx极品少妇| av色综合久久天堂av综合| 韩国欧美一区二区| 日韩电影在线看| 亚洲国产精品久久久久秋霞影院| 国产精品久久久久久久久果冻传媒| 久久蜜桃av一区精品变态类天堂| 欧美精品一级二级三级| 一本高清dvd不卡在线观看| www.亚洲在线| caoporen国产精品视频| 成人午夜视频网站| 经典三级视频一区| 日韩av电影免费观看高清完整版| 午夜精品福利视频网站| 亚洲国产精品一区二区www在线| 亚洲第一成人在线| 亚洲美女淫视频| 一个色综合网站| 337p日本欧洲亚洲大胆色噜噜| 欧美视频一区在线| 91久久精品网| voyeur盗摄精品| 国产精品 欧美精品| 激情小说欧美图片| 国产麻豆成人传媒免费观看| 男男成人高潮片免费网站| 麻豆极品一区二区三区| 蜜臀av性久久久久蜜臀aⅴ| 精品一区二区三区在线播放| 秋霞电影一区二区| 国模娜娜一区二区三区| 一本大道av一区二区在线播放| 欧美另类高清zo欧美| 久久九九久久九九| 亚洲国产综合色| 成人黄动漫网站免费app| 欧美三级日本三级少妇99| 久久精品视频免费| 亚洲综合成人在线| 国产一区二区三区免费播放| 99久久精品免费精品国产| 色av综合在线| 国产日韩欧美不卡| 捆绑调教一区二区三区| 色婷婷综合久久| 国产精品无码永久免费888| 免费欧美高清视频| 欧美精品vⅰdeose4hd| 亚洲精品午夜久久久| 国产91丝袜在线播放九色| 日韩亚洲欧美综合| 日本网站在线观看一区二区三区| 99久久久精品| 亚洲国产高清在线观看视频| 久久91精品国产91久久小草| 欧美美女黄视频| 亚洲夂夂婷婷色拍ww47| 色综合久久久久久久久| 综合分类小说区另类春色亚洲小说欧美 | 制服.丝袜.亚洲.中文.综合| 亚洲图片激情小说| caoporen国产精品视频| 国产精品乱码妇女bbbb| 国产999精品久久久久久绿帽| 国产视频在线观看一区二区三区 | 色综合网色综合| 一区二区三区在线视频免费观看| 国产69精品久久777的优势| 国产亚洲视频系列| 成人综合婷婷国产精品久久蜜臀 | 国产精品资源站在线| 国产女人18水真多18精品一级做| 看片的网站亚洲| 久久久777精品电影网影网| 成人av网站在线观看| 亚洲欧美日韩一区| 欧美视频中文字幕| 美女免费视频一区二区| 精品粉嫩aⅴ一区二区三区四区 | 久久综合色鬼综合色| 国产丶欧美丶日本不卡视频| 亚洲欧洲av色图| 欧美一区二区三区喷汁尤物| 国产福利一区二区三区视频在线| 国产精品乱码久久久久久| 欧美日韩高清在线| 岛国精品在线观看| 亚洲线精品一区二区三区八戒| 久久久影院官网| 色噜噜狠狠成人网p站| 久久国产成人午夜av影院| 玉足女爽爽91| 久久综合久色欧美综合狠狠|