Signal addition in MATALB

preview_player
Показать описание
Code:

Check the code in comment section

Learn Complete Machine Learning & Data Science using MATLAB:

Learn Digital Signal Processing using MATLAB:

Learn Complete Image Processing & Computer Vision using MATLAB:

🙏🙏🙏🙏🙏🙏🙏🙏
YOU JUST NEED TO DO
3 THINGS to support my channel
LIKE
SHARE
&
SUBSCRIBE
TO MY YOUTUBE CHANNEL
Рекомендации по теме
Комментарии
Автор

Code:


clc
clear all
close all
n1=input('Enter the time sample range of x');
x=input('Enter the sequence');
n2=input('Enter the time sample range of y');
y=input('Enter the sequence');
u=min(min(n1), min(n2));
t=max(max(n1), max(n2));
r=u:1:t;
z1=[];
temp=1;
for i=1:length(r)
if(r(i)<min(n1) || r(i)>max(n1))
z1=[z1 0];
else
z1=[z1 x(temp)];
temp=temp+1;
end
end
z2=[];
temp=1;
for i=1:length(r)
if(r(i)<min(n2) || r(i)>max(n2))
z2=[z2 0];
else
z2=[z2 y(temp)];
temp=temp+1;
end
end
z=z1+z2;
subplot(3, 1, 1);
stem(r, z1);
subplot(3, 1, 2);
stem(r, z2);
subplot(3, 1, 3);
stem(r, z);

KnowledgeAmplifier
Автор

Thankyou very much sir. You explained it really in a very easy way. 🙏🏻. Saved me from my lecturer 🙏🏻🙏🏻🙏🏻 .

Sanjeev_
Автор

thank you sir for your efforts, very well explained!

aditiparetkar
Автор

Sir, can you please post and explain code for convolution of two discrete time signals

piyushagrawal
Автор

Is this addition of two discrete time signals or two digital signals?

haidisaid
Автор

can you let me know a bit how to do via functions ?
I tried like this but error:
function [y, r] = seqadd (n1, n2)
u=min(min(n1), min(n2));
t=max(max(n1), max(n2));
r=u:1:t;
temp=1;
y1 = [];
for i=1:length(r)
if(r(i)<min(n1) || r(i)>max(n1))
y1=[y1 0];
else
y1=[y1 x(temp)];
temp=temp+1;
end
end
y2 = [];
temp=1;
for i=1:length(r)
if(r(i)<min(n2) || r(i)>max(n2))
y2=[y2 0];
else
y2=[y2 y(temp)];
temp=temp+1;
end
y=y1+y2;
end

VarshaSingh-jdql
Автор

Thank you so much for this, you saved my life <3

corinnegarcia
Автор

Hi sir ty for the video, i've a question, how can we do it with multiplication, what changes we make?

waliddk
Автор

Can u pls provide the code for a sampling signal

subratkumarpanda
Автор

thanks .. can u pls provide code for this signal
Find convolution between x1[n] = (0.5^(n-2) u [n-2] )and
X2 [n] = u [n+2] .

jatingoyal
Автор

Can u plz explain how z1=[z1 x(temp)] are equal??

rahulmeena
Автор

can you give signal multiplication and division code

gokulmukil
Автор

It shows error x(temp) undefined x and y

rahulmeena
Автор

Hi
Can u explain how to add continous signals having different time range?

HarisKhan