Page 90 -
P. 90
y=sqrt(3)*(x-ltria);
elseif (ltria+htria)/2=<x & x<htria
y=sqrt(3)*(-x+htria);
else
y=0
end
F. Periodic functions
It is often necessary to represent a periodic signal train where the elementary
representation on one cycle can easily be written. The technique is to use the
modulo arithmetic to map the whole of the x-axis over a finite domain. This
is, of course, possible because the function is periodic. For example, consider
the rectified sine function train. Its function M-file is
function y=psinef(x)
s=rem(x,2*pi)
if s>0 & s=<pi
y=sin(s);
elseif s>pi & s=<2*pi
y=0;
else
y=0
end
In-Class Exercises
Pb. 3.30 In the above definition of all the special shape functions, we used
the if-else-end form. Write each of the function M-files to define these same
functions using only Boolean expressions.
Pb. 3.31 An adder is a device that adds the input signals to give an output
signal equal to the sum of the inputs. Using the functions previously obtained
in this section, write the function M-file for the signal in Figure 3.4.
Pb. 3.32 A multiplier is a device that multiplies two inputs. Find the prod-
uct of the inputs given in Figures 3.5 and 3.6.
Homework Problems
The first three problems in this set are a brief introduction to the different ana-
log modulation schemes of communication theory.
© 2001 by CRC Press LLC