MATLAB Answers

Moving window in time domain

1 view (last 30 days)
ecartman22 on 19 Jul 2021
Commented: ecartman22 on 20 Jul 2021
I have a 3D matrix X*Y*T and I would like to apply a bandpass filter in the 3rd dimension. Instead of doing it on the complete series at once, I would like to have a window of size n for example (X,Y,1:n) on which I filter and then move to the next window (X,Y,n+1:2n) and so on. What is the most efficient way of doing this?

Answers (1)

Image Analyst
Image Analyst on 19 Jul 2021
Edited: Image Analyst on 19 Jul 2021
The convn() function.
n = 3;
kernel = repmat(1, 1, 1, n) / n;
smoothedImage = convn(image3d, kernel, 'same');
ecartman22 on 20 Jul 2021
Thanks a lot! This is averaging over a window. How could I change the kernel so it bandpass filters the window in the time domain?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by