Signal addition in MATALB

Поделиться
HTML-код
  • Опубликовано: 8 янв 2025

Комментарии • 35

  • @KnowledgeAmplifier1
    @KnowledgeAmplifier1  5 лет назад +5

    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)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)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);

  • @Sanjeev_3333
    @Sanjeev_3333 3 года назад

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

  • @aditiparetkar2862
    @aditiparetkar2862 3 года назад +1

    thank you sir for your efforts , very well explained!

    • @KnowledgeAmplifier1
      @KnowledgeAmplifier1  3 года назад

      Glad the explanation was helpful to you Aditi Paretkar! Happy Learning :-)

  • @piyushagrawal6448
    @piyushagrawal6448 2 года назад +1

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

    • @KnowledgeAmplifier1
      @KnowledgeAmplifier1  2 года назад +1

      Hello Piyush Agrawal, you can refer the below videos --
      Convolution in MATLAB(without conv function) | MATRIX Method | DSP
      ruclips.net/video/nzVPoc4PRgI/видео.html
      Plot the convolution result in MATLAB | CONVOLUTION using MATRIX method (Part 2)
      ruclips.net/video/nuvgtEzEM1c/видео.html
      Hope this will be helpful! Happy Learning :-)

    • @piyushagrawal6448
      @piyushagrawal6448 2 года назад +1

      @@KnowledgeAmplifier1 Thanks a lot sir for timely response

    • @KnowledgeAmplifier1
      @KnowledgeAmplifier1  2 года назад

      @@piyushagrawal6448 no problem ! Happy Learning

  • @corinnegarcia1100
    @corinnegarcia1100 4 года назад

    Thank you so much for this, you saved my life

  • @VarshaSingh-jd1ql
    @VarshaSingh-jd1ql 3 года назад

    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)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)max(n2))
    y2=[y2 0];
    else
    y2=[y2 y(temp)];
    temp=temp+1;
    end
    y=y1+y2;
    end

  • @haidisaid6689
    @haidisaid6689 4 года назад

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

  • @subratkumarpanda3957
    @subratkumarpanda3957 4 года назад

    Can u pls provide the code for a sampling signal

  • @waliddk801
    @waliddk801 3 года назад

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

    • @KnowledgeAmplifier1
      @KnowledgeAmplifier1  3 года назад

      refer this video----ruclips.net/video/26wr4XDg36o/видео.html
      hope this will be helpful.

  • @gokulmukil6617
    @gokulmukil6617 3 года назад

    can you give signal multiplication and division code

    • @KnowledgeAmplifier1
      @KnowledgeAmplifier1  3 года назад

      Hello gokul , you can refer this video :
      ruclips.net/video/26wr4XDg36o/видео.html
      Hope this will be helpful ! Happy Learning :-)

  • @jatingoyal4947
    @jatingoyal4947 4 года назад

    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] .

  • @rahulmeena3269
    @rahulmeena3269 4 года назад

    It shows error x(temp) undefined x and y

  • @rahulmeena3269
    @rahulmeena3269 4 года назад

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

    • @KnowledgeAmplifier1
      @KnowledgeAmplifier1  4 года назад +1

      It will put the x(temp) value in z1 array , working like concatenation

    • @rahulmeena3269
      @rahulmeena3269 4 года назад

      Bro here is not working
      Show invalid index

    • @rahulmeena3269
      @rahulmeena3269 4 года назад

      (Y1,r)=add(x1,n1,x2,n2) am using this one in scilab

  • @HarisKhan05
    @HarisKhan05 4 года назад

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

    • @KnowledgeAmplifier1
      @KnowledgeAmplifier1  4 года назад

      Same code you can apply for adding continuous signal of different range as in Computer Everything is discrete only , nothing can be continuous :-)

  • @koutuhal
    @koutuhal 4 года назад

    Nice

  • @subratkumarpanda3957
    @subratkumarpanda3957 4 года назад

    Gg

  • @daetramp1528
    @daetramp1528 3 года назад

    no offense just asking btw

  • @vaishnavisrivastava2269
    @vaishnavisrivastava2269 4 года назад

    Code?

    • @KnowledgeAmplifier1
      @KnowledgeAmplifier1  4 года назад

      I have given the code in the comment section . Anyway giving here too , Happy Coding :-)
      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)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)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);

  • @subratkumarpanda3957
    @subratkumarpanda3957 4 года назад

    😭😭

  • @daetramp1528
    @daetramp1528 3 года назад

    why you talking like you scolding me?