Exemple #1
0
 /// <summary>
 ///   Parameter less constructor
 /// </summary>
 public FingerprintManager()
 {
     WaveletDecomposition = new HaarWavelet();
     LogBins               = 256;//32;
     FingerprintLength     = 128;
     Overlap               = 64;
     SamplesPerFingerprint = FingerprintLength * Overlap;
     WdftSize              = 2048;  //2048;
     MinFrequency          = 27.5f; //318;
     MaxFrequency          = 5512;  //2000; (22050)
     TopWavelets           = 200;
     SampleRate            = 44100; //5512;
     LogBase               = Math.E;
     _logFrequenciesIndex  = GetLogFrequenciesIndex(SampleRate, MinFrequency, MaxFrequency, LogBins, WdftSize, LogBase);
 }
    void Coloring(HaarWavelet.ScalePack[] packs)
    {
        /*
        for (int i = 0; i < packs.Length; i++)
        {
            for (int j = 0; j < packs[i].Size - 1; j++)
            {
                Debug.DrawLine(new Vector3(j, packs[i].Diff[j]), new Vector3(j + 1, packs[i].Diff[j + 1]));
            }
        }
        */
        int cnt = 0;
        for (int i = 0; i < all_data.Length - 1; i += 440)
        {
            const float d = 1f / 440f;
            Debug.DrawLine(new Vector3(cnt * 0.01f, all_data[i] * 100), new Vector3((cnt + 1) * 0.01f, all_data[i + 1] * 100));
            cnt++;
        }

        cnt = 0;
        for (int i = 0; i < all_data.Length; i++)
            if (all_data[i] == 0f) cnt++;
        Debug.Log(cnt);
    }