# 2.1 Lab 2: labview mathscript and hybrid programming  (Page 5/6)

 Page 5 / 6

Finally, add numeric indicators in a similar fashion as indicated earlier. [link] shows the completed block diagram and front panel.

## Building a signal generation system using hybrid programming

In this section, let us see how to generate and display aperiodic continuous-time signals or pulses in the time domain. One can represent such signals with a function of time. For simulation purposes, a representation of time $t$ is needed. Note that the time scale is continuous while computer programs operate in a discrete fashion. This simulation can be achieved by considering a very small time interval. For example, if a 1-second duration signal in millisecond increments (time interval of 0.001 second) is considered, then one sample every 1 millisecond and a total of 1000 samples are generated for the entire signal. This continuous-time signal approximation is discussed further in later chapters. It is important to note that there is a finite number of samples for a continuous-time signal, and, to differentiate this signal from a discrete-time signal, one must assign a much higher number of samples per second (very small time interval).

[link] shows two continuous-time signals $\mathrm{x1}\left(t\right)$ and $\mathrm{x2}\left(t\right)$ with a duration of 3 seconds. By setting the time interval dt to 0.001 second, there is a total of 3000 samples at $t=0,0\text{.}\text{001},0\text{.}\text{002},0\text{.}\text{003},\text{.}\text{.}\text{.}\text{.}\text{.}\text{.}\text{.},2\text{.}\text{999}$ seconds.

The signal $\mathrm{x1}\left(t\right)$ can be represented mathematically as follows:

$\mathrm{x1}\left(t\right)=\left\{\begin{array}{cc}0& 0\le t<1\\ 1& 1\le t<2\\ 0& 2\le t<3\end{array}$

To simulate this signal, use the LabVIEW MathScript functions ones and zeros . The signal value is zero during the first second, which means the first 1000 samples are zero. This portion of the signal is simulated with the function zeros(1,1000) . In the next second (next 1000 samples), the signal value is 2, and this portion is simulated by the function 2*ones(1,1000) . Finally, the third portion of the signal is simulated by the function zeros(1,1000) . In other words, the entire duration of the signal is simulated by the following .m file function:

x1=[ zeros(1,1/dt) 2*ones(1,1/dt) zeros(1,1/dt)]

The signal $\mathrm{x2}\left(t\right)$ can be represented mathematically as follows:

$\mathrm{x2}\left(t\right)=\left\{\begin{array}{cc}2t& 0\le t<1\\ -2t+4& 1\le t<2\\ 0& 2\le t<3\end{array}$

Use a linearly increasing or decreasing vector to represent the linear portions. The time vectors for the three portions or segments of the signal are 0:dt:1-dt , 1:dt:2-dt and 2:dt:3-dt . The first segment is a linear function corresponding to a time vector with a slope of 2; the second segment is a linear function corresponding to a time vector with a slope of -2 and an offset of 4; and the third segment is simply a constant vector of zeros. In other words, simulate the entire duration of the signal for any value of dt by the following .m file function:

x2=[2*(0:dt:(1-dt)) -2*(1:dt:(2-dt))+4 zeros(1,1/dt)].

[link] and [link] show the block diagram and front panel of the above signal generation system, respectively. Display the signals using a Waveform Graph (Controls Express Waveform Graph) and a Build Waveform function (Function Programming Waveform Build Waveform) . Note that the default data type in MathScript is double precision scalar. So whenever an output possesses any other data type, one needs to right-click on the output and select the Choose Data Type option. In this example, x1 and x2 are double precision one-dimensional arrays that are specified accordingly.

what are the products of Nano chemistry?
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
Preparation and Applications of Nanomaterial for Drug Delivery
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
research.net
kanaga
sciencedirect big data base
Ernesto
Got questions? Join the online conversation and get instant answers! By Carly Allen By OpenStax By Richley Crapo By OpenStax By Marion Cabalfin By Stephanie Redfern By By Rhodes By Edgar Delgado By David Corey