Magnitude-only Bode plot of frequency response (2024)

Magnitude-only Bode plot of frequency response

collapse all in page

Syntax

bodemag(sys)

bodemag(sys1,sys2,...,sysN)

bodemag(sys1,LineSpec1,...,sysN,LineSpecN)

bodemag(___,w)

Description

bodemag enables you to generate magnitude-only plots to visualize the magnitude frequency response of a dynamic system.

For a more comprehensive function, see bode. bode provides magnitude and phase information. If you have System Identification™ toolbox, bode also returns the computed values, including statistical estimates.

For more customizable plotting options, see bodeplot.

example

bodemag(sys) creates a Bode magnitude plot of the frequency response of the dynamic system model sys. The plot displays the magnitude (in dB) of the system response as a function of frequency. bodemag automatically determines frequencies to plot based on system dynamics.

If sys is a multi-input, multi-output (MIMO) model, then bodemag produces an array of Bode magnitude plots in which each plot shows the frequency response of one I/O pair.

example

bodemag(sys1,sys2,...,sysN) plots the frequency response of multiple dynamic systems on the same plot. All systems must have the same number of inputs and outputs.

example

bodemag(sys1,LineSpec1,...,sysN,LineSpecN) specifies a color, line style, and marker for each system in the plot.

example

bodemag(___,w) plots system responses for frequencies specified by w.

  • If w is a cell array of the form {wmin,wmax}, then bodemag plots the response at frequencies ranging between wmin and wmax.

  • If w is a vector of frequencies, then bodemag plots the response at each specified frequency.

You can use this syntax with any of the input-argument combinations in previous syntaxes.

Examples

collapse all

Bode Magnitude Plot of Dynamic System

Create a Bode magnitude plot of the following continuous-time SISO dynamic system.

H(s)=s2+0.1s+7.5s4+0.12s3+9s2

H = tf([1 0.1 7.5],[1 0.12 9 0 0]);bodemag(H)

Magnitude-only Bode plot of frequency response (1)

bodemag automatically selects the plot range based on the system dynamics.

Bode Magnitude Plot at Specified Frequencies

This example uses:

  • Control System ToolboxControl System Toolbox

Open Live Script

Create a Bode magnitude plot over a specified frequency range. Use this approach when you want to focus on the dynamics in a particular range of frequencies.

H = tf([-0.1,-2.4,-181,-1950],[1,3.3,990,2600]);bodemag(H,{1,100})grid on

Magnitude-only Bode plot of frequency response (2)

The cell array {1,100} specifies the minimum and maximum frequency values in the Bode magnitude plot. When you provide frequency bounds in this way, the function selects intermediate points for frequency response data.

Alternatively, specify a vector of frequency points to use for evaluating and plotting the frequency response.

w = [1 5 10 15 20 23 31 40 44 50 85 100];bodemag(H,w,'.-')grid on

Magnitude-only Bode plot of frequency response (3)

bodemag plots the frequency response at the specified frequencies only.

Compare Bode Magnitude Plots of Several Dynamic Systems

This example uses:

  • Control System ToolboxControl System Toolbox

Open Live Script

Compare the magnitude of the frequency response of a continuous-time system to an equivalent discretized system on the same Bode plot.

Create continuous-time and discrete-time dynamic systems.

H = tf([1 0.1 7.5],[1 0.12 9 0 0]);Hd = c2d(H,0.5,'zoh');

Create a Bode magnitude plot that displays the responses of both systems.

bodemag(H,Hd)

Magnitude-only Bode plot of frequency response (4)

The Bode magnitude plot of a discrete-time system includes a vertical line marking the Nyquist frequency of the system.

Bode Magnitude Plot with Specified Line and Marker Attributes

This example uses:

  • Control System ToolboxControl System Toolbox

Open Live Script

Specify the color, linestyle, or marker for each system in a Bode magnitude plot using the LineSpec input arguments.

H = tf([1 0.1 7.5],[1 0.12 9 0 0]);Hd = c2d(H,0.5,'zoh');bodemag(H,'r',Hd,'b--')

Magnitude-only Bode plot of frequency response (5)

The first LineSpec argument 'r' specifies a solid red line for the response of H. The second LineSpec argument 'b--' specifies a dashed blue line for the response of Hd.

Magnitude of MIMO System

This example uses:

  • Control System ToolboxControl System Toolbox

Open Live Script

For this example, create a 2-output, 3-input system.

rng(0,'twister'); % For reproducibilityH = rss(4,2,3);

For this system, bodemag plots the magnitude-only frequency responses of each I/O channel in a separate plot in a single figure.

bodemag(H)

Magnitude-only Bode plot of frequency response (6)

Input Arguments

collapse all

sysDynamic system
dynamic system model | model array

