コード例 #1
0
        void TestSafe(List <Wavelet> wavelets)
        {
            Int32 Level = 5;
            Int32 len   = 2048;

            //Int32 len = 32768;
            //Int32 len = 65536;
            //Int32 len = 131072;
            Double[] signal;
            Double[] signal2;
            Double   SumError1 = 0;
            Double   SumError2 = 0;
            Double   SumError3 = 0;

            signal = CreateSignal(SignalList.Doppler, 0, len);
            foreach (Wavelet wavelet in wavelets)
            {
                Transform.Forward1D(signal, out signal2, wavelet, Level);
                Transform.Inverse1D(signal2, out signal2, wavelet, Level);
                SumError1 = AuxFunctions.ErrorNorm(signal, signal2);
                Console.WriteLine(wavelet.Name + " " + SumError1);
            }
            signal = CreateSignal(SignalList.Mixed, 0, len);
            foreach (Wavelet wavelet in wavelets)
            {
                Transform.Forward1D(signal, out signal2, wavelet, Level);
                Transform.Inverse1D(signal2, out signal2, wavelet, Level);
                SumError2 = AuxFunctions.ErrorNorm(signal, signal2);
                Console.WriteLine(wavelet.Name + " " + SumError2);
            }
            signal = CreateSignal(SignalList.Rectangular, 0, len);
            foreach (Wavelet wavelet in wavelets)
            {
                Transform.Forward1D(signal, out signal2, wavelet, Level);
                Transform.Inverse1D(signal2, out signal2, wavelet, Level);
                SumError3 = AuxFunctions.ErrorNorm(signal, signal2);
                Console.WriteLine(wavelet.Name + " " + SumError3);
            }
        }