A mathematical function that is used in signal processing is the sinc function, defined by
We can plot this function plot sin(x)/x.
I've written a MATLAB script relation_ex.m showing how you can work with this function over an interval that includes x=0.
I've placed this routine in the directory that your class accounts are set up to be able to read automatically, so you should be able to type, at the MATLAB prompt,
Which of these routines is most efficient?
How do you define efficient?
What are the costs of a program?
From a MATLAB window you can run the script
Hopefully, you saw that there are problems for y(x) = sin(x)/x when x=0, but L'Hospital's rule (from calculus) tells us in this case that
sin(0) cos(0) ------ = ------ 0 1In case you don't remember from calculus, L'Hospital's rule says that for the quotient of two functions
f(x) f(0) ---- for x=0 gives the "indetermindant" ---- = 0/0 g(x) g(0)in which case
f(x) f'(x) cos(x) ---- = ----- = ----- = cos(x) at the point x=0 g(x) g'(x) 1for f(x) = sin(x) and g(x) = x