Thread Subject: freqz to plot frequency response

Subject: freqz to plot frequency response

From: Arthur Zheng

Date: 15 Jan, 2009 03:15:07

Message: 1 of 3

I am trying to test plotting the frequency response of the simple system H(w) = 2 * e^(-jw). It's obvious that the magnitude of the frequency response in theory should be 2, and the phase should be (-w).

However, the code below doesn't get me the above plot. What's wrong with the code?

omega=(0:400)*pi/400; b=[1,2];
H=freqz(b,1,omega);
subplot(211); plot(omega/pi,abs(H))
subplot(212); plot(omega/pi,angle(H))

Regards,
Hao Zheng (Arthur)

Subject: freqz to plot frequency response

From: Rajiv Singh

Date: 15 Jan, 2009 03:24:47

Message: 2 of 3

b should b [0 2]?

-rajiv

"Arthur Zheng" <hzheng7@gatech.edu> wrote in message
news:gkm9nr$r1g$1@fred.mathworks.com...
>I am trying to test plotting the frequency response of the simple system
>H(w) = 2 * e^(-jw). It's obvious that the magnitude of the frequency
>response in theory should be 2, and the phase should be (-w).
>
> However, the code below doesn't get me the above plot. What's wrong with
> the code?
>
> omega=(0:400)*pi/400; b=[1,2];
> H=freqz(b,1,omega);
> subplot(211); plot(omega/pi,abs(H))
> subplot(212); plot(omega/pi,angle(H))
>
> Regards,
> Hao Zheng (Arthur)
>
>
>

Subject: freqz to plot frequency response

From: Arthur Zheng

Date: 15 Jan, 2009 03:38:02

Message: 3 of 3

oh, yes. thank you.

"Rajiv Singh" <rajiv_singh@msn.com> wrote in message <gkma9m$2gg$1@fred.mathworks.com>...
> b should b [0 2]?
>
> -rajiv
>
> "Arthur Zheng" <hzheng7@gatech.edu> wrote in message
> news:gkm9nr$r1g$1@fred.mathworks.com...
> >I am trying to test plotting the frequency response of the simple system
> >H(w) = 2 * e^(-jw). It's obvious that the magnitude of the frequency
> >response in theory should be 2, and the phase should be (-w).
> >
> > However, the code below doesn't get me the above plot. What's wrong with
> > the code?
> >
> > omega=(0:400)*pi/400; b=[1,2];
> > H=freqz(b,1,omega);
> > subplot(211); plot(omega/pi,abs(H))
> > subplot(212); plot(omega/pi,angle(H))
> >
> > Regards,
> > Hao Zheng (Arthur)
> >
> >
> >
>

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
filter Arthur Zheng 14 Jan, 2009 22:20:06
signal processing Arthur Zheng 14 Jan, 2009 22:20:05
dsp Arthur Zheng 14 Jan, 2009 22:20:05
rssFeed for this Thread

Contact us at files@mathworks.com