double_ck.m
Upload User: xxy784
Upload Date: 2015-01-28
Package Size: 726k
Code Size: 1k
Development Platform:

Matlab

  1. %Pitch Double Check--Using a kind of signal
  2. %Input:
  3. %        sig_in(input signal)
  4. %        p(fractal pitch)
  5. %        Dth(threshold)
  6. %Output:
  7. %        pc(pitch after double_chk)
  8. %        cor_pc(corresponding correlation)
  9. function [pc,cor_pc]=double_ck(sig_in,p,Dth)
  10. pmin=20;                                                             %minimum pitch
  11. [pc,cor_pc]=fpr(sig_in,round(p));                                    %fractal pitch refine
  12. for n=1:7                                                            %Search the very pitch
  13.    k=9-n;
  14.    temp_pit=round(pc/k);
  15.    if temp_pit>=pmin
  16.       [temp_pit,temp_cor]=FPR(sig_in,temp_pit);
  17.       if temp_pit<30
  18.          temp_cor=double_ver(sig_in,temp_pit,temp_cor);
  19.       end
  20.       if temp_cor>Dth*cor_pc
  21.          [pc,cor_pc]=fpr(sig_in,round(temp_pit));
  22.          break;
  23.       end
  24.    end
  25. end
  26. if pc<30
  27.    cor_pc=double_ver(sig_in,pc,cor_pc);                              %Remove furious short pitch
  28. end