Sliding window integrator in matlab code

Hi, I want to implement sliding window integration using matlab code. I know its easy to implement in simulink(its taking large time due to large computation data). but i need this in matlab code. Can any one please provide hints how can i proceed. I have signal with pulse period of 5seconds and my signal is high from 2 to 3 sec.I want to integrate signal only during this period 2 to 3sec.
thank you. NTR

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 11월 14일

0 개 추천

The key function is conv().

댓글 수: 7

NTR
NTR 2011년 11월 14일
I checked this conv. but it is adding some more data.i dont have proper reason why is this happening
Fangjun Jiang
Fangjun Jiang 2011년 11월 14일
If you give a small example data and the expected output, others might help to figure it out.
NTR
NTR 2011년 11월 14일
I have gaussian signal ranging from 0 to 5ns. I want to integrate this signal only in period 2 to 3 ns. For this purpose i want to use windowed integrator. If I use lpf then it integrates input from 0 5 ns period which i don't want.
My idea is to use windowed integrator which can integrate only during required period.But I dont have any clue how can i implement this in matlab code.
I am thinking to multiply gaussian input with square wave which is high during 2 to 3ns out of 5ns period. Then apply integration to this output.
please correct me if i am wrong
Thank you
/NTR
Fangjun Jiang
Fangjun Jiang 2011년 11월 14일
Yes. I would say just multiplying your signal with a square wave signal and then sum the results.
Fangjun Jiang
Fangjun Jiang 2011년 11월 14일
Or use logical index.
t=0:5;
signal=rand(size(t));
selection=and(2<=t,t<=3);
r=sum(signal(selection))
NTR
NTR 2011년 11월 15일
Hi Jiang Thank you are your valuable support. I am doing this by multiplying input with square wave. but I have one question
When we multiply two signal the result will also have unwanted inter modulation products(like mixer).I mean unwanted frequency components.Do you have any comment how these will affect our integrator result.
Fangjun Jiang
Fangjun Jiang 2011년 11월 15일
I don't understand what you are talking about. If signal=rand(6,1), selection=[0 0 1 1 0 0], then r=selection*signal is the same as above, the sum of the value at t==2 and t==3.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

질문:

NTR
2011년 11월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by