Dynamic system, specified as a SISO or MIMO dynamic system model or array of dynamic system models. Dynamic systems that you can use include:

  • Continuous-time or discrete-time numeric LTI models, such as tf (Control System Toolbox), zpk (Control System Toolbox), or ss (Control System Toolbox) models.

  • Generalized or uncertain LTI models such as genss (Control System Toolbox) or uss (Robust Control Toolbox) models. (Using uncertain models requires Robust Control Toolbox™ software.)

    • For tunable control design blocks, the function evaluates the model at its current value for both plotting and returning frequency response data.

    • For uncertain control design blocks, the function plots the nominal value and random samples of the model. When you use output arguments, the function returns frequency response data for the nominal model only.

  • Frequency-response data models such as frd models. For such models, the function plots the response at frequencies defined in the model.

  • Identified LTI models, such as idtf, idss, or idproc models.

If sys is an array of models, the function plots the frequency responses of all models in the array on the same axes.

wFrequencies
{wmin,wmax} | vector

Frequencies at which to compute and plot frequency response, specified as the cell array {wmin,wmax} or as a vector of frequency values.

  • If w is a cell array of the form {wmin,wmax}, then the function computes the index at frequencies ranging between wmin and wmax.

  • If w is a vector of frequencies, then the function computes the index at each specified frequency. For example, use logspace to generate a row vector with logarithmically spaced frequency values.

Specify frequencies in units of rad/TimeUnit, where TimeUnit is the TimeUnit property of the model.

Algorithms

bodemag computes the frequency response as follows:

  1. Compute the zero-pole-gain (zpk (Control System Toolbox)) representation of the dynamic system.

  2. Evaluate the gain and phase of the frequency response based on the zero, pole, and gain data for each input/output channel of the system.

    • For continuous-time systems, bodemag evaluates the frequency response on the imaginary axis s = and considers only positive frequencies.

    • For discrete-time systems, bodemag evaluates the frequency response on the unit circle. To facilitate interpretation, the command parameterizes the upper half of the unit circle as:

      z=ejωTs,0ωωN=πTs,

      where Ts is the sample time and ωN is the Nyquist frequency. The equivalent continuous-time frequency ω is then used as the x-axis variable. Because H(ejωTs) is periodic with period 2ωN, bodemag plots the response only up to the Nyquist frequency ωN. If sys is a discrete-time model with unspecified sample time, bodemag uses Ts = 1.

Version History

Introduced in R2012a

See Also

bode | bodeplot | freqresp | nyquist | spectrum | step

Topics

  • Plot Bode and Nyquist Plots at the Command Line
  • Dynamic System Models

MATLAB Command

You clicked a link that corresponds to this MATLAB command:

 

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Magnitude-only Bode plot of frequency response (7)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
  • 日本 (日本語)
  • 한국 (한국어)

Contact your local office

Magnitude-only Bode plot of frequency response (2024)

FAQs

How do you find the magnitude of a Bode plot? ›

Bode analysis consists of plotting two graphs: the magnitude of Φ0(s) with s = jω, and the phase angle of Φ0(s) with s = jω, both plotted as a function of the frequency ω. Log scales are usually used for the frequency axis and for the magnitude of Φ0(jω). d B = 2 0 log 1 0 | Φ 0 ( j ω ) | .

How do you plot magnitude frequency response? ›

It is customary to plot the magnitude of the frequency response function on the log scale as |G(jω)|dB=20log10|G(jω)|.

What is the frequency response of a Bode plot? ›

Bode plots show the frequency response, that is, the changes in magnitude and phase as a function of frequency. This is done on two semi-log scale plots. The top plot is typically magnitude or “gain” in dB. The bottom plot is phase, most commonly in degrees.

What is Bode in Matlab? ›

Bode diagram design is an interactive graphical method of modifying a compensator to achieve a specific open-loop response (loop shaping). To interactively shape the open-loop response using Control System Designer, use the Bode Editor.

Is there a formula for magnitude? ›

the formula to determine the magnitude of a vector (in two-dimensional space) v = (x, y) is: |v| =√(x2 + y2). This formula is derived from the Pythagorean theorem. the formula to determine the magnitude of a vector (in three-dimensional space) V = (x, y, z) is: |V| = √(x2 + y2 + z2)

How to find magnitude response? ›

A geometric way to obtain approximate magnitude and phase frequency responses is using the effects of zeros and poles on the frequency response of an LTI system. G ( s ) | s = j Ω 0 = K j Ω 0 − z j Ω 0 − p = K Z → ( Ω 0 ) P → ( Ω 0 ) .

What is frequency response magnitude? ›

The frequency response is characterized by the magnitude, typically in decibels (dB) or as a generic amplitude of the dependent variable, and the phase, in radians or degrees, measured against frequency, in radian/s, Hertz (Hz) or as a fraction of the sampling frequency.

What is the magnitude of the frequency? ›

The magnitude describes the strength of each frequency in the signal. The phase describes the sine/cosine phase of each frequency. The phase can also be thought of as the relative proportion of sines and cosines in the signal (i.e., a phase of zero contains only cosines and a phase of 90 degrees contains only sines).

What is the formula for the Bode plot? ›

The standard transfer function of a Bode magnitude plot is: T F = K ( 1 + s ω 1 ) ( 1 + s ω 2 ) … s n ( 1 + s ω 3 ) ( 1 + s ω 4 ) … Here, ω1, ω2, ω3, ω4, … are the corner frequencies. n is the number poles at the origin.

What is a good frequency response graph? ›

