how to multiply two sinewaves of different amplitude and frequency in MATLAB/simulink
26 views (last 30 days)
Show older comments
multiplying of two different sine waves of different frequency and different amplitude
0 Comments
Accepted Answer
ES
on 5 Nov 2013
Edited: Azzi Abdelmalek
on 5 Nov 2013
t=0:0.01:10
Eqn1=a1*sin(w1*t);
Eqn2=a2*sin(w1*t);
as you might know, Eqn1 and Eqn2 are matrices.
Eqn1.*Eqn2 will multiply each element of Eqn1 matrix to corresponding Element in the Eqn2 matrix. for doing this, length of Eqn1 and Eqn2 should be same.
Eqn1*Eqn2 is the normal matrix multiplication. This will need the inner dimensions of Eqn1 and Eqn2 to be equal. that is
[m1,n1]=size(Eqn1);
[m2,n2]=size(Eqn2);
only if n1 and m2 are equal you can do Eqn1*Eqn2. similarly if n2 and m1 are equal you can do Eqn2*Eqn1.
0 Comments
More Answers (2)
Azzi Abdelmalek
on 5 Nov 2013
1 Comment
Walter Roberson
on 20 May 2017
Naga Sai, what are your inputs, and what are your required outputs? What is there about J Smith's answer that did not work for your situation ?
SHARIDYA RAHMAN
on 27 Apr 2015
i need an urgent answer:
Can i multiply one sine wave and one cos wave signal using a product block in simulink? IS the process correct? After that i need to pass it through a low pass filter to attentuate or cut off a certain part of frequency components. I have used the LOW PASS Filter block but the output is coming a sqare wave signal and is distorted. I cant understand why. Can somebody explain?
See Also
Categories
Find more on Array and Matrix Mathematics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!