フィルタの周波数特性についてはまだ不安なので、
以下のようなコードでもう一度確認した.
おそらくこれで確認できていると思う。
% Sampling freq. 10 Hz
t = 0:0.1:10; % Sampling freq. 10 Hz
x = sin(t * 3.0 * 2 * pi) + sin(t * 1.0 * 2 * pi);
figure(1);
subplot(2, 1, 1);
[b, a] = butter(2, 0.4);
[h, w] = freqz(b,a, 201);
plot(w/pi * 10/2,abs(h));
filt_x = filter(b, a, x);
hold on;
[b, a] = butter(4, 0.4);
[h, w] = freqz(b,a, 201);
plot(w/pi * 10/2,abs(h), 'color', 'red', 'linewidth', 2);
filt_x2 = filter(b, a, x);
[b, a] = butter(6, 0.4);
[h, w] = freqz(b,a, 201);
plot(w/pi * 10/2,abs(h), 'color', [0.7, 0.5, 0], 'linewidth', 3);
filt_x3 = filter(b, a, x);
ylim([0 1.2]);
xlabel('Frequency Hz');
hold off;
subplot(2, 1, 2);
plot(t, filt_x, 'linewidth', 2,...
t, filt_x2, 'linewidth', 3, 'color', 'red', ...
t, filt_x3, 'linewidth', 4, 'color', [0.7, 0.5, 0],...
t, x);
xlim([4 8]);
xlabel('Time');