Graph output of a system from transfer function raw data

조회 수: 4 (최근 30일)
Kyle Corder
Kyle Corder 2020년 2월 4일
댓글: Star Strider 2020년 2월 4일
I have a .mat file that contains 100's of lines of raw transfer function data in complex form (for example, line 1: 4 + 3i). I have an input force: f(t) = sin(3t) for example. I know that Output = Transfer Function * Input, but I have trouble with telling matlab how to do this. Any guidance would be much appreciated. Thanks
  댓글 수: 2
Lucademicus
Lucademicus 2020년 2월 4일
How does the .mat file contents look like? Are the 100's of lines you mention, in a single variable? Are it multiple variables, if so, what are the names and contents?
Kyle Corder
Kyle Corder 2020년 2월 4일
The .mat file is a 1x1 struct with 2 fields. The field relevant to the problem contains a 501x1 array titled "transferfunctiondata" with complex numbers in rectangular form (for example 4 + 3i).
I need to graph the output response from f(t). I know that output = f(t) * transferfunctiondata, but I am not sure the proper commands needed to do this. I don't think I can use tfest.
Thanks

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

답변 (1개)

Star Strider
Star Strider 2020년 2월 4일
I am guessing that your transfer function data is the result of something like:
H = fft(output)./fft(input)
If you also have the corresponding frequency data (this can be calculated from the sampling frequency), and you have the System Identification Toolbox (or the Signal Processing Toolbox if you want to estimate it as a digital filter), you can estimate the transfer function.
With the System Identification Toolbox, start with the idfrd function, then tfest. Proceed frrom there.
With the Signal Processing Toolbox,use the invfreqz function. Proceed from there.
Once you have identified your system, you can then use it as a control system or as a filter. See the documentation in the appropriate Toolboxes to understand how to use it.
That’s the efficient, desired approach, even though you may have do some experimenting to get the result you want from the identification functions.
The undesirable alternative is to use the result you have as it exists, without identifying it first. Since you have it in the complex frequency domain, you would have to create a Fourier transform of your input signal, with that signal sampled at exactly the same sampling frequency as the signals that created your transfer function.
Then:
FourierTransform(Output) = TransferFunction .* FourierTransform(Input)
with the hypothetical ‘FourierTransform’ operator being a proxy for what you actually need to do and what the components of this relation actually are. You would then recover your time-domain ‘Output’ signal by taking its inverse Fourier transform.
  댓글 수: 2
Kyle Corder
Kyle Corder 2020년 2월 4일
I should also add that the other field in the struct is frequency data i will call "frequencydata". Using idfrd as you suggested, I have
MF = idfrd(transferfunctiondata, frequencydata, 2)
Transfer = tfest(MF, 2)
Is 2 the correct number of poles? How do I know the correct number?
I then used lsim.
When I plot, I get a reasonable response, but the response changes drastically for the number of poles I use in the argument for tfest.
Thanks
Star Strider
Star Strider 2020년 2월 4일
The response will change drastically as the number of poles (and zeros) change, because the transfer function structure changes. Chjoose the structure that best fits what you know about the system.
A detailed (and in my opinion, excellent) discussion is in the documentation section: Estimating Models Using Frequency-Domain Data. Also see: Troubleshoot Frequency-Domain Identification of Transfer Function Models.

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

카테고리

Help CenterFile Exchange에서 Transfer Function Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by