Exemplo n.º 1
0
        /// <summary>
        /// Funkcja inicjalizujaca sygnaly i ich wykresy dla lab5 dla demodulacji FSK
        /// </summary>
        private void initialize_Lab5_FSK()
        {
            Demodulation demodul = new Demodulation();
            string       word    = "10101011";

            courseGraph1 = new CourseGraph(10, 24, 150, 500, word);
            courseGraph2 = new CourseGraph(10, 184, 150, 500, "Kod FSK");
            courseGraph3 = new CourseGraph(10, 344, 150, 500, "Kod cyfrowy");

            digital = new DigitalSignal(word, 1000, 0.0625); //informacja

            // s. zmodulowany
            AnalogSignal FSK = new AnalogSignal(10, 0, 1000, 0.5).GenerateSinusSignal();

            FSK.FSK(digital, 2);

            // Rysowanie przebiegów:

            // Sygnał nośny
            courseGraph1.Signal = digital;
            courseGraph1.Limit(5000);
            courseGraph1.DrawGraph();

            //sygnal zmodulowany FSK
            courseGraph2.Signal = FSK;
            courseGraph2.Limit(5000);
            courseGraph2.DrawGraph();

            //Kod cyfrowy
            courseGraph3.Signal = demodul.demodulationFSK(FSK, 0.0625, 2); // demodulacja
            courseGraph3.Limit(5000);
            courseGraph3.DrawGraph();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Funkcja inicjalizujaca sygnaly i ich wykresy dla lab5 dla demodulacji ASK
        /// </summary>
        private void initialize_Lab5_ASK()
        {
            Demodulation demodul = new Demodulation();
            string       word    = "10101011";

            courseGraph1 = new CourseGraph(10, 24, 150, 500, "Nośna");
            courseGraph2 = new CourseGraph(10, 184, 150, 500, word);
            courseGraph3 = new CourseGraph(10, 344, 150, 500, "Kod ASK");

            signal1 = new AnalogSignal(7, 32.5, 1000, 0.5);  // nośna
            digital = new DigitalSignal(word, 1000, 0.0625); //informacja

            // s. nośny
            signal1.GenerateSinusSignal();

            // s. zmodulowany
            AnalogSignal ASK = new AnalogSignal(signal1);

            ASK.ASK(signal1, digital);

            // Rysowanie przebiegów:

            // Sygnał nośny
            courseGraph1.Signal = signal1;
            courseGraph1.Autoscale();
            courseGraph1.DrawGraph();

            //sygnal zmodulowany ASK
            courseGraph2.Signal = ASK;
            courseGraph2.Autoscale();
            courseGraph2.DrawGraph();

            //Kod cyfrowy
            courseGraph3.Signal = demodul.demodulationASKandPSK(ASK, 0.0625, 200, true);  // demodulacja
            courseGraph3.Autoscale();
            courseGraph3.DrawGraph();
        }