What expression can I use in matlab to remove the negative component of a sine wave so it can look like the picture below?What is the implication of supplying power the other way on this circuit?Amplitude modulator for a sine wave generatorSawtooth/ramp waves with fixed amplitude from sine or square clock source?Why implement microcontroller in FPGA?How does one approach designing an amplifier using BJTs to drive an 8 ohm speaker?Need help designing headphone amplifier circuitHow to shift level of my AC signal compared to another AC signal?Piezo speaker driver not giving full differential voltage - why?What physical factor affects the antenna's bandwidth?An integrator design

Why was Germany not as successful as other Europeans in establishing overseas colonies?

French for 'It must be my imagination'?

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

Combinable filters

Examples of subgroups where it's nontrivial to show closure under multiplication?

If a warlock with the Repelling Blast invocation casts Eldritch Blast and hits, must the targets always be pushed back?

A Strange Latex Symbol

What does KSP mean?

How exactly does Hawking radiation decrease the mass of black holes?

Who is the Umpire in this picture?

Does this extra sentence in the description of the warlock's Eyes of the Rune Keeper eldritch invocation appear in any official reference?

Using a Lyapunov function to classify stability and sketching a phase portrait

Error message with tabularx

Contradiction proof for inequality of P and NP?

Does Gita support doctrine of eternal samsara?

Do I have an "anti-research" personality?

Shrinkwrap tetris shapes without scaling or diagonal shapes

Does the sign matter for proportionality?

What are the potential pitfalls when using metals as a currency?

How to solve constants out of the internal energy equation?

Noun clause (singular all the time?)

How can I place the product on a social media post better?

Why do Computer Science majors learn Calculus?

Is there a way to get a compiler for the original B programming language?



What expression can I use in matlab to remove the negative component of a sine wave so it can look like the picture below?


What is the implication of supplying power the other way on this circuit?Amplitude modulator for a sine wave generatorSawtooth/ramp waves with fixed amplitude from sine or square clock source?Why implement microcontroller in FPGA?How does one approach designing an amplifier using BJTs to drive an 8 ohm speaker?Need help designing headphone amplifier circuitHow to shift level of my AC signal compared to another AC signal?Piezo speaker driver not giving full differential voltage - why?What physical factor affects the antenna's bandwidth?An integrator design






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1












$begingroup$


The image shows a sine wave is obtained using MATLAB. I would like to know what they possibly multiplied or what expression could one use in MATLABto get this wave instead of a complete sine wave.enter image description here










share|improve this question







New contributor




Signal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$











  • $begingroup$
    Request @Signal to mark an answer as accepted if they are satisfied with their application, to help any future readers
    $endgroup$
    – Shreyas
    Apr 24 at 10:45






  • 1




    $begingroup$
    @Shreyas It's customary to wait at least 24 hours after the question has been asked before accepting an answer.
    $endgroup$
    – pipe
    Apr 24 at 12:15

















1












$begingroup$


The image shows a sine wave is obtained using MATLAB. I would like to know what they possibly multiplied or what expression could one use in MATLABto get this wave instead of a complete sine wave.enter image description here










share|improve this question







New contributor




Signal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$











  • $begingroup$
    Request @Signal to mark an answer as accepted if they are satisfied with their application, to help any future readers
    $endgroup$
    – Shreyas
    Apr 24 at 10:45






  • 1




    $begingroup$
    @Shreyas It's customary to wait at least 24 hours after the question has been asked before accepting an answer.
    $endgroup$
    – pipe
    Apr 24 at 12:15













1












1








1





$begingroup$


The image shows a sine wave is obtained using MATLAB. I would like to know what they possibly multiplied or what expression could one use in MATLABto get this wave instead of a complete sine wave.enter image description here










share|improve this question







New contributor




Signal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




The image shows a sine wave is obtained using MATLAB. I would like to know what they possibly multiplied or what expression could one use in MATLABto get this wave instead of a complete sine wave.enter image description here







design






share|improve this question







New contributor




Signal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Signal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Signal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 24 at 9:26









SignalSignal

22




22




New contributor




Signal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Signal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Signal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • $begingroup$
    Request @Signal to mark an answer as accepted if they are satisfied with their application, to help any future readers
    $endgroup$
    – Shreyas
    Apr 24 at 10:45






  • 1




    $begingroup$
    @Shreyas It's customary to wait at least 24 hours after the question has been asked before accepting an answer.
    $endgroup$
    – pipe
    Apr 24 at 12:15
















  • $begingroup$
    Request @Signal to mark an answer as accepted if they are satisfied with their application, to help any future readers
    $endgroup$
    – Shreyas
    Apr 24 at 10:45






  • 1




    $begingroup$
    @Shreyas It's customary to wait at least 24 hours after the question has been asked before accepting an answer.
    $endgroup$
    – pipe
    Apr 24 at 12:15















