Filtering a matrix column with different cutoff
이전 댓글 표시
I’ ve looking for a method to filter each column of data (101X62) with specific cutoff (1X63). Please, could someone indicate me the problem? Thanks B
x=data
fs=60;
fc=cutoff;
for idx = 1:numel(x);
[b,a] = butter(2, fc/(fs/2));
y = filter(b,a,x); %// output
end
댓글 수: 3
Ced
2016년 3월 26일
currently you are looping over each element of x instead of each column, i.e. you want
Ncols = size(data,2);
for idx = 1:Ncols
% filter next column
end
Also, Xnew does not seem to be defined, and you would of course need to change the cutoff frequency in each loop iteration (right now, it's constant). But your general structure looks ok to me otherwise. What seems to be the problem?
Bruno
2016년 3월 26일
Ced
2016년 3월 26일
Yes, but since you are designing your filter in the loop, you can select a different cutoff for each loop iteration, right? Have a look at Image Analyst's answer, he wrote it out for you. You of course still have to define your cutoff vector.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Butterworth에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!