I'm currently doing a thesis about chord recognition with EPCP with wav file as an input, but now I'm stuck at determining number of frames and frame size of a single wav file. I need those data as the parameters for hammingwindow function in NAudio library
public static double HammingWindow(int n, int frameSize)
I've retrieved all available wav headers, but I dont know how to get number of frames and frame size. Can I calculate it from given header data? Or is there another way?
If you were aware of what a hamming-window is, you would not ask a question like that. The wikipedia article tells you everything about it.
I myself am not an expert in DSP but I've been working with it for a few months now in my spare time. Everything I can tell you is that this is an absolutely complicated field! Nothing you can grasp in a week or so. Students get educated in this field for several semesters in high school. Just as a side note.
So, regarding your question :
You choose a block size, this is usually predetermined from your audio hardware. This always has a base of 2, so 128, 256 .... a typical one is 1024. This is your framesize.
When using WAV files, you can choose the framesize as you want. It should just meet the above mentioned criteria.
A window in this context is a "curve" that starts at time 0 with some value and ends at frameSize-1 with some value.
The parameter "n" of your function is the position within this window. The function returns a value between 0 and 1, which represents the value at "n".
NAudio has a WPF demo in which SampleAggregator.cs uses HammingWindow function. Did you check that sample and understand how it is used?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With