Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Pole-Zero data

Subject: Pole-Zero data

From: rush

Date: 23 Feb, 2008 19:38:17

Message: 1 of 7

I have the magnitude and phase data from the fft of the transient
response of a system I'm studying.

I am wondering what are the better tools in matlab from with I can
extract/plot pole-zero information. I have looked at impz, residuez,
roots, etc. I can quite figure how to tie all these together.

Any information or pseudocodes for this problem will be appreciated.

Thanks.

Rush

Subject: Pole-Zero data

From: Bill

Date: 23 Feb, 2008 23:21:05

Message: 2 of 7

Well one way is to use tf within lsqcurvefit on num and den
such that [mag,ph]=bode(tf(num,den)) response matches your
data.

You will need a system template and some initial guesses
but that ought to be pretty easy.

Once you have the system, use pzplot or pzmap to look at
the x's and ohs.

Subject: Pole-Zero data

From: rush

Date: 24 Feb, 2008 02:36:49

Message: 3 of 7

On Feb 23, 5:21 pm, "Bill " <william.nospam.a.c...@gm.com> wrote:
> Well one way is to use tf within lsqcurvefit on num and den
> such that [mag,ph]=bode(tf(num,den)) response matches your
> data.
>
> You will need a system template and some initial guesses
> but that ought to be pretty easy.
>
> Once you have the system, use pzplot or pzmap to look at
> the x's and ohs.

This is interesting information Bill. Can you explain a little bit
more on "use tf within lsqcurvefit on num and den" ... you mean I
should fit my frequency domain data (mag most likely) to a response
model f(s or z)?

I found a tool within Matlab called magfit/fitmag for fitting
magnitude data and I'm now experimenting with it. Have you ever used
this?

Subject: Pole-Zero data

From: Bill

Date: 24 Feb, 2008 03:52:06

Message: 4 of 7

Why use magnitude only?

if you have any reasonable model of the data, use "tf" from
the Control System toolbox to construct an LTI model using
the numerator and denominator coefficient set. Use [mag,ph]
=bode(sys) to produce the gain and phase from the model and
pass it as the predicted y(:,2) to lsqcurvefit given your x
frequencies. You will need to have a set of numerator and
denominator initial guesses. The thing should converge in
just a few iterations. If the fit is not that great, your
model is NFG. Pick a better s-plane model and continue the
solution.

All you need to prepare is a function which accepts the
numerator and denominator coefficients in a vector and a
frequency vector. Compute the predicted gain and phase
using [mag,ph]=bode(tf(num,den),w), where w is the passed
frequency band.

That's all it takes. Once you have the transfer function
coefficients that fit the bode data, use them to compute
the pole/zero form using pzplot.

 

Subject: Pole-Zero data

From: rush

Date: 24 Feb, 2008 04:39:51

Message: 5 of 7

On Feb 23, 9:52 pm, "Bill " <william.nospam.a.c...@gm.com> wrote:
> Why use magnitude only?
>
> if you have any reasonable model of the data, use "tf" from
> the Control System toolbox to construct an LTI model using
> the numerator and denominator coefficient set.

I have the mag and phase from the fft, but I dont have a model for the
data, can this be created like this:

[num,den] = invfreqs/invfreqz(mag,freq,nb,na) ... warnings for
invfreqs///invfreqz: (Matrix is close to singular or badly
scaled.Results may be inaccurate.///Warning: W has values outside the
interval [0,pi]. INVFREQZ aliases such values into this interval and
designs a real filter. To design a complex filter, use the 'complex'
flag.)

Also, if I had this model defined by num and den, then:

sys=tf(num,den);
pzplot(sys)

will give the pole-zero reponse

Is this invfreqz/invfreqs worth a second look-at?

> Use [mag,ph]=bode(sys) to produce the gain and phase from the model and
> pass it as the predicted y(:,2)to lsqcurvefit given your x
> frequencies. You will need to have a set of numerator and
> denominator initial guesses. The thing should converge in

So is this fit is for the model. This is the form I've come up with
for the curvefit

intial~[1 1 1 1] %
fit=lsqcurvefit(@(fit,freq)
myfitfunctions(fit,freq),initial,freq,mag);

function F = myfitfunction(fit,w)
F=(fit(1)*w+fit(2))/((fit(3)*w+fit(4)); %assumed model



> just a few iterations. If the fit is not that great, your
> model is NFG. Pick a better s-plane model and continue the
> solution.
>
> All you need to prepare is a function which accepts the
> numerator and denominator coefficients in a vector and a
> frequency vector. Compute the predicted gain and phase
> using [mag,ph]=bode(tf(num,den),w), where w is the passed
> frequency band.
>
> That's all it takes. Once you have the transfer function
> coefficients that fit the bode data, use them to compute
> the pole/zero form using pzplot.

Again I wonder that INVFREQS maybe the way to go after all, perhaps
I'm misunderstanding something here.
Thank you for your help, it has given me other ways of thinking about
the problem.

Subject: Pole-Zero data

From: rush

Date: 24 Feb, 2008 16:07:26

Message: 6 of 7

On Feb 23, 10:39 pm, rush <rus...@gmail.com> wrote:

> Again I wonder that INVFREQS maybe the way to go after all, perhaps
> I'm misunderstanding something here.
> Thank you for your help, it has given me other ways of thinking about
> the problem.

I am happy to tell you invfreqs worked after all. Now I understand
even more why you advocated lsqcurvefit and I intend to still use it
as a backup if I have some spectra invfreqs does fit well. Thanks
again Bill!

Subject: Pole-Zero data

From: fatih

Date: 29 Oct, 2011 16:38:14

Message: 7 of 7

rush <rush3k@gmail.com> wrote in message <e5d5abc8-8810-40b1-aa44-5fe53ac87340@n77g2000hse.googlegroups.com>...
> On Feb 23, 10:39 pm, rush <rus...@gmail.com> wrote:
>
> > "Again I wonder that INVFREQS maybe the way to go after all, perhaps
> > I'm misunderstanding something here.
> > Thank you for your help, it has given me other ways of thinking about
> > the problem."
>
> I am happy to tell you invfreqs worked after all. Now I understand
> even more why you advocated lsqcurvefit and I intend to still use it
> as a backup if I have some spectra invfreqs does fit well. Thanks
> again Bill!

Tags for this Thread

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.

Contact us