Using Simulink's Averaging Spectrum Analyzer
7 views (last 30 days)
Show older comments
Hi,
I built a model of a dynamic system in Simulink. Now I want to get its Bode diagram, using Averaging Spectrum Analyzer. The question is: how should I set values of block parameters to get proper result of a simulation?
I've tried many options, but none of them let me get a Bode diagram I achieved solving this problem analytically.
2 Comments
Kaustubha Govind
on 25 Apr 2012
Which Blockset Library does this block belong to? I can't find anything from a documentation search.
Answers (1)
Andreas Goser
on 26 Apr 2012
Maybe this is only a partial answer, but hopefully helps on the way to a full answer.
Some years ago, I learned that the blocks in "Simulink Extras" are purposely in this library and that it means they are undocumented and unsupported. I personally compare this with a situation where you download a free blockset from FileeExchange.
But what you always can do is to look under the mask of the blocks to see how they work. In this case, the block is actually an S-Function written in MATLAB Code:
edit msfuntf
And this code is documented and may answer your question:
%MSFUNTF an MATLAB S-function which performs transfer function analysis using ffts.
% This MATLAB file is designed to be used in a Simulink S-function block.
% It stores up a buffer of input and output points of the system
% then plots the frequency response of the system based on this information.
%
% The input arguments are:
% npts: number of points to use in the fft (e.g. 128)
% HowOften: how often to plot the ffts (e.g. 64)
% offset: sample time offset (usually zeros)
% ts: how often to sample points (secs)
% averaging: whether to average the transfer function or not
%
% The spectrum analyzer displays three plots: the time history,
% the phase and magnitude of the transfer function.
See Also
Categories
Find more on Audio Processing Algorithm Design 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!