You are on page 1of 16

LAB 2: Introduction to Lab view and operations of discrete-time Sequence in

Lab view and Matlab.


Objective:-
 Introduction to lab view and operations in digital signal processing.
 The objective of this lab is to get familiar with the LABVIEW
Software required:-
o Computer work station
o Matlab 2015 or above
Theory
What is LabVIEW?
LabVIEW stands for Laboratory Virtual Instrument Electronic Workbench.
LabVIEW is a program development application, much like various commercial C or BASIC
development systems. However, LabVIEW is different from those applications in one
important respect. Other programming systems use text-based languages to create lines of
code, while LabVIEW uses a graphical programming language, G, to create programs in
block diagram form. LabVIEW uses terminology, icons, and ideas familiar to scientists and
engineers and relies on graphical symbols rather than textual language to describe
programming actions. LabVIEW has extensive libraries of functions and subroutines for most
programming tasks. For Windows, Macintosh, and Sun, LabVIEW contains application
specific libraries for data acquisition and VXI instrument control. LabVIEW also contains
application-specific libraries for GPIB and serial instrument control, data analysis, data
presentation, and data storage. LabVIEW includes conventional program development tools,
which helps to set breakpoints, animate program execution to see how data passes through
the program, and single-step through the program to make debugging and program
development easier.

Fig 1: LabVIEW Loading Window


Fig 2: LabVIEW Getting Started Window
How Does LabVIEW Work?

LabVIEW includes libraries of functions and development tools designed specifically


for instrument control. For Windows, Macintosh, and Sun, LabVIEW also contains libraries
of functions and development tools for data acquisition. LabVIEW programs are called
virtual instruments (VIs) because their appearance and operation imitate actual instruments.
However, they are analogous to functions from conventional language programs. VIs have
both an interactive user interface and a source code equivalent, and accept parameters from
higher-level VIs. The following are descriptions of these three VI features.

 VIs contains an interactive user interface, which is called the front panel because it
simulates the panel of a physical instrument. The front panel can contain knobs, push
buttons, graphs, and other controls and indicators. You input data using a keyboard
and mouse, and then view the results on the computer screen.

 VIs receives instructions from a block diagram which you construct in G. The block
diagram supplies a pictorial solution to a programming problem. The block diagram
contains the source code for the VI.

Fig 3: Front Panel Fig 4: Block


Diagram Panel

 VIs use a hierarchical and modular structure. You can use them as top-level programs,
or as subprograms within other programs or subprograms. A VI within another VI is
called a subVI .The icon and connector pane of a VI work like a graphical parameter
list so that other VIs can pass data to it as a subVI.

Fig 4: Front panel Toolbar


Functions Palette:
The Functions palette, shown in Figure 5, provides various function VIs or blocks for
building a system. This palette can be displayed by right-clicking on an open area of a Block
Diagram window. Note that this palette can be displayed only in a Block Diagram window.

Fig 5: Function Platte

Controls Palette:
The Controls palette, shown in Figure 6, provides controls and indicators of an Front Panel
window. This palette can be displayed by right-clicking on an open area of an Front Panel.
Note that this palette can be displayed only in an Front Panel window.

Fig 6: Control Palette


a) Addition of signals
Adder is used to compute the addition of two signals x and y. It adds the amplitude at
every instant of both signals and resultant signal (x+y) has resultant amplitude.

Fig 1: Adder Fig 2: Path to adder


Fig 3: simulate signal Fig 4: Path to simulate signal
Procedure:
 Use express signal block in BD panel to simulate the two signals. It is located in
Express>>signal analysis>>express signal
 Double click on the express signal block to set the attributes, shown in fig 5.
 Select sine wave from one block and saw tooth wave from the other
 Fed the output of both signals to adder circuit.
 Connect waveform graph on each signal and at the output of adder.
 Front panel will show the graphs of both signals and the resultant graph which is
output of adder. It is shown in figure 8
 Verify the result by observing the output graph
 Repeat the experiment by changing the waveforms and their attributes
Fig 5: simulate signal properties

Fig 6: waveform graph Fig 7: Path to waveform graph


Fig 8: Adding of signals
b) Subtraction of signals:
Subtract is used to compute the difference between two inputs x and y. It subtracts the
amplitude at every instant of both signals and gives resultant signal (x-y) on the output.

Fig 9: subtract Fig 10: Path to subtract


Procedure:
 Repeat the experiment by replacing the adder with subtract
 Verify the result by observing the output graph of the subtract

Fig 11: Subtracting of signals


Merging of signals:

Fig 12: Merger Fig 13: Path to merger


Procedure:
 Repeat the experiment by replacing the adder with merger
 Verify the result by observing the output graph of the merger
Fig 14: Merging of signals

Lab Task
Choose different signals and perform AND, OR and NOT operations.

Lab Assignment
Make a neat Lab report

Conclusion
Discrete time signals and their operations in labview have been verified.

LAB 3: Study signal generation and amplification using lab view images.

Objective
The objective of this lab is to get familiar with the LABVIEW
Software required:-
o Computer work station
o Matlab 2015 or above