The frequency response curve (so-called because a speaker's or headphone's frequency response will curve, or roll off, in the low bass and high treble) is pretty flat (“flat” is good, because it means the device is accurate), with no serious peaks, dips or other up-and-down variations.

How much phase margin is enough? ›

The phase margin is defined as the negative change in open-loop phase shift required to make a closed-loop system unstable. In general, a well-designed feedback loop has a phase margin of at least 45° and a G.M. > 3 or so.

What is the magnitude of the Bode plot? ›

In electrical engineering and control theory, a Bode plot /ˈboʊdi/ is a graph of the frequency response of a system. It is usually a combination of a Bode magnitude plot, expressing the magnitude (usually in decibels) of the frequency response, and a Bode phase plot, expressing the phase shift.

How to draw a Bode plot using MATLAB? ›

To create Bode plots with default options or to extract the frequency response data, use bode . h = bodeplot( sys ) plots the Bode magnitude and phase of the dynamic system model sys and returns the plot handle h to the plot. You can use this handle h to customize the plot with the getoptions and setoptions commands.

How do you find the magnitude of a graph? ›

If the components of the vector are given instead, one can determine the magnitude of the vector using the Pythagorean theorem, expressed as: c 2 = a 2 + b 2 or A 2 = A x 2 + A y 2 where c/A is the hypotenuse/resultant vector, and a/A x and b/A y are the components.

How do you find the magnitude of a projection? ›

The magnitude of the projection of b onto a, |projab|, is also called the component of b along a. It is denoted as compab and is equal to the magnitude of b times the cosine of , the angle between a and b. Because , compab is also equal to the dot product of a and b divided by the magnitude of a.

How do you find the magnitude of a value? ›

For numbers such as 1, 2, 3, and so on, the magnitude is simply the number itself. If the number is negative, the magnitude becomes the absolute value of the number. For example, the magnitude of 10 is 10. The magnitude of -10 becomes the absolute value of -10, which is 10.

How do you find the magnitude of a position? ›

Given a position vector →v=⟨a,b⟩,the magnitude is found by |v|=√a2+b2. The direction is equal to the angle formed with the x-axis, or with the y-axis, depending on the application.

Top Articles
KFC Nashville Hot Fried Chicken Recipe using Cauliflower | Vegan Recipe
20 Leftover Salmon Recipes for Busy Weeknights
What Is Single Sign-on (SSO)? Meaning and How It Works? | Fortinet
Health Benefits of Guava
Robinhood Turbotax Discount 2023
Zitobox 5000 Free Coins 2023
Teamexpress Login
Athletic Squad With Poles Crossword
Green Bay Press Gazette Obituary
Moviesda Dubbed Tamil Movies
Top Golf 3000 Clubs
Tugboat Information
State Of Illinois Comptroller Salary Database
South Bend Tribune Online
Funny Marco Birth Chart
Nebraska Furniture Tables
Conan Exiles Thrall Master Build: Best Attributes, Armor, Skills, More
Price Of Gas At Sam's
Justified Official Series Trailer
Toy Story 3 Animation Screencaps
Sofia the baddie dog
Nearest Ups Ground Drop Off
Usa Massage Reviews
Lcsc Skyward
Mississippi Craigslist
Askhistorians Book List
Solo Player Level 2K23
Parent Management Training (PMT) Worksheet | HappierTHERAPY
Nurtsug
Gus Floribama Shore Drugs
Kaiju Paradise Crafting Recipes
Tributes flow for Soundgarden singer Chris Cornell as cause of death revealed
Rocketpult Infinite Fuel
Joe's Truck Accessories Summerville South Carolina
Back to the Future Part III | Rotten Tomatoes
Best Restaurants In Blacksburg
Raisya Crow on LinkedIn: Breckie Hill Shower Video viral Cucumber Leaks VIDEO Click to watch full…
Claim loopt uit op pr-drama voor Hohenzollern
Wal-Mart 2516 Directory
Blackwolf Run Pro Shop
60 X 60 Christmas Tablecloths
Amc.santa Anita
Hovia reveals top 4 feel-good wallpaper trends for 2024
Cocorahs South Dakota
Grizzly Expiration Date Chart 2023
Collision Masters Fairbanks
Ucla Basketball Bruinzone
Tyrone Dave Chappelle Show Gif
Strange World Showtimes Near Century Federal Way
How To Connect To Rutgers Wifi
Jasgotgass2
What Are Routing Numbers And How Do You Find Them? | MoneyTransfers.com
Latest Posts
Article information

Author: The Hon. Margery Christiansen

Last Updated:

Views: 6303

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: The Hon. Margery Christiansen

Birthday: 2000-07-07

Address: 5050 Breitenberg Knoll, New Robert, MI 45409

Phone: +2556892639372

Job: Investor Mining Engineer

Hobby: Sketching, Cosplaying, Glassblowing, Genealogy, Crocheting, Archery, Skateboarding

Introduction: My name is The Hon. Margery Christiansen, I am a bright, adorable, precious, inexpensive, gorgeous, comfortable, happy person who loves writing and wants to share my knowledge and understanding with you.