How to sample and process signals of a given length in Simulink

I have to calculate the correlation of a signal x in Simulink:
Exx = 0;
for t=1:size(x,1)
Exx = Exx + x(:,t)*x(:,t)';
end
Exx = Exx/size(x,1)
where x(:,t) corresponds n signal values measured at time t.
If this is to be done in Simulink, do I have to use the embedded Matlab function, or is there a more elegant way?
Thanks :)
Benjamin

 채택된 답변

Paulo Silva
Paulo Silva 2011년 3월 2일

0 개 추천

To sample the signals use Weighted Sample Time block from simulink, there might be more options inside the signal processing library.

추가 답변 (1개)

Kaustubha Govind
Kaustubha Govind 2011년 3월 2일

0 개 추천

Use the Autocorrelation block, or follow the diagram description in the block documentation to implement your own.

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by