MATLAB: How to find the Transfer Function having Magnitude, Phase and Frequency(W) and its Bode Diagram

#transferfunction #bodediagram #zeros #poles #gain #problem #help

I need to find the Transfer Funcion (Gain, Poles and Zeros) of a Sistem just having Magnitude[MAG], Phase[PHASE] and Frequency[W], There is a attached file MATLAB with those values, and they are:
MAG{ Min: 0.0014 Max: 98.85} MAG_db { Min: -56.98 Max: 39.89 } PHASE{ Min: -179.18 Max: -94.11} W{ Min: 1.0000e-03 Max: 1}
Bode Diagram:

Best Answer

This is how I would do it. You will have to experiment with the numerator and denominator orders to get the result you want:
d = load('Leonardo Francis sistem.mat');
h = squeeze(d.MAG .* (cos(atan(d.PHASE)) + 1i*sin(atan(d.PHASE))));
w = squeeze(d.W);
[b,a] = invfreqz(h, w, 5, 5);
figure(1)
freqz(b, a, 2048)
set(subplot(2,1,1), 'XScale','log')
set(subplot(2,1,2), 'XScale','log')
I leave that to you.