发生异常:矢量下标超出范围

时间:2015-10-13 07:01:45

标签: c++ visual-studio-2010 visual-studio-2013 signal-processing mfcc

我正在尝试使用aquila DSP LIb计算波浪的mfcc和dtw。但是当我执行以下代码时

 void main()
 {

     int frame_size =1024;

     Aquila::WaveFile waveIn0("a_converted.wav"); 
     Aquila::FramesCollection frameCollection0(waveIn0, frame_size);
     vector<vector<double>> dtwdt0;
     Aquila::Mfcc mfcc0(frame_size);

     for (int i=0; i<frameCollection0.count(); i++)
     {
         Aquila::Frame frame = frameCollection0.frame(i);
         vector<double> mfccValues = mfcc0.calculate(frame);
         dtwdt0.push_back(mfccValues);
     }

     Aquila::WaveFile waveIn1("a_converted.wav");
     Aquila::FramesCollection frameCollection1(waveIn1, frame_size);
     vector<vector<double>> dtwdt1;
     Aquila::Mfcc mfcc1(frame_size);

     for (int i = 0; i < frameCollection1.count(); i++)
     {
         Aquila::Frame frame = frameCollection1.frame(i);
         vector<double> mfccValues = mfcc1.calculate(frame);
         dtwdt1.push_back(mfccValues);
     }

     Aquila::Dtw dtw(Aquila::euclideanDistance,          Aquila::Dtw::PassType::Diagonals);
   double distance_1 = dtw.getDistance(dtwdt0, dtwdt1);
         cout << "Distance : " << distance_1 << endl;
  }
  

发生此异常。矢量下标超出范围文件:c:\ program files \ microsoft visual studio 8 \ vc \ include \ vector Line:   1124

可能是什么问题?

0 个答案:

没有答案