• 大小: 3KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-05-07
  • 语言: Matlab
  • 标签: 基音  周期  提取  

资源简介

matlab用自相关算法实现基音周期提取 。主要针对浊音部分的周期进行提取。从而可以得到基音频率

资源截图

代码片段和文件信息


function [periodperiod_freperiod_num]=pitch_period(yFsbits)
%filename =‘zhuoyin.wav‘;
%[yFsbits]=wavread(filename);
%sound(w,fs,bits)播放w向量对应的声音
lefty = y(:1);
wavesize=length(y);

%================fir滤波========================%
b =[-0.0113    0.0242   -0.0222    0.0066    0.0201   -0.0274    0.0052    0.0346   -0.0475    0.0056...
0.0729   -0.1106    0.0059    0.5481    0.5481    0.0059   -0.1106    0.0729    0.0056   -0.0475...
0.0346    0.0052   -0.0274    0.0201    0.0066   -0.0222    0.0242   -0.0113];
[hw]= freqz(b1882);
% waveout1 = filter(b1lefty);
waveoutYuJiaZhong= filter([1  -0.9375]1lefty);
waveoutspeech = filter(b1lefty);

%====================基音周期滤波=======================%
%2Khz低通hamming
b =[ 0.0054    0.0074    0.0130    0.0221    0.0341    0.0481...
    0.0628    0.0764    0.0874    0.0947    0.0972    0.0947...
   0.0874    0.0764    0.0628    0.0481    0.0341    0.0221...
    0.0130    0.0074    0.0054];
waveoutpitch = filter(b1lefty);
%====================最大幅度=======================%
N=round(3*Fs/100)
between=floor(N/2);
frameNumber =floor(wavesize/between)-1;
Tlefty=waveoutpitch ;
% Axiaobo=zeros(wavesize1);
% 整个时域上的基音周期轨迹
pitch =zeros(1frameNumber);
% 一帧中的自相关函数
R1=zeros(N1);
%显示一帧自相关

for ii=1:frameNumber
        %
        startPositon=(between)*(ii-1)+1;
    %      startPositon=(between)*(ii-1)+1; 
      

评论

共有 条评论