How I can plot the magnitude and phase response oh the function (2024)

178 views (last 30 days)

Show older comments

Helda on 19 Oct 2013

  • Link

    Direct link to this question

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function

  • Link

    Direct link to this question

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function

Answered: Abood Abusafea on 2 Feb 2022

i want do that for this function y=(4*sin(50*t)/(6*t)

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

Sign in to answer this question.

Answers (7)

sixwwwwww on 19 Oct 2013

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_100247

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_100247

Open in MATLAB Online

Dear Helda, here is an example showing amplitude and phase plots of your defined function:

t = 1:100;

y = 4 * sin(50 * t) ./ (6 * t);

figure, plot(t, abs(y)), title('Amplitude plot')

figure, plot(t, angle(y)), title('Phase plot')

I hope it helps. Good luck!

8 Comments

Show 6 older commentsHide 6 older comments

Helda on 20 Oct 2013

Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_175343

  • Link

    Direct link to this comment

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_175343

thanx alot :)

Helda on 20 Oct 2013

Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_175344

  • Link

    Direct link to this comment

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_175344

oh ,,,, but i want to plot the response oh this function ,,, i think we will convert the function to frequency domain ,,, plz help me

sixwwwwww on 20 Oct 2013

Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_175364

  • Link

    Direct link to this comment

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_175364

Open in MATLAB Online

You can do so by the following way:

syms t y s

y = 4 * sin(50 * t) / (6 * t);

figure, ezplot(abs(y), [1, 100]), title('Amplitude of transfer function'), ylabel('Amplitude')

figure, ezplot(angle(y), [1, 100]), title('Phase of transfer function'), ylabel('Phase')

response_function = laplace(y, t, s);

figure, ezplot(abs(response_function)), title('Amplitude of response function'), ylabel('Amplitude')

figure, ezplot(angle(response_function)), title('Phase of response function'), ylabel('Phase')

Good luck!

Helda on 24 Oct 2013

Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_176271

  • Link

    Direct link to this comment

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_176271

hi i want to ask u some question :) what the meaning of this code ?? fs=100; t=0:1/fs:5; x=4*cos(2*pi*10*t+pi/6); X=fft(x); n=length(x); c=(-1*fs)/2:fs/n:fs/2-fs/n; subplot(4, 1, 1),plot(t,x); subplot(4, 1 ,2),plot(c,fftshift(abs(X))); subplot(4, 1, 3),plot(c,phase(X)); subplot(4,1 ,4),plot(c,real(X)); ...... why did use this statement (( n=length(x);))?? i hope u can help me !!

sixwwwwww on 24 Oct 2013

Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_176283

  • Link

    Direct link to this comment

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_176283

Open in MATLAB Online

Here is the explanation of this code:

fs = 100; % It is sampling frequency

t=0:1/fs:5; % It is time series used to generate signal x

x = 4 * cos(2 * pi * 10 * t + pi / 6); % x is function of t

X = fft(x); % This statement computes Fourier transform of x

n = length(x); % length(x) gives the array length of signal x

c = (-1 * fs) / 2:fs / n:fs / 2 - fs / n; % It generates the frequency series to plot X in frequency domain

subplot(4, 1, 1),plot(t,x); % This subplot shows the signal x vs. time series t

subplot(4, 1 ,2),plot(c,fftshift(abs(X))); % This subplot shows the Fourier spectrum of x with zero frequency component shifted to center

subplot(4, 1, 3),plot(c,phase(X)); % This subplot shows the phase distribution of X (Fourier transform of x)

subplot(4,1 ,4),plot(c,real(X)); % This subplot shows the real component of X spectrum

and the statement

n=length(x);

is used to make the length of frequency series equal to length of time series to plot Fourier transform of signal x correctly

David on 25 Oct 2013

Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_176311

  • Link

    Direct link to this comment

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_176311

Wow, way to make her put in a little effort of her own.

Helda on 28 Nov 2013

Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_182476

  • Link

    Direct link to this comment

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_182476

plz help me :/ for filter with a transfer function of H=(0.1667*s^3-0.5*s^2+0.5*s+0.1667)/(s^3-0.3333*s) what is the filter order ? what the filter type ? (FIR,IIR) why? plot the frequency response of the filter ? find the filter gain by matlab ?

Engr Muhammad Amir Shahzad on 11 Apr 2020

Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_825906

  • Link

    Direct link to this comment

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#comment_825906

@sixwwww. Why you used *fftshift* in plotting magnitude of signal?

Sign in to comment.

David on 20 Oct 2013

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_100317

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_100317

Open in MATLAB Online

"How I can plot the magnitude and phase response of the function

