Simulink - Multiplication of Two Sine Signals (i couldn't understand the logic)
조회 수: 28 (최근 30일)
이전 댓글 표시
Hi, while I was doing some practises on Simulink to learn it better on my own, I have stuck and could not find the reason behind one of my self questions:
You can right click and download the pictures for a closer look...
Here, first I have created two sine wave and multiplied them with the "product block".
(I adjusted samples per frame for sine waves as "5" for both of them.)
After that here is the sine signal parameters:
Here is the output:
My question is,
How does the value of the signal dimension ( [5x1] ) was created?
I mean which parameter for sine wave dis affect that dimension?
and my second curiosity is,
When change the value “samples per frame” of the one of sine waves, (I adjusted one of them 1 and other one is 5) the output signal has been changed just like that below:
I could not understand that, when I change one the samples per frame as "1" and other one as "5", its period has been changed. However I could not understand the connection between "the samples per frame" how changes the signal output just like that?
Also, as you can see, I guess the width of the graph lines has been got thicker than before. That looks interesting as well. How could that thing become possible only changing the samples per frame just like that?
Finally, I added the simulink file with the .slx extension. You can have a look via running the .slx file on your own as well.
댓글 수: 0
채택된 답변
Paul
2022년 3월 20일
편집: Paul
2022년 3월 20일
Question 1: How does the value of the signal dimension ( [5x1] ) was created? I mean which parameter for sine wave dis affect that dimension?
Answer 1: If you turn on Sample Time annotations, it might become clearer. Anyway, the signal dimension is 5 because of the 5 samples per frame. The sample time of the sine wave is 1/1000 seconds/sample. So, at 5 samples/frame, each frame is 5/1000 seconds long. Within a frame, the output of that sine block will have five elements. Over the first frame, the output of the sine block is:
5*sin(2*pi*10*(0:4)/1000)
which you can see if you put a scope on the output of the sine block and zoom in tight from 0 < t < 0.01, for example. After taking the product with the other sine block (also at 5 samples per frame) the output of the product over the first frame is
5*sin(2*pi*10*(0:4)/1000).*5.*sin(2*pi*10*(0:4)/1000)
which again can be seen by zooming in tight on the scope at the output of the product. Same thing happens over the second frame, but with indices 5:9 instead of 0:4.
Question 2: When change the value “samples per frame” of the one of sine waves, (I adjusted one of them 1 and other one is 5) the output signal has been changed just like that below.
When one of the sine blocks is changed to one sample per frame, it becomes a scalar output at a sample time of 1/1000 seconds/sample. But the other sine block is still a 5x1 that is held constant over frame intervals of 5/1000. So the the output of the product is 5 x 1, at a sample time of 0.001. Over the first 0.005 seconds, the output of the product is then
Time = (0:.001:0.004).';
Product = 5*sin(2*pi*10*(0:4)/1000).*5.*sin(2*pi*10*Time);
table(Time,Product)
which again can be seen by zooming on the scope of the product over the first 0.005 seconds.
댓글 수: 4
Paul
2022년 3월 20일
That box is the "Sample Time Legend" that shows all of the unique sample times in the model and assigns to them an annotation. In this case D1 is the annotation for a sample time of 0.005. If you have sample time annotations turned on, you should see D1 on the signal lines for all signals that have a sample time of 0.005 similar to who the signal dimenstions are shown if you have those turned on, like in the diagram posted in teh Question). FiM is a built-in sample time that Simulink assigns automatically to certain signals in certain situtations. Anyway, you can turn on sample time annotations or sample time colors (each sample time will be assigned a color used to demarcate the signals in the block diagram) or both (using the "All" option). Looking at the sample times is another tool, like showing signal dimensions, that can help with understanding/illustrating/verifying how the simulation works.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Sources에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!