Using Simulink's Averaging Spectrum Analyzer

7 views (last 30 days)
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
Kaustubha Govind on 25 Apr 2012
Which Blockset Library does this block belong to? I can't find anything from a documentation search.
Michal Tomaszek
Michal Tomaszek on 26 Apr 2012
Hi there, thank you for response.
You can find it in Simulink Extras->Additional Sinks or simply enter Averaging Spectrum Analyzer in search window and you'll get it.
I found it hard to get any info while searching the internet, so any help would be appreciated.

Sign in to comment.

Answers (1)

Andreas Goser
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.
  1 Comment
Michal Tomaszek
Michal Tomaszek on 26 Apr 2012
Thank you, I'll try to make that information useful.
Currently I'm trying to learn how to bring into play this block by using it in simple sysem. I know so far, basing on different approaches, that (which is pretty obviously, but I give you all I got) length of buffer and sample time are connected with simulation time by equation:
buffer length=(simulation time)/(sample time)
This let me to get all time response of a signal. Sample time has to be chosen properly. It depends on input signals frequency - the higher frequency is the smaller sample time has to be.
I'm looking for further answers. Hope we'll be able to solve this together.

Sign in to comment.

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!