y=(4*sin(50*t)/(6*t)"

From what I've read, it seems you want the amplitude and phase of this function in the frequency domain. If this is the correct assumption to make, then you will need to make a lot more specifications. You will need to know your sampling rate, Fs, and either your time of observation or the number of points you have sampled. After you have figured these out, look into 'fft' function MATLAB provides.

An alternate route would be to use MATLAB's symbolic toolbox. You will want to look into how to create symbolic variables and symbolic equations as well as how to use the 'laplace', 'subs', and 'ezplot' functions. Good luck.

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

Afshin Aghayan on 24 Jul 2017

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_275291

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_275291

Edited: Afshin Aghayan on 2 Aug 2017

look at the following Matlab function, it can calculate phase spectrum as well as amplitude spectrum with a perfect accuracy:

https://www.mathworks.com/matlabcentral/fileexchange/63965-amplitude-and-phase-spectra-of-a-signal--fourier-transform-

This program calculates amplitude and phase spectra of an input signal with acceptable accuracy especially in the calculation of phase spectrum.The code does three main jobs for calculation amplitude and phase spectra. First of all, it extends the input signal to infinity; because for calculation Fourier transform(FT) (fft function in Matlab), we consider our signal is periodic with an infinite wavelength, the code creates a super_signal by putting original signal next to itself until the length of super_signal is around 1000000 samples, why did I choose 1000000 samples? Actually, it is just based on try and error!! For most signals that I have tried, a supper signal with 1000000 samples has the best output.

Second, for calculating fft in Matlab you can choose different resolutions, the Mathwork document and help use NFFT=2^nextpow2(length(signal)), it definitely isn't enough for one that wants high accuracy output. Here, I choose the resolution of NFFT=100000 that works for most signals.

Third, the code filters result of FT by thresholding, it is very important step! For calculating phase spectrum, its result is very noisy because of floating rounding off error, it causes during calculation "arctan" even small rounding off error produces significant noise in the result of phase spectrum, for suppressing this kind of noise you can define a threshold value. It means if amplitude of specific frequency is less than predefined threshold value (you must define it) it put zero instead of it.

These three steps help to improve the result of amplitude and phase spectra significantly.

IF YOU USE THIS PROGRAM IN YOUR RESEARCH, PLEASE CITE THE FOLLOWING PAPER:

Afshin Aghayan, Priyank Jaiswal, and Hamid Reza Siahkoohi (2016). "Seismic denoising using the redundant lifting scheme." GEOPHYSICS, 81(3), V249-V260. https://doi.org/10.1190/geo2015-0601.1

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

Ammar Uddin on 12 Feb 2018

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_304767

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_304767

How can I plot the magnitude and phase spectrum of this DTFT.

x(n) = a*n u(n)

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

wyeen chow on 10 Nov 2019

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_400755

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_400755

Hi, can i know how to plot a magnitude and phase spectrum for full wave rectifier? I had calculated manually?

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

SRIKRISHNAN SRIRAMAN on 10 Nov 2020

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_539650

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_539650

Consider a sinusoidal signal with frequency components of 5Khz, 12Khz and 14Khz .

Find and plot the magnitude and phase spectra of the signal.

Plz suggest me how

to code this question

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

Abood Abusafea on 2 Feb 2022

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_887020

  • Link

    Direct link to this answer

    https://nl.mathworks.com/matlabcentral/answers/90780-how-i-can-plot-the-magnitude-and-phase-response-oh-the-function#answer_887020

14s/(s+13)

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

Sign in to answer this question.

See Also

Categories

RadarPhased Array System ToolboxWaveform Design and Signal SynthesisMatched Filter and Ambiguity Function

Find more on Matched Filter and Ambiguity Function in Help Center and File Exchange

Tags

  • digital image processing

Community Treasure Hunt

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

Start Hunting!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.


How I can plot the magnitude and phase response oh the function (17)

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)
  • 中国
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

How I can plot the magnitude and phase response oh the function (2024)

FAQs

How do you find the magnitude and phase 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 ) .

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ω)|. The magnitude of the loop gain is given in dB as: |KGH(jω)|dB=20logK+∑mi=120log|1+jωzi|−(20n0)logω−∑n1i=120log|1+jωpi|−∑n2i=120log|1−ω2ω2n,i+j2ζiωωn,i|.

How do you plot the magnitude of a signal? ›

The two major components frequency and amplitude of a periodic signal define the Magnitude Spectrum of that signal. The frequency components of the periodic signal are plotted in the horizontal axis and amplitude component of the periodic signal is plotted in the vertical axis.

What is magnitude and phase response in Fourier transform? ›

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 magnitude and phase plot? ›

the magnitude plot is a straight line with a slope of 20 d B per decade, passing through the abscissa axis at ω = 1 rad/s, and the phase plot is a constant equal to 90 ∘ (Fig. 5.9): Figure 5.9. Bode plots of the monomial term j ω . | j ω | d B = 20 log 10 ω , 1 j ω = − 90 ∘ .