Theory
The use of Express VIs allows less wiring on a BD. Also, it provides an interactive user
interface by which parameter values can be adjusted on the fly. The BD of the signal
generation system using Express VIs is shown in Figure1.
To build this BD, locate the Simulate Signal Express VI (Functions » Express » Input »
Simulate Signal) to generate a signal source. This brings up a configuration window, as
shown in Figure 2. Different types of signals including sine, square, triangle, saw tooth, or
DC can be generated with this VI. Enter and adjust the parameters as indicated in Figure 2 to
simulate a sine wave having a frequency of 200 Hz and an amplitude swinging between –100
and 100. Set the sampling frequency to 8000 Hz. A total of 128 samples spanning time
duration of 15.875 milliseconds (ms) is generated. Note that when the parameters are
changed, the modified signal gets displayed instantly in the Result Preview graph window.
Next, place a Scaling and Mapping Express VI (Functions » Express » Arithmetic &
Comparison » Scaling and Mapping) to amplify or scale this simulated input signal. When
its configuration dialog box is brought up, as shown in Figure L3, choose Linear (Y=mx+b)
and enter 5 in Slope (m) to scale the signal 5 times. Wire the Sine terminal of the Simulate
Signal Express VI to the Signals terminal of the Scaling and Mapping Express VI. Note that a
wire having a dynamic data type gets created. To display the output signal, place a waveform
graph (Controls » Modern » Graph » Waveform Graph) on the FP. The waveform graph
can also be created by right clicking on the Scaled Signals terminal and choosing Create »
Graph Indicator from the shortcut menu.
Now, in order to observe the original and the scaled signal together in the same graph, wire
the Sine terminal of the Simulate Signal Express VI to the waveform graph. This inserts a
Merge Signals function on the wire automatically. An automatic insertion of the Merge
Signals function occurs when a signal having a dynamic data type is wired to other signals
having the same or other data types. The Merge Signals function combines multiple inputs,
thus allowing two signals, consisting of the original and scaled signals, to be handled by one
wire. Since both the original and scaled signals are displayed in the same graph, resize the
plot legend to display the two labels and markers. The use of the dynamic data type sets the
signal labels automatically.

To run the VI continuously, place a While Loop. Position the While Loop to enclose all the
Express VIs and the graph. Now the VI is ready to be run.
Fig 1: BD of signal generation and amplification system using Express VIs

Fig 2: Configuration of Simulate Signal Express VI.


Fig 3: Configuration of Scaling and Mapping Express VI.
Run the VI and observe the waveform graph. The output should appear as shown in Figure4.
To extend the plot to the right-end of the plotting area, right-click on the waveform graph,
choose X Scale, and then uncheck Loose Fit from the shortcut menu. The graph shown in
Figure5 should appear. If the plot runs too fast, a delay can be placed in the While Loop. To
do this, place a Time Delay Express VI (Functions » Programming » Timing » Time
Delay) and set the delay time to 0.2 in the configuration window. This way, the loop
execution is delayed by 0.2 second in the BD appearing in Figure1.

Fig 4: FP of signal generation and amplification system


Fig 5: Plot with Loose Fit.
Although this system runs successfully, no control of the signal frequency and gain is
available during its execution, since all the parameters are set in the configuration dialogs
of the Express VIs. To gain such a flexibility, one needs to make some modifications to
change the frequency at run time, place a Vertical Pointer Slide control (Controls »
Modern » Numeric » Vertical Pointer Slide) on the FP and wire it to the Frequency
terminal of the Simulate Signal Express VI. The control is labeled as Frequency. The
Express VI can be resized to show more terminals at the bottom of the expandable node.
Resize the VI to show an additional terminal below the Sine terminal. Then, click on this
new terminal, error out by default, to select Frequency from the list of the displayed
terminals.
Next, replace the Scaling and Mapping Express VI with a multiply function (Functions »
Programming » Numeric » Multiply). Place another Vertical Pointer Slide control and
wire it to the y terminal of the multiply function to adjust the gain. This control is labeled
as Gain. These modifications are illustrated in Figure 6.
Fig 6: BD of signal generation and amplification system with controls

Now on the FP, set the maximum range of each slide control to 1000 for the Frequency
control and 5 for the Gain control, respectively. Also, set the default values for these
controls to 200 and 2, respectively. By running this modified VI, one can observe that the
two signals get displayed with the same label, since the source of these signals, i.e., the
Sine terminal of the Simulate Signal Express VI, is the same. Also, due to the auto scale
feature of the waveform graph, the scaled signal appears unchanged, whereas the Y axis
of the waveform graph changes appropriately. This is illustrated in Figure7.

Fig 7: Auto scaled graph of two signals shown together


Let us now modify the property of the waveform graph. In order to disable the auto scale
feature, right-click on the waveform graph and uncheck Y Axis » Auto Scale Y. The
maximum and minimum scale can also be adjusted. In this example –600 and 600 are
used as the minimum and maximum values, respectively. This is done by modifying the
maximum and minimum scale values of the Y axis with the Labeling tool. If the
automatic tool selection mode is enabled, just click on the maximum or minimum scale of
the Y axis to enter any desired scale value. To modify the labels displayed in the plot
legend, right-click and choose Ignore Attributes. Then, edit the labels to read Original and
Scaled using the Labeling tool. The properties of the waveform graph can also be
changed by using its properties dialog box. This box is brought up by right-clicking on
the waveform graph and choosing Properties from the shortcut menu.
The completed FP is shown in Figure 8. With this version of the VI, the frequency of the
input signal and the gain of the output signal can be controlled using the controls on the
FP.

Fig 8: FP of signal generation and amplification system with controls.

LabTask
Choose different signals and perform amplification.

Lab Assignment
Make a neat lab report.

Conclusion
Signal generation and amplification have been studied.

You might also like