# Matlab - Frequency Response

Discussion in 'Programmer's Corner' started by cloud, Dec 27, 2006.

1. ### cloud Thread Starter Member

Dec 15, 2006
11
0
I write [num,den]=invfreqz(tf(1:50001),f,3,3) to compute my num and den of my transfer function(tf). Then, from the num and den that I obtained, I compute my approximated frequency response using fvtool(num,den). But this computed frequency response does not match my measured response. I do not know what goes wrong. Can someone help me?

Thank you.

File size:
32.1 KB
Views:
35
2. ### Dave Retired Moderator

Nov 17, 2003
6,960
144
What is num and den as calculated by the function invfreq?

Also can you post up your mesured response as a JPEG so that we can compare the two plots?

Dave

3. ### Papabravo Expert

Feb 24, 2006
10,021
1,757
For all practical purposes your measued response at 6e-3 is equal to the approximated response of 1.5e-3.

Once again you are talking transfer function when you have nothing of the sort. Sampled data does not produce a transfer function. Poles and zeros produce transfer functions and you have neither in your plotted data. The analysis you are doing is completely bogus. Take a step back and try to educate yourself on what you are doing and why. Then explain it to us. We can't help you if you continue on this path which is not grounded in reality.

A true magnitude plot would show 20*log(Vout/Vin) versus log frequency over several decades. Along with the magnitude plot would be a phase plot.

4. ### cloud Thread Starter Member

Dec 15, 2006
11
0
Num is the numerator of the magnitude response of the digital filter and den is the denominator of the magnitude response of the digital filter.

The approximated plot is the magnitude plot I obtained from fvtool(num,den) while the measured plot is the magnitude plot that I measured.

File size:
32.1 KB
Views:
24
5. ### Dave Retired Moderator

Nov 17, 2003
6,960
144
I am aware what the denominator and numerator are, but you should have them expressed in polynomial form for the fvtool function. What is the polynomial transfer function?

I also cannot find the function invfreqz - is this a function you have written?

Apologies I didn't look at the graph properly.

Dave

6. ### sytem_recon Active Member

Apr 21, 2009
52
0
I have a similar problem like yours. If you solved yours then please help me.
I have input data u(t) and output data y(t) of a system having 500 points. This is test data from a SISO system. I am trying to use MATLAB so that it take a vector of input data, output data, and a sample time and produce the frequency response of the system (magnitude and phase). After this i want to make transfer function for this. My objective is to reconstruct the input signal from my output or output from input. Actually i need reconstruction signal of my system and for that i think i will use that transfer function. an equation i.e. in lsim.
I use a manual method of finding poles and zeros of the response. How, i can calculate the zeros and poles from the response data. Am i right to reconstruct the signal input from output and output from input. Is there any other way to reconstruct such signal. How can i get T.F. from my calculated response. If you understand and can solve my problem please! help. How can I do this in matlab or other method.