$begingroup$
Request @Signal to mark an answer as accepted if they are satisfied with their application, to help any future readers
$endgroup$
– Shreyas
Apr 24 at 10:45




$begingroup$
Request @Signal to mark an answer as accepted if they are satisfied with their application, to help any future readers
$endgroup$
– Shreyas
Apr 24 at 10:45




1




1




$begingroup$
@Shreyas It's customary to wait at least 24 hours after the question has been asked before accepting an answer.
$endgroup$
– pipe
Apr 24 at 12:15




$begingroup$
@Shreyas It's customary to wait at least 24 hours after the question has been asked before accepting an answer.
$endgroup$
– pipe
Apr 24 at 12:15










2 Answers
2






active

oldest

votes


















5












$begingroup$

I don't know MatLab but I suspect that (y + |y|)/2 (where |y| is the absolute value of the function) would do the trick.



When the function is positive the two halves add to give a regular sine. When the function is negative the function and absolute value cancel out.






share|improve this answer









$endgroup$




















    2












    $begingroup$

    The matlab way, using logical indexing:



    t = -4*pi:.01:4*pi;
    a = sin(t);
    a(a <= 0) = 0;
    plot(a)





    share|improve this answer









    $endgroup$













      Your Answer






      StackExchange.ifUsing("editor", function ()
      return StackExchange.using("schematics", function ()
      StackExchange.schematics.init();
      );
      , "cicuitlab");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "135"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );






      Signal is a new contributor. Be nice, and check out our Code of Conduct.









      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f435177%2fwhat-expression-can-i-use-in-matlab-to-remove-the-negative-component-of-a-sine-w%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      5












      $begingroup$

      I don't know MatLab but I suspect that (y + |y|)/2 (where |y| is the absolute value of the function) would do the trick.



      When the function is positive the two halves add to give a regular sine. When the function is negative the function and absolute value cancel out.






      share|improve this answer









      $endgroup$

















        5












        $begingroup$

        I don't know MatLab but I suspect that (y + |y|)/2 (where |y| is the absolute value of the function) would do the trick.



        When the function is positive the two halves add to give a regular sine. When the function is negative the function and absolute value cancel out.






        share|improve this answer









        $endgroup$















          5












          5








          5





          $begingroup$

          I don't know MatLab but I suspect that (y + |y|)/2 (where |y| is the absolute value of the function) would do the trick.



          When the function is positive the two halves add to give a regular sine. When the function is negative the function and absolute value cancel out.






          share|improve this answer









          $endgroup$



          I don't know MatLab but I suspect that (y + |y|)/2 (where |y| is the absolute value of the function) would do the trick.



          When the function is positive the two halves add to give a regular sine. When the function is negative the function and absolute value cancel out.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 24 at 9:45









          TransistorTransistor

          89.9k787193




          89.9k787193























              2












              $begingroup$

              The matlab way, using logical indexing:



              t = -4*pi:.01:4*pi;
              a = sin(t);
              a(a <= 0) = 0;
              plot(a)





              share|improve this answer









              $endgroup$

















                2












                $begingroup$

                The matlab way, using logical indexing:



                t = -4*pi:.01:4*pi;
                a = sin(t);
                a(a <= 0) = 0;
                plot(a)





                share|improve this answer









                $endgroup$















                  2












                  2








                  2





                  $begingroup$

                  The matlab way, using logical indexing:



                  t = -4*pi:.01:4*pi;
                  a = sin(t);
                  a(a <= 0) = 0;
                  plot(a)





                  share|improve this answer









                  $endgroup$



                  The matlab way, using logical indexing:



                  t = -4*pi:.01:4*pi;
                  a = sin(t);
                  a(a <= 0) = 0;
                  plot(a)






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 24 at 11:39









                  Vicente CunhaVicente Cunha

                  1,967411




                  1,967411




















                      Signal is a new contributor. Be nice, and check out our Code of Conduct.









                      draft saved

                      draft discarded


















                      Signal is a new contributor. Be nice, and check out our Code of Conduct.












                      Signal is a new contributor. Be nice, and check out our Code of Conduct.











                      Signal is a new contributor. Be nice, and check out our Code of Conduct.














                      Thanks for contributing an answer to Electrical Engineering Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f435177%2fwhat-expression-can-i-use-in-matlab-to-remove-the-negative-component-of-a-sine-w%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                      Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                      Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?