Can I smooth 1D data taken from pages of 3D array without using for loops?

조회 수: 1 (최근 30일)
Ben C
Ben C 2014년 2월 4일
댓글: Ben C 2014년 2월 5일
I am looking to take a 3D array (~1000x1000x18) and take the vector along each page at each x,y point [e.g. (1,1,:); (1,2,:) etc.] and smooth or fit it to find the max value at each point. Each of the vectors are noisy cosine squared and I want to be able to get a true max at each value. Right now the noise is such that max(X,[],3) gives a different result than I want. So I want to smooth or fit each vector of data to get a better max of each vector out.
I can think of a brute force way to do that using for loops to pull each vector out one at a time but was wondering if this a nicer way.
  댓글 수: 1
Matt J
Matt J 2014년 2월 4일
Do the cosines have different peak locations, or just different amplitudes?

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

채택된 답변

Matt J
Matt J 2014년 2월 4일
You could apply a 1D convolution along the 3rd dimension as follows,
kernel=reshape(kernel,1,1,[]);
convn(yourarray,kernel,'same')
  댓글 수: 2
Matt J
Matt J 2014년 2월 4일
FFT low pass filtering processing might be even better, since your square cosine is highly bandlimited
F=fft(yourarray,[],3).*lowpass_mask;
f=ifft(F,[],3);
result = max(f,[],3);
Ben C
Ben C 2014년 2월 5일
Ok, that looks promising, thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by