Output of Sine and chirp block seems wrong
조회 수: 4 (최근 30일)
이전 댓글 표시
I'm completly new to simulink and testing some stuff and have a problem producing proper plots with the chirp and sine wave blocks. if i just connect a sine block to a scope block i do get smth that's pretty sinelike but it's not a sine, because it's coninuously decreasing its values and its amplitude is not 1, as you can see on the first picture. on the second picture you can see, what the chirp block produces to me. as far as i understood the block, it's supposed to produce a sine wave which has an increasing frequency. But to me this output doesn't even look a little like that. what am i doing wrong?
댓글 수: 0
답변 (2개)
Adam Barber
2015년 8월 10일
Hey Max,
This is due to the step sizes of the solver that Simulink is choosing. By default Simulink sets the step size to: h_max = (t_stop - t_start)/50. It uses a variable-step solver which will adjust this step based on the system. For the two you provided, it does not refine it to the point where it looks like you might expect.
If you set your simulation time to 10 seconds, Simulink will choose a default step size of 0.2 seconds, which is good enough to capture the 2*pi second period of the default sine wave. When you make the simulation time longer, like 200 seconds for example, it chooses a default step size of 4 seconds, leading to the strange aliasing behavior you see.
You can find more information in the documentation for the solver pane, and in particular under "Tips" you can see the statement "If the time span of the simulation is very long, the default step size might be too large for the solver to find the solution."
What this means is there are two solutions: either reduce your simulation time, or specify the solver time step to be something small.
Hope this helps get you started,
-Adam
bharadwaj r
2015년 8월 17일
Hey max,
I think its the problem with the scope you are using to see the output. Go to scope setting and in sampling change from decimation to sample time and give the sample time as 10e-6.
Hope this works
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Model Editing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!