Impulse response and signal reconstruction
Mostra commenti meno recenti
Hello, I've been given two data sets to help characterise a single-input-single output physical system for some sensors.
As attached, I've filtered and plotted the input and output data for each data set. I'd like to be able to generate (I presume) an impulse response function that will allow me to back out the input signal from a given transient output signal.
I've tried a few ways to do this. Here is one example below. The result from estimating the input data from the generated impulse responses is clearly very poor. You can see this for both data sets A and B (i.e. short and long pulses).
Does anyone know if this is the right method? I'd have thought generating a transfer function and then impulse response from discrete data would've been straightforward but I'm clearly missing something.
Cheers!

% LOAD
load('data_A.mat');
time = data.time;
input_A = data.input;
output_A = data.output;
% TEST PARAMETERS
samplefreq = 5e6;
npoints_pretrigger = 1000;
% clean data
d_A = output_A - mean(output_A(1:npoints_pretrigger));
nx=1:10;
sys_id = n4sid(iddata(input_A,output_A,1/samplefreq),nx); % nx ends up being selected as 1 or 2
[A, B, C, D] = ssdata(sys_id);
[num, den] = ss2tf(A, B, C, D);
h3 = impulse(tf(num, den), time_A); % Generate impulse response using transfer function
output_estimation = fftfilt(h3, output_A) % recover input data
% another check to compare the system estimation to the input signal
compare(iddata(input_A,X_A,1/samplefreq), sys_id)
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Linear Algebra in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!