Please answer all the questions
Here is evenodd function:
function [xe, xo, m] = evenodd(x,n)
% Real signal decomposition into even and odd parts
% -------------------------------------------------
% [xe, xo, m] = evenodd(x,n)
%
if any(imag(x) ~= 0)
error('x is not a real sequence')
end
m = -fliplr(n);
m1 = min([m,n]); m2 = max([m,n]); m = m1:m2;
nm = n(1)-m(1); n1 = 1:length(n);
x1 = zeros(1,length(m));
x1(n1+nm) = x; x = x1;
xe = 0.5*(x + fliplr(x));
xo = 0.5*(x - fliplr(x));
a)
If x(-n)=-x(n), then the signal is called as odd signal.--------------(1)
If x(-n)=x(n), then the signal is called as even signal.----------------(2)
Any signal can be expressed as a sum of even and odd components.
x(n)=xe(n)+xo(n) -----(3)
where xe(n) is the even component of x(n) and xo(n) is the even component of x(n).
Replace n by -n in (3)
x(-n)=xe(-n)+xo(-n) ----------------(4)
From(2), xe(-n)=xe(n)
From(1), xo(-n)=-xo(n)
Rewrite the equation(4),
x(-n)=xe(n)-xo(n) -----------------(5)
Add (5) and (3),
x(n)+x(-n)=2 xe(n)
xe(n)= [x(n)+x(-n)]/2 -------------(6)
subtract (5) from (3),
x(n)-x(-n)=2 xo(n)
xo(n)= [x(n)-x(-n)]/2 -------------(7)
Hence any signal can be decomposed into an even component and an odd component.
_______________________________________________________________________
b)
Steps:
1.Run the function file with the name 'evenodd.m'. This execution will show 'error: 'x' undefined '. Just neglect this error.
2.Run the main files one by one to get the waveforms.
function [xe, xo, m] = evenodd(x,n)
% Real signal decomposition into even and odd parts
% -------------------------------------------------
% [xe, xo, m] = evenodd(x,n)
%
if any(imag(x) ~= 0)
error('x is not a real sequence')
end
m = -fliplr(n);
m1 = min([m,n]); m2 = max([m,n]); m = m1:m2;
nm = n(1)-m(1); n1 = 1:length(n);
x1 = zeros(1,length(m));
x1(n1+nm) = x; x = x1;
xe = 0.5*(x + fliplr(x));
xo = 0.5*(x - fliplr(x));
endfunction
__________________________________________________________________
MAIN FILE :1
clc;
clear all;close all;
n1=-20:1:20
x1=cos((0.2*pi*n1)+(pi/4))
[xe1, xo1, m1] = evenodd(x1,n1)
subplot(411)
stem(n1,x1)
title('x1(n)=cos((0.2*pi*n1)+(pi/4))')
xlabel('n')
ylabel('x1(n)')
subplot(412)
stem(m1,xe1,'r')
title('Even component of x1(n)')
xlabel('n')
ylabel('xe(n)')
subplot(413)
stem(m1,xo1,'g')
xlabel('n')
ylabel('x0(n)')
title('Odd component of x1(n)')
y=xe1+xo1
subplot(414)
stem(n1,y,'b')
xlabel('n')
ylabel('x(n)')
title(' x1(n)=even +odd')
________________________________________________________________________________________
MAIN FILE :2
clc;
clear all;close all;
n2=-20:1:20
x2=(exp(-0.05*n2)).*(sin((0.1*pi*n2)+(pi/3)))
[xe2, xo2, m2] = evenodd(x2,n2)
subplot(221)
stem(n2,x2)
title('x2(n)=(exp(-0.05*n2)).*(sin((0.1*pi*n2)+(pi/3)))')
xlabel('n')
ylabel('x2(n)')
subplot(222)
stem(m2,xe2,'r')
title('Even component of x2(n)')
xlabel('n')
ylabel('xe(n)')
subplot(223)
stem(m2,xo2,'g')
xlabel('n')
ylabel('x0(n)')
title('Odd component of x2(n)')
y=xe2+xo2
subplot(224)
stem(n2,y,'b')
xlabel('n')
ylabel('x(n)')
title(' x2(n)=even +odd')
Observation:
The fourth plot of both problem show that the addition of even and odd components produces the same signal which is used for decomposition.
Please answer all the questions Here is evenodd function: function [xe, xo, m] = evenodd(x,n) % R...
Using the basic developed MATLAB signal functions, generate the following sequences and then plot the signal samples using the stem function. x_1[n] = 3 delta[n + 2] + 2 delta[n] - delta[n - 3] + 5 delta[n - 7], for -5 lessthanorequalto n lessthanorequalto 15. X_2[n] = 10u[n] - 5u[n - 5] - 10u[n - 10] + 5u[n - 15]. Generate the periodic sequence and plot the samples (using the stem function) of cap x[n] = {..., -2, -1, 0,...
solve using MatLab please. HW - 1 Use a cover page Word file attached for the homework solution. Solve all questions using Word and the Matlab output should be copied into the Word file. All questions and answers should be numbered HW1.1 Generate the following sequences using the basic MATLAB signal functions and the basic MATLAB signal operations discussed in this chapter. Plot signal samples using the stem function. 1- x(n) = n°[u(n+5] – u(n-6) + 105(n) + 20(0.5)* [u(n-4)...
Please solve all. Thank you Let Let x(n) = {2, 4, −3, 1, −5, 4, 7}. ↑ (arrow points to 1) Generate and plot the samples (use the stem function) of the following sequences. x(n) = 2 e 0.5 nx(n) + cos(0.1πn) x(n + 2), − 10 ≤ n ≤ 10 use these functions when solving please 1- function [y,n] = sigshift(x,m,n0) % implements y(n) = x(n-n0) % ------------------------- % [y,n] = sigshift(x,m,n0) % n = m+n0; y = x;...
Please all thank you Exercise 25: Let f 0,R be defined by f(x)-1/n, m, with m,nENand n is the minimal n such that m/n a) Show that L(f, P)0 for all partitions P of [0, 1] b) Let mE N. Show that the cardinality of the set A bounded by m(m1)/2. e [0, 1]: f(x) > 1/m) is c) Given m E N construct a partition P such that U(f, Pm)2/m. d) Show that f is integrable and compute Jo...
Please answer all questions, I will rate you well. Thanks :) 14. 514 points | Previous Answers SCal:ET 11.11.021. Consider the following function. /(x) = x sin(x), a = 0, n = 4, -0.9 x 0.9 (a) Approximate fby a Taylor polynomial with degree n at the number a (b) Use Taylor's Inequality to estimate the accuracy of the approximation x) * Tp(x) when x lies in the given interval. (Round M up to the nearest integer. Round your answer...