How to extract impulse response from an unknown system?

5 views (last 30 days)
Hi everyone,
I have received a .p file that contains a mathematical representation of a continuous system. My role is to obtain a transfer function of this system by observing the input and output.
What I have been doing seems pretty obvious - I was sending an artificial impulse through the system and I managed to start noticing, that the system is a second order system, some sort of an oscillator. The way I've done it will be pretty clear from my code I attached, but to clarify - I ran the simulation 20 times and then average the value of all the matrices 'ym'. The idea was to 'smooth' or 'filter' the noise in order to obtain the clearest form of the impulse response. Noise is random, therefore it changed with every iteration (that can be observed on plots using 'pause' command).
My question is: what would be the best approach to extract the impulse response without getting noisy waveforms? tfestimate function might be working, along with windowing the input, but I'm not sure how to tackle it. Transfer function also presents some trouble, seeing as I first need to obtain clear response of the system.
Would anyone be willing to have a look at my code and the attached .p file? I'd appreciate your help very much!
Regards,
escapadro
P.S Update: I just noticed I can't attach the .p file (obviously, I was silly), but if you could have a look at the top part of the code in BlackBoxAGAIN and shedding some light on my uncertainties - I will be grateful, thanks! Ignore the bottom part of the code, it's for a similar problem, but for a different system.
  1 Comment
Mostafa
Mostafa on 13 Oct 2016
If possible, try to get your hands on Matlab's System Identification toolbox. It can deduce the transfer function from the impulse response.

Sign in to comment.

Answers (1)

escapadro soprano
escapadro soprano on 26 Oct 2016
I managed to open systemIdentification - however, I am not entirely sure if I can specify a .p file as the system in the app?
  1 Comment
Mostafa
Mostafa on 27 Oct 2016
You only need the input data and output data (which I believe you already saved) to use the toolbox. May be check this out: https://www.youtube.com/watch?v=uBTs4z0Aadk
In any case, you can write a simple matlab script to call the .p file n-times with different inputs and record the data to use it later in the SI toolbox (basically just collect all the steps you've already done and write it in one script).

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!