Viewing Time vs Frequency in Simulink

8 vues (au cours des 30 derniers jours)
Daniel  Tay
Daniel Tay le 8 Juil 2011
Hi everyone,
I'm building a simple simulink model to view the Time vs Frequency plot of a chirp signal. May i know which is the appropriate blockset to connect from the chirp signal output?

Réponse acceptée

Paulo Silva
Paulo Silva le 8 Juil 2011
This is the code just for MATLAB
t = 0:0.001:10; % 10 seconds @ 1kHz sample rate
fo = 10; f1 = 400; % Start at 10Hz, go up to 400Hz
y = chirp(t,fo,10,f1,'logarithmic');
spectrogram(y,256,200,256,1000,'yaxis')
Now if you really want to generate the chirp and see it just with simulink, put the chirp block on your model connect it to one to workspace block, make it output one array and choose the variable c.
Now go to simulink File, Model Properties, Callbacks and choose the StopFcn, paste the next come in the box
spectrogram(c,256,200,256,1000,'yaxis')
Now every time you run your simulation you get the frequency vs time plot automatically.

Plus de réponses (1)

Daniel  Tay
Daniel Tay le 8 Juil 2011
Thanks for your help :)

Catégories

En savoir plus sur Schedule Model Components dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by