Graph output of a system from transfer function raw data

3 visualizaciones (últimos 30 días)
Kyle Corder
Kyle Corder el 4 de Feb. de 2020
Comentada: Star Strider el 4 de Feb. de 2020
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 comentarios
Lucademicus
Lucademicus el 4 de Feb. de 2020
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 el 4 de Feb. de 2020
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

Iniciar sesión para comentar.

Respuestas (1)

Star Strider
Star Strider el 4 de Feb. de 2020
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 comentarios
Kyle Corder
Kyle Corder el 4 de Feb. de 2020
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 el 4 de Feb. de 2020
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.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by