Transfer function extraction from frequency response

39 views (last 30 days)
Hello,
I am trying to get a step response to a system whose magnitude and impulse reponse data for different frequencies are known.
num= xlsread('C:\Users\PrasadNGanes\Desktop\Try4_TF.xlsx');
FrequencyVector= num(:,1);
mag = num(:,2);
phase = num(:,3);
phase = deg2rad(phase);
ResponseData = horzcat(mag, phase);
sys = frd(ResponseData,FrequencyVector);
[num,den] = bode(sys);
H = tf(num,den);
step(H);
I am getting an error stating :
Error using DynamicSystem/bode
The "bode" command operates on a single model when used with output arguments.
How to resolve this error.

Accepted Answer

Star Strider
Star Strider on 20 Feb 2024
You will need to use the System Identification Toolbox for this.
Then:
ResponseData = mag.*exp(1j*phase);
data = idfrd(ResponseData,FrequencyVector,SamplingInterval);
H = tfest(data)
And proceed from there.
See the documentation on idfrd for details.
.
  17 Comments
Star Strider
Star Strider on 27 Feb 2024
My pleasure.
Apparently that has some system defined in it, however I was unable to determine what the system was, or how it was defined. If it is a plant or filter, you may be able to get the information you want from it.
Ganesh Prasad
Ganesh Prasad on 27 Feb 2024
The system(A probe in my case) is defined in the form of Scattering parameter(S2P) matrix.
The theory i read in the internet is that impulse response is the IFFT of S21 vector(transmission coefficients) and the input is determined by the convolution of output with derived inverse impulse response.
However, that theory is not working in my case.

Sign in to comment.

More Answers (1)

Aquatris
Aquatris on 20 Feb 2024
First of all, bode command does not give you numerator and denominator. It gives you magnitude and phase of the system, or FRD in your case.
In order to get a step response with the 'step' function, you need to provide a transfer function or state space representation of a system to the step function.
That is why you first need to fit a model to your FRD. You can use the system identification toolbox if you have access to it. Alternatively, if you know the structure of your model, you can also formulate a simple optimization problem or manually try to fit a model by adjusting the parameters.
Once you fit a model to your FRD, then you can use the step function to obtain the step response.

Categories

Find more on Polynomials in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!