aihot  2017-04-27 08:03:28  OpenCV |   查看评论   
  •         }  
  •         energyTmp.push_back(sum);  
  •         nodeCount++;  
  •     }  
  •   
  •     // 转换为短型显示 
  •     vector<short> energy;  
  •   
  •     // 填补边界元素
  •     short tmp = (short)(energyTmp[0] * 400 / maxEnergy);  
  •     for (int i = 0; i < nodesPerFrame * 0.5; i++)  
  •     {  
  •         energy.push_back(tmp);  
  •     }  
  •     for (int i = 0; i < energyTmp.size(); i++)  
  •     {  
  •         energy.push_back((short)(energyTmp[i] * 400 / maxEnergy));  
  •     }  
  •     // 填补边界元素
  •     tmp = (short)(energyTmp[energyTmp.size() - 1] * 400 / maxEnergy);  
  •     for (int i = 0; i < nodesPerFrame * 0.5; i++)  
  •     {  
  •         energy.push_back(tmp);  
  •     }  
  •   
  •     // 显示 
  •     Mat showEnergy;  
  •     wav2image(showEnergy, energy, 0, energy.size(), 400);  
  •     line(showEnergy, Point(0, showEnergy.rows - 1), Point(showEnergy.cols, showEnergy.rows - 1), Scalar(0, 0, 255), 2);  
  •     imshow("showEnergy", showEnergy);  
  •     while (waitKey(30) != ' ');  
  •   
  •     // 单独的声音和声音
  •     float thresVoice = 400 * 0.15;  
  •     line(showEnergy, Point(0, showEnergy.rows - thresVoice), Point(showEnergy.cols, showEnergy.rows - thresVoice), Scalar(0, 255, 255), 2);  
  •     imshow("showEnergy", showEnergy);  
  •     while (waitKey(30) != ' ');  
  •   
  •     // 找到过渡点并绘制它们
  •     bool high = 
  •  

    除特别注明外,本站所有文章均为 赢咖4注册 原创,转载请注明出处来自语音信号处理之(二)基音周期估计(Pitch Detection)

    留言与评论(共有 0 条评论)
       
    验证码:
    [lianlun]1[/lianlun]