How to find the magnitude of a function? ›

Thus, 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 draw a magnitude plot? ›

For the magnitude plot, mark the starting point on the graph and draw a straight line with the starting slope until you reach the frequency of a pole or zero. At this point, zeros change the slope by 20 dB/dec and poles change the slope by −20 dB/dec.

How do you plot a frequency plot? ›

Draw a pair of axes and label them with 'Frequency' on the vertical axis ( y y y-axis) and 'Measurement' on the horizontal axis ( x x x-axis). Use a ruler to draw each bar with the correct height. Draw the heights of the bars depending on its frequency.

Why do we plot frequency response? ›

Frequency response plots provide insight into linear systems dynamics, such as frequency-dependent gains, resonances, and phase shifts. Frequency response plots also contain information about controller requirements and achievable bandwidths.

What is the difference between magnitude and phase response? ›

The magnitude is the square root of the sum of the squares of the real and imaginary parts. The phase is relative to the start of the time record or relative to a single-cycle cosine wave starting at the beginning of the time record.

What is the phase plot of a signal? ›

As defined earlier, a phase plot shows the difference in phase between the measured heterodyned beat signal and the superimposed reference signal as a function of time.

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 to find the magnitude of a frequency 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 ) .

How do you find the magnitude and phase of a Fourier series? ›

Alternatively, the signal y(t) may be described by the magnitudes Dn and the phase angles φn: where the magnitude and the phase angle can be calculated from the Fourier coefficients as follows: φn = tan-1 (Bn/An). The following interactive example shows you how to combine sines and cosines to form a signal y(t).

How do you measure phase response? ›

For phase response measurement we need to measure both the phase at the input and output of the filter and calculate the difference. We can do this with the DSP options. At the cut-of frequency we get a phase shift around 90degree.

How do you find the magnitude and phase of impedance? ›

Impedance in circuits

This is less mathematical and requires an appreciation that a sinusoidal curve can be constructed by a rotating vector arrow (seen in SHM), and a knowledge of Pythagoras. Here Z0​ is the magnitude of Z so Z0​=X2+Y2 ​ and ϕ is the phase of Z which has the value ϕ=arctan(XY​).

How do you find the magnitude of the steady-state response? ›

The response that the output signal reaches as time passes long is called the steady-state response. Interestingly, H ( ω ) , which represents the magnitude and phase at the steady-state response, can be derived: (1.59) ∫ 0 ∞ h ( t ) e − i ω t d t = H ( ω ) .

Top Articles
Ukraine-Russia war - latest updates
How to Respond to Settlement Decisions | Gamer Guides: Yo...
Evil Dead Movies In Order & Timeline
Forozdz
Using GPT for translation: How to get the best outcomes
Was ist ein Crawler? | Finde es jetzt raus! | OMT-Lexikon
Mcfarland Usa 123Movies
Aadya Bazaar
Shs Games 1V1 Lol
Craigslist Portales
Linkvertise Bypass 2023
Chalupp's Pizza Taos Menu
Holly Ranch Aussie Farm
2022 Apple Trade P36
Bowie Tx Craigslist
How To Cut Eelgrass Grounded
Gdlauncher Downloading Game Files Loop
Dtab Customs
Lazarillo De Tormes Summary and Study Guide | SuperSummary
Lehmann's Power Equipment
Daylight Matt And Kim Lyrics
PCM.daily - Discussion Forum: Classique du Grand Duché
Johnnie Walker Double Black Costco
Gotcha Rva 2022
The 15 Best Sites to Watch Movies for Free (Legally!)
Gillette Craigslist
Mjc Financial Aid Phone Number
Abga Gestation Calculator
Aladtec Login Denver Health
Kaiju Paradise Crafting Recipes
Composite Function Calculator + Online Solver With Free Steps
67-72 Chevy Truck Parts Craigslist
Frostbite Blaster
8005607994
Thanksgiving Point Luminaria Promo Code
Pay Entergy Bill
MSD Animal Health Hub: Nobivac® Rabies Q & A
Registrar Lls
Weather Underground Corvallis
Ursula Creed Datasheet
Mbfs Com Login
Funkin' on the Heights
20 Mr. Miyagi Inspirational Quotes For Wisdom
Nearest Wintrust Bank
Keci News
Lesly Center Tiraj Rapid
Waco.craigslist
Wera13X
Hampton Inn Corbin Ky Bed Bugs
Frank 26 Forum
Ingersoll Greenwood Funeral Home Obituaries
Inloggen bij AH Sam - E-Overheid
Latest Posts
Article information

Author: Neely Ledner

Last Updated:

Views: 5389

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.