LAB 6: P /E S S P: Ower Nergy of The Ignals and Ystem Roperties
LAB 6: P /E S S P: Ower Nergy of The Ignals and Ystem Roperties
LAB 6: P /E S S P: Ower Nergy of The Ignals and Ystem Roperties
PROPERTIES
CLO5: USE MODERN TOOL (E.G. MATLAB) FOR SIGNAL REPRESENTATION,
VISUALIZATION AND PROCESSING IN BOTH TIME AND FREQUENCY DOMAIN.
Function Handle
A function handle is a MATLAB data type that holds information to be used referencing a function.
When you create a function handle, MATLAB captures all the information about the function that it
needs to execute it later on. Once the handle is created, it can be used to execute the function at any
time.
Function handles are defined using the @ operator. Consider the following example:
f =
@(x)x^5-3*x
This tells MATLAB to create a function for which x is the variable (this is what the @(x) does) and
for which the rule is x^2-x. Here are some things we can do with function handles. We can plug things
in:
>> f(3)
ans =
234
ans =
5*x^4 - 3
>>diff(f(x),2)
ans =
20*x^3
ans =
20*x^3
Integration works the same way in that int(f) and int(f,1,2) will work provided x is symbolic:
>>clear all;
>>f = @(x) x^5-3*x;
>>syms x;
>>int(f(x))
ans =
(x^2*(x^4 - 9))/6
AND
>>int(f(x),1,2)
ans = 6
>>int(f,x,1,2)
ans = 6
While it is easier to implement summation, the limit part is implemented by setting N to some number
e.g. 100 or 1000 and then increasing it gradually. When N is steadily increased, if the power of the
signal approaches constant value while its energy keeps increasing, it is a power signal. On the other
hand, if the energy of signal approaches constant value and its power approaches zero, it is energy
signal. Otherwise the signal can be classified as neither power nor energy signal.
TASK 1:
Calculate power and the energy of the following signals and classify them as power signal, energy
signal or neither power nor energy signal. You have to plot the Power and Energy graph and
also find the mean Power and Energy:
𝜋 𝜋
a) 𝑐𝑜𝑠 ( 5 𝑛 − 15)
b) 0. 8|𝑛|
2𝜋
c) 𝑒 𝑗 10 𝑛
d) (−1)𝑛
𝑛
𝜋
e) 𝑒 100 𝑐𝑜𝑠 (6 𝑛)
TASK 2:
Task 3:
Consider the discrete-time system y[n] = n x[n]. Use MATLAB to verify whether the system is Time
Invariant or not.
Task 4:
Repeat Task3 for the system y[n] = (x[n+1] + x[n] + x[n-1])/3 (It is moving average filter with M=1)