필터 지우기
필터 지우기

Sliding window to calculate intra-window difference

조회 수: 6 (최근 30일)
Iram Shahzadi
Iram Shahzadi 2018년 9월 24일
댓글: Adam Danz 2018년 9월 25일
I have a matrix s=512*100*20 (with N=100). I want to implement sliding window of a width 2W+1 that is centered at position i to compute the intra-window difference s(i+w)-s(i-w) for every possible position. I have attached the algorithm. Anyone, please help me how to implement it in Matlab.

채택된 답변

Adam Danz
Adam Danz 2018년 9월 24일
The formula in the attachment is written below. I don't know what your value W is and I don't now how your variable N comes into play.
% deltaW = nan(?,?); %allocate your loop variable here after you know what its size should be.
for i = W : N-1-W
deltaW(i) = s(i+W) - s(i-W);
end
  댓글 수: 5
Iram Shahzadi
Iram Shahzadi 2018년 9월 25일
Thank you @Adam for your kind reply
Adam Danz
Adam Danz 2018년 9월 25일
Glad I could help.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by