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;
$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.
design
New contributor
$endgroup$
add a comment |
$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.
design
New contributor
$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
add a comment |
$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.
design
New contributor
$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.
design
design
New contributor
New contributor
New contributor
asked Apr 24 at 9:26
SignalSignal
22
22
New contributor
New contributor
$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
add a comment |
$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
add a comment |
2 Answers
2
active
oldest
votes
$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.
$endgroup$
add a comment |
$begingroup$
The matlab way, using logical indexing:
t = -4*pi:.01:4*pi;
a = sin(t);
a(a <= 0) = 0;
plot(a)
$endgroup$
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
$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.
$endgroup$
add a comment |
$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.
$endgroup$
add a comment |
$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.
$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.
answered Apr 24 at 9:45
TransistorTransistor
89.9k787193
89.9k787193
add a comment |
add a comment |
$begingroup$
The matlab way, using logical indexing:
t = -4*pi:.01:4*pi;
a = sin(t);
a(a <= 0) = 0;
plot(a)
$endgroup$
add a comment |
$begingroup$
The matlab way, using logical indexing:
t = -4*pi:.01:4*pi;
a = sin(t);
a(a <= 0) = 0;
plot(a)
$endgroup$
add a comment |
$begingroup$
The matlab way, using logical indexing:
t = -4*pi:.01:4*pi;
a = sin(t);
a(a <= 0) = 0;
plot(a)
$endgroup$
The matlab way, using logical indexing:
t = -4*pi:.01:4*pi;
a = sin(t);
a(a <= 0) = 0;
plot(a)
answered Apr 24 at 11:39
Vicente CunhaVicente Cunha
1,967411
1,967411
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
$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