Output of Sine and chirp block seems wrong
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
Adam Barber
le 10 Août 2015
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
le 17 Août 2015
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 commentaires
Voir également
Catégories
En savoir plus sur Interactive Model Editing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!