VIRTUAL EXPERIMENTS EXPERIMENT V-2 USING LABVIEW TO LEARN THE CONCEPT OF FREQUENCY SHIFT KEYING IN VIRTUAL EXPERIMENTATION OBJECTIVE: - To demonstrate the concept of Frequency Shift Keying Using Labview LABVIEW VIRTUAL EQUIPMENT NEEDED: 1. Signal simulators (3). 2. Case Structure Unit for randomization. 3. Switches. 4. Waveform chart displays 5. Selector function. 6. Absolute value generator. 7. Level comparator. 8. Low pass Filter. 9. Dynamic data to Scalar data converter. Preamble In frequency shift keying, logic levels were represented by different frequencies of signals. Most common is binary FSK (BFSK), where one amplitude is represented by a carrier frequency f1 while the other logic level is represented by carrier frequency f 2. (fig 1). FSK is less susceptible to noise than ASK. Fig 1. An FSK signal VFSK It is possible to convert signals to the amplitude shift keyed signal by the use of a Selector Switch. A Labview Selector Function is shown in Fig. 2. It returns the value wired to the t input or f input depending on the value of the signal on the s input. The signal on the s input must be a scalar function. If s is TRUE, this function returns the value wired to t at the output. If s is FALSE, this function returns the value wired to f. This is shown in Table 1 Fig. 2 Labview select function 2 Table 1 Select Signal s 0 1 Output Input B Input A THE EXPERIMENT For this experiment, we will use Labview’s Virtual capabilities to generate an FSK signal using a switching method. PART 1-TESTING THE SELECT FUNCTION SWITCH WITH WAVEFORMS AT THE INPUT i. Open page 1 of the Labview virtual experiment. Here the t and f inputs are connected to two sine waves of frequencies f1 and f2 as shown in Fig. 3. Set the sine wave 1 amplitude to 0.5V and its frequency to 1Hz. Also set sine wave 2 amplitude to 0.5V and its frequency to 10Hz. In later experiment, f1 will represent logic 1 while f2 will represent logic 0 Fig. 3 Select Function operation with waveform inputs Right click on the display chart and click on ‘properties’. Click on ‘scales’ and ensure there is a check √ on the ‘show scale label’ and ‘show scale’. Remove any check √ on the ‘autoscale’ box. Use the drop down arrow to select the X and Y axes. Although other appearances can be changed by clicking the ‘Appearance’ button, leave as it is for now. Set other values as follows: 3 Table 2 Time (X-Axis) Amplitude (yAxis) Minimum (sec) 0 -1 Maximum (sec) 5 1 Scaling factor 0-offset Press ‘ok’. ii. Run experiment by clicking on the ‘Run Continuously’ button. Click the Select Switch ON and OFF intermittently with a few seconds of each other and view the signal on the display which is a waveform chart. Question 1. What did you observe and which signal comes up when the Select Switch is ON? ii. Click the ‘Run Continuously’ button again with the select switch ON. After about 10 seconds, stop the running by clicking on the red ‘abort’ button. Count the no. of cycles of the sine wave between the minimum and the maximum on the time(X) axis display. Calculate f1 =(No. of Cycles)/(Max Time –Min. Time) and fill in below. f1= __________________Hz iii. Repeat for f2 when Select Switch is OFF and find f2 (In this case you will have to right click the display and set the waveform X-axis maximum to 1, using the same process sated above, so that you can easily count the number of waveforms of f2). f2= __________________Hz PART 2 GENERATION AND RETRIEVAL OF THE ASK SIGNAL Fig. 4 shows the overall diagram of the actual experimental setup. Here, input t is the carrier sign wave, input f is a zero level dc signal and input s is the message signal which is a square waveform. Fig. 4 Overall ASK generation and retrieval circuit 4 Randomizer The message signal (Fig. 7), is the signal whose FSK is to be generated. It can either be a square wave with 50% duty or a random signal of variable duty cycle, which can be obtained by turning ON the randomize switch which activates a Case Structure randomizer function of Labview. Figures 5 and 6 show the two carrier signals f1 and f2.The output of the Select Function switch is the FSK signal of fig. 8. RETRIEVAL OF ASK SIGNAL A level shifter and low pass filter form the detector that signal f2 from the FSK signal. The level shifter It was found that shifting one of the signals in the FSK signal with respect to the other simplified the final retrieval of the wanted signal. Signal f1 was shifted up with respect to f2 as shown in fig. 9. Fig. 5 Fig. 6 Fig. 7 Fig. 8 5 Fig. 9 Fig. 10 Fig. 11 Fig. 12 Low Pass Filter The low pass filter filters out the higher frequency f2 of the rectified ASK thereby leaving f1, as shown in Fig. 10. f1 represents logic 1 Comparator The comparator is used to convert the filter output to a real rectangular waveform. It has an adjustable dc signal at one of its input for varying one the level of one of comparator inputs until a good wave form that resembles the transmitted signal is obtained as shown in Fig. 11. i. Open page 3 of the Labview virtual experiment. Set the sine wave 1 amplitude to 0.5V and its frequency f1 to 1Hz. Also set sine wave 2 amplitude to 0.5V and its frequency f2 to 10Hz. f1 will represent logic 1 while f2 will represent logic 0 For now, keep the Randomize switch OFF. Table 3 Carrier Sine wave 1 Data Signal Carrier Sine wave 2 Amplitude 0.5 Frequency 1 Offset 0 0.5 0.5 0.2 10 0 0 6 On the appropriate experiment pages of the Labview Front Panels, set the chart displays according to Table 4, if they are not already set to those values. Use the same procedure mentioned in part 1 above. Table 4 Chart Minimum (sec) 0 -2 Maximum (sec) 10 2 Scaling factor Carrier, Data Page 3 Time (X-Axis) and ASK 0-offset Amplitude (ySignals Axis) ASK and ASK Page 4 Time (X-Axis) 0 10 with shifted Amplitude (y-2 2 carrier 1 Axis) signal Filtered Page 5 Time (X-Axis) 0 10 shifted ASK Amplitude (y-2 2 signal Axis) Retrieved Page 6 Time (X-Axis) 0 10 signal Amplitude (y-2 2 waveform Axis) from filtered waveform. Retrieved Page 7 Time (X-Axis) 0 10 signal and Amplitude (y-2 2 original data Axis) signal compared Note that you can change the chart scale at any time by right clicking on any of the chart, using the drop down arrow on ‘scale’ button to pick the signal of interest and changing the X or Y axes scale as desired. (The experiment MUST NOT be running when you want to change scales). a. Activating the ASK signal output Open to page 3 of the Labview virtual experiment Click the ‘Run Continuously’ button again. After about 20 seconds, activate the ASK signal output by turning its switch ON Describe what you notice in two or three sentences. Question 2 What happens when you don’t turn the switch ON at exactly the edge of the data signal? b. Activating the Carrier 1 shifted output Open to page 4 of the Labview virtual experiment Click the ‘Run Continuously’ button again. After about 20 seconds, Click the carrier 1 shift output enable switch. After about 30 seconds, stop the running by clicking on the red ‘abort’ Button. 7 i. Describe what you observe in one or two sentences. (Note that depending on the instant you click, the fist ASK signal section you see may not be incomplete. Subsequent ones will.) c. Activating the Filter output Open to page 5 of the Labview virtual experiment Using the control input button, set the filter cutoff frequency to 5Hz. Click the ‘Run Continuously button again. After about 30 seconds, switch on filter output enable switch. After about another 30 seconds, stop the running by clicking on the red ‘abort’ button. i. Describe what you observe in one or two sentences. Why is the signal with frequency f2 eliminated? Change the cutoff frequency to 20Hz and run again. ii. Describe what you observe in one or two sentences. d. Activating the Comparator outputs Open to page 6 of the Labview virtual experiment Using the Control Input button, set the comparator level control to 0.3 Click the ‘Run Continuously’ button again. After about 30 seconds, Click the Comparator output enable switch and let it run continuously. After about another 30 seconds, stop the running by clicking on the red ‘abort’ button. i. Describe what you observe at the output of the comparator in one or two sentences. Stop the running and change the comparator level to 0. Then run again. Question 3 Why are there so many unusual transitions now? PART 3.COMPARING THE RETRIEVED AND THE ORIGINAL MESSAGE SIGNALS Open to page 7 of the Labview virtual experiment Compare the retrieved and the original message signals. i. Describe what you observe in one or two sentences. The graph is hereby ‘stacked’ for the two signals. Right click on the chart and click on ‘overlay plots’. (Experiment should not be running when you do this). You would observe that there is a slight delay between the original message signal and the final retrieved signal at the output of the comparator. Question 4 Why is there a slight delay between the two signals? 8 PART 4 USING A RANDOM MESSAGE SIGNAL Normally, a practical message signal does not have a 50% duty ratio. The widths are random. In other to generate a random signal, go back to page 2 of the Labview virtual experiment and click the ‘Randomize switch’. Click the ‘Run Continuously’ button. With all switches still ON, open all the other pages starting from page 1 and note the various signals i. Describe what you observe in one or two sentences.