1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Need matlab help

  1. Dec 7, 2008 #1
    hi all, this is fayez. is there anyone who can send me a matlab simulation code? the code displays the frequency and phase response of quantum well laser. or pls instruct me about how to do it. pls help me out.
    Last edited: Dec 7, 2008
  2. jcsd
  3. Dec 10, 2008 #2
    Plotting the Frequency Response Using MATLAB

    The frequency response of a system is the major way of characterizing how a system behaves in the frequency domain. It is important to understand the frequency characteristics of a given system rather than time domain characteristics alone for many practical applications like filter design.

    The frequency response of a system, is just the transfer function, evaluated at . Frequency response is usually a complex valued function, so it can be written as , where is the magnitude response and is the phase response. You can use MATLAB to plot the magnitude and phase responses as follows:

    Example: , to plot magnitude and phase responses use the following command lines. Define two vectors b and a where b is the coefficients of the polynomial in the numerator, and a is the coefficients of the polynomial in the numerator.
    Note that they have to be the same length and start with the coefficient of the highest order term. Then define w as the vector of frequencies over which you want to plot the magnitude and phase responses.

    >> b=[0 1 -1];
    >> a=[1 8 8];
    >> w=[0:.1:2*pi];
    >> freqs(b,a,w)

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook