How to get transfer function from a bode plot with my data?

Hello everybody,
I have saved the measurement data of a ground diagram and wanted to extract poles and zeros from this measurement data in Matlab. From these measurement data:
-Freq is the frequency
-cs corresponds to the amplitude in dB
-phis corresponds to the phase.
-CTF5 is the file name
I want the poles and zeros from my measurement data (CTF5.txt)
Get Matlab calculated.
What commands should I use to extract the poles and zeros from my measurement data?
I look forward to your help
Best wishes
Thierry Assop
that's my code and it doesn't work with the 'tfest' command:
load CTF5.txt;
Freq=CTF5(:,1);
cs=CTF5(:,2);
phis=CTF5(:,3);
PHA = phis; %phase of experimental result
AMP = cs; %gain of experimental result
W = Freq*2*pi; %transforming frequency in Hz to rad/s
Ts = 0;
gain=10.^(AMP/20);
zfr = gain.*exp(1i*PHA*pi/180);
gfr = frd(zfr,W,Ts);
sys=tfest(gfr,2);
[mag,ph]=bode(sys,w);
mag=squeeze(mag);
ph=squeeze(ph);

댓글 수: 1

Hello. I need some help on the same topic. The problem is that I have only the magnitude plot for my system. How can I derive the transfer function in this case? Please help me in this regard.

댓글을 달려면 로그인하십시오.

답변 (1개)

Star Strider
Star Strider 2020년 8월 3일
Add to your posted code:
sys=tfest(gfr,3);
since this gives a more accurate result, and then:
[poles,zeros] = pzmap(sys)
figure
compare(gfr,sys)
figure
pzmap(sys)
to get the plots and:
poles =
-1.3392e+03 + 6.4091e+03i
-1.3392e+03 - 6.4091e+03i
-7.6758e+02 - 2.1655e-06i
zeros =
-4.3503e+03 + 2.2001e+03i
-4.3503e+03 - 2.2001e+03i
Also, if you want to model it as a sampled (not continuous) system, and assuming the maximum frequency in the data is the Nyquist frequency, use:
Ts = 1/(2*max(Freq));
.

댓글 수: 4

Hello
thank you for your quick reply. But did you try the new code with my data? I tried again with the new code, but I always get this error message:
'tfest' requires System Identification Toolbox.
Error in Uebertragungsfunktion (line 15)
sys=tfest(gfr,3);
Can you please try the new code with my data?
thanks in advance
My pleasure!
Since you arre using tfest in your code, I assume that you have the System Identification Toolbox. (I have it, obviously.) If you do not have it, you need to download it and install it in order to identify your system.
I use the data in ‘CTF5.txt’ in my code, and used the code you posted to read it and assign the variables, since your code otherwise appears to be correct in calculating the frequencies, magnitude, and complex array that the frd or idfrd functions require. I simply did not post that part of my code because I used the code you posted, only posting my documented changes to it.
I have no idea what you intend by ‘new code’. I used the code you posted, with my additions. (I did not open the .m file, since I assumed that it contains the same code you posted.)
Thanks again for the quick reply.
I then try to download the Indentification Toolbox and try it again.
My pleasure!
The code will work with the System Identification Toolbox.

댓글을 달려면 로그인하십시오.

카테고리

Community Treasure Hunt

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

Start Hunting!

Translated by