How can I determinate the delay and the time constant from script?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi!
I have an input and an output vector, for example:
in=[0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1]
out=[0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 2; 12; 17; 20; 21; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22]
If you want to see it in a figure, type the following code to the Command Window:
in=[0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1];
out=[0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 2; 12; 17; 20; 21; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22];
x=(1:1:30);
plot(x,in,'red')
hold
plot(x,out,'blue')
hold
I would like to determinate the delay and the time constant. I have System Identification Toolbox, and I can determinate the delay in GUI mode (Td=2.864), but I would like to determinate it in a matlab script. Which functions have to use, and how? Maybe I have to use the delayest function, but it doesn't works in this way:
DATA=iddata(out,in,0.1)
delayest(DATA)
The result is 0.
So I think this is not the right way. Can somebody write me an example to this two vector?
Thanks in advance!
0 commentaires
Réponses (4)
Image Analyst
le 18 Fév 2013
What about just thresholding and using find()? Let's say that you say a signal starts when its amplitude exceeds some threshold:
thresholdValue = 0.5;
inStartTime = find(in > thresholdValue, 1, 'first')
outStartTime = find(out > thresholdValue, 1, 'first')
lagTime = outStartTime - inStartTime
0 commentaires
Rajiv Singh
le 19 Fév 2013
Try impulse response estimation based approaches, assuming you are able to find a good FIR model for data (which you can ascertain using COMPARE)
m=impulseest(DATA); h = impulseplot(m); showConfidence(h,3)
The first response value that is significantly out of 3 sd region is at t = 0.3 which indicates a 3 sample (0.3 sec) delay. See:
1 commentaire
Image Analyst
le 20 Fév 2013
This is not an answer. It is supposed to be a comment to someone but we don't know who because you posted it as an independent answer. Please copy it to a comment where it belongs.
Ákos
le 20 Fév 2013
Modifié(e) : Ákos
le 20 Fév 2013
1 commentaire
Image Analyst
le 20 Fév 2013
This is not an answer. It is supposed to be a comment to someone but we don't know who because you posted it as an independent answer. Please copy it to a comment where it belongs.
Voir également
Catégories
En savoir plus sur Correlation Models dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!