/// <summary>
        /// Odwrotna transformata Fouriera
        /// </summary>
        /// <param name="frequencyBuffer"></param>
        /// <param name="ft"></param>
        /// <returns></returns>
        public AnalogSignal iDFT(Complex[] frequencyBuffer, FourierTransform ft)
        {
            int N = frequencyBuffer.Length;

            Complex[] resultCourse = ft.iDFT(frequencyBuffer, N);

            for (int i = 0; i < N; i++)
            {
                this.course[i] = resultCourse[i].Real + resultCourse[i].Imaginary;
            }
            return(this);
        }
        public double[] iDFT2(Complex[] frequencyBuffer, FourierTransform ft)
        {
            int N = frequencyBuffer.Length;

            double[]  resultArray  = new double[lengthOfBuffer];
            Complex[] resultCourse = ft.iDFT(frequencyBuffer, N);

            for (int i = 0; i < N; i++)
            {
                resultArray[i] = resultCourse[i].Real + resultCourse[i].Imaginary;
            }
            return(resultArray);
        }
Esempio n. 3
0
 /// <summary>
 /// Konstruktor
 /// </summary>
 public SpectrumGraph(int x, int y, int Height, int Width, string description)
     : base(x, y, Height, Width, "Frequency", "Amplitude", description, "SPECTRUM")
 {
     FT = new FourierTransform();
 }
Esempio n. 4
0
        /// <summary>
        /// Funkcja inicjalizująca obiekty sygnałów do wybranego labolatorium
        /// </summary>
        private void initialize(int lab)
        {
            Controls.Remove(courseGraph1);
            Controls.Remove(courseGraph2);
            Controls.Remove(courseGraph3);
            Controls.Remove(courseGraph4);

            Controls.Remove(spectrumGraph1);
            Controls.Remove(spectrumGraph2);
            Controls.Remove(spectrumGraph3);
            Controls.Remove(spectrumGraph4);

            courseGraph1 = null;
            courseGraph2 = null;
            courseGraph3 = null;
            courseGraph4 = null;

            spectrumGraph1 = null;
            spectrumGraph2 = null;
            spectrumGraph3 = null;
            spectrumGraph4 = null;

            signal1 = null;
            signal2 = null;
            signal3 = null;

            digital = null;

            ft = new FourierTransform();

            this.Controls.Clear();

            switch (lab)
            {
            case 1:
                initialize_Lab1_Lab2();
                break;

            case 2:
                initialize_Lab3();
                break;

            case 3:
                initialize_Lab4_ASK();
                break;

            case 4:
                initialize_Lab4_FSK_PSK();
                break;

            case 5:
                initialize_Lab5_ASK();
                break;

            case 6:
                initialize_Lab5_PSK();
                break;

            case 7:
                initialize_Lab5_FSK();
                break;

            case 8:
                initialize_SquareTriangleSaw();
                break;

            case 9:
                initialize_MSE();
                break;

            case 10:
                initialize_MSEPlot();
                break;

            case 11:
                initialize_Correlation_1();
                break;

            case 12:
                initialize_Correlation_2();
                break;

            case 13:
                initialize_IDFT();
                break;

            case 14:
                initialize_Sinc();
                break;

            case 15:
                initialize_FilteringOfNoise();
                break;

            case 16:
                initialize_generateFilter_1();
                break;

            case 17:
                initialize_generateFilter_2();
                break;

            case 18:
                initialize_generateFilter_3();
                break;

            case 19:
                initialize_CDMA();
                break;

            default:
                initialize_Lab1_Lab2();
                break;
            }
            Controls.Add(courseGraph1);
            Controls.Add(courseGraph2);
            Controls.Add(courseGraph3);
            Controls.Add(courseGraph4);

            Controls.Add(spectrumGraph1);
            Controls.Add(spectrumGraph2);
            Controls.Add(spectrumGraph3);
            Controls.Add(spectrumGraph4);

            InitializeComponent();
        }