コード認識に関するプロジェクトに取り組んでいます。どなたかの日記を参考にしていますが、DSPの分野についてはまだほとんど把握できていません。彼女の参考文献では、最初に wav ファイルからの信号をフレーム数に分割する必要があります。私の場合、フレームごとに 2866 サンプルで、各フレームを 65 ミリ秒に分割する必要があります。
信号をフレームに分割する方法を検索しましたが、理解できるほど明確ではありません。これまでのところ、これらは WavProcessing クラスの私のコードの一部です:
public void SetFileName(String fileNameWithPath) //called first in the form, to get the FileStream
{
_fileNameWithPath = fileNameWithPath;
strm = File.OpenRead(_fileNameWithPath);
}
public double getLengthTime(uint wavSize, uint sampleRate, int bitRate, int channels)
{
wavTimeLength = ((strm.Length - 44) / (sampleRate * (bitRate / 8))) / channels;
return wavTimeLength;
}
public int getNumberOfFrames() //return number of frames, I just divided total length time with interval time between frames. (in my case, 3000ms / 65 ms = 46 frames)
{
numOfFrames = (int) (wavTimeLength * 1000 / _sampleFrameTime);
return numOfFrames;
}
public int getSamplePerFrame(UInt32 sampleRate, int sampleFrameTime) // return the sample per frame value (in my case, it's 2866)
{
_sampleRate = sampleRate;
_sampleFrameTime = sampleFrameTime;
sFr = (int)(sampleRate * (sampleFrameTime / 1000.0 ));
return sFr;
}
C# で信号をフレームごとに 65 ミリ秒に分割する方法がまだわかりません。FileStream を分割してフレームに分割し、配列に保存する必要がありますか? それとも何か?