Question

In: Electrical Engineering

using matlab, compute and plot y [n] = x [n]* h [n], where a. x [n]...

using matlab, compute and plot y [n] = x [n]* h [n], where
a. x [n] = h [n] = a^n (0 <=n <=40) & a = 0.5
b. x [n] = cos [n]; h [n] = u [n]; n = 0:4:360
c. x [n] = sin [n] ; h [n] = a^n; n:4:360; a = 0.9

Solutions

Expert Solution

%answer a
%Type the following code in matlab m file than run it


clc
clear all
n=0:1:40;
a=0.5;
xn=a.^n;
hn=xn;
yn=conv(xn,hn);
stem(yn)
ylabel('amplitude');
xlabel('number of samples--->');
title('Y(N)=a^n*a^n');

%answer b
%Type the following code in matlab m file than run it


clear all;
close all;
clc;
N=360;
n=0:4:N-1;
xn=ones(1,N);
subplot(2,1,1)
stem(xn);

ylabel('amplitude');
xlabel('number of samples--->');
title('discrete unit step signal x(n)=u(n)');
subplot(2,1,2)
hn=cos(n);
stem(n,hn)
ylabel('amplitude');
xlabel('number of samples--->');
title('discrete signal h(n)= cos(n)');
yn=conv(xn,hn);
figure
stem(yn)
ylabel('amplitude');
xlabel('number of samples--->');
title('convolution of signal y(n)=u(n)*cos(n)');

%answer c
%Type the following code in matlab m file than run i
t


clc
clear all
n=4:1:360;
a=0.9;
hn=a.^n;
xn=sin(n);
yn=conv(xn,hn);
stem(yn)
ylabel('amplitude');
xlabel('number of samples--->');
title('Y(N)=sin(n)*a^n');


Related Solutions

Plot the original data and the regression “line” ************USING Matlab************. "Submit plot" USING MATLAB! USING MATLAB!...
Plot the original data and the regression “line” ************USING Matlab************. "Submit plot" USING MATLAB! USING MATLAB! USING MATLAB! ONLY BY USING MATLAB!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 14.9 The concentration of E. coli bacteria in a swimming area is monitored after a storm: t (hr)                     4           8         12        16    20 24 c (CFU/100 mL) 1600     1320   1000     890 650 560 The time is measured in hours following the end of the storm and the unit CFU is a .colony forming unit.. Use this data to estimate (a)...
Using the method of recursion, compute y[n] for n = 0 to 20, when x[n]=u[n] and...
Using the method of recursion, compute y[n] for n = 0 to 20, when x[n]=u[n] and y[-1]=2: ?[? + 1] − 0.8?[?] = ?[?] Find a closed-form expression for your result.
Write script in Matlab to solve 1. Y=Ax where X is of dimension n by 1...
Write script in Matlab to solve 1. Y=Ax where X is of dimension n by 1 and A is of dimension m by n. 2. C= A*B where A is of dimension m by p and B is dimension of p by n. So write matlab script to obtain Y and C in above problems.
Compute the area under y = √x between x = a and x = b where...
Compute the area under y = √x between x = a and x = b where a and b are user specified values obtained via cin. Account for invalid user input cases of a < 0 and a > b. For each case of invalid input, immediately output to the user what the error was. Allow the user a total of three chances to enter valid input for each input request. If the user enters incorrect input three times in...
Suppose that x = -7 - 5i and y = 4 + 3i. Use MATLAB to compute
Suppose that x = -7 - 5i and y = 4 + 3i. Use MATLAB to compute a. x + y b. xy c. x/y    
Suppose that X, Y and Z are normally distributed where X ≈ N(100,100), Y ≈ N(400,...
Suppose that X, Y and Z are normally distributed where X ≈ N(100,100), Y ≈ N(400, 400) and Z ≈ N(64,64). Let W = X + Y + Z. a) Describe the distribution of W, give a name and parameters E(W) and Var(W). b) Use Excel or R to generate 200 random values for X, Y and Z. Add these to obtain 200 values for W. Create a histogram for W. In Excel use the NORMINV(rand(),mean, sd) function. c) Estimate...
Using matlab Find x and y that solve the following system: ln(x 2 + y) =...
Using matlab Find x and y that solve the following system: ln(x 2 + y) = 1 − y , xy = − √ x
Make a code in matlab to know the determinant of a matrix n x n, using...
Make a code in matlab to know the determinant of a matrix n x n, using the sarrus rule.
Solve the initial value problem dy/dx + H(x)y = e5x ; y(0) = 2 where H(x)...
Solve the initial value problem dy/dx + H(x)y = e5x ; y(0) = 2 where H(x) = −1 0 ≤ x ≤ 3 1 3 < x
Plot using RStudio Consider a binomial random variable, X. i. Plot the pmf of X ∼Bin(n...
Plot using RStudio Consider a binomial random variable, X. i. Plot the pmf of X ∼Bin(n = 10, p = 0.3). ii. Plot the pmf of X ∼Bin(n = 10, p = 0.7). iii. Plot the pmf of X ∼Bin(n = 100, p = 0.3). iv. What happens to the shape of the pmf of X ∼Bin(n, p) when p gets larger? v. What happens when n gets larger
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT