Hello everyone,

I was wondering if anyone could give me their insight to this problem.

I am trying to understand how to use a bandpass filter in butter to pass only a
certain band of frequency.

This works for a simple cosine with one frequency, but with a summation of
cosines..

dt=.001; %sampling rate

Fs=1/dt; %sampling freq

HalfFs=Fs/2;

t=-10:dt:10;

m=cos(2*pi*49*t)+cos(2*pi*50*t);

[b,a]=butter(4,[48 51]/HalfFs);

y=filter(b,a,m);

subplot(121),plot(t,m),title('original message'),axis([-.1,.6,-5,5])

subplot(122),plot(t,y),title('filtered message'),axis([-.1,.6,-5,5])

The output signal should be the same, right? Or is this due to some sort of
transient response? It looks like just a change in delay. Any insight would be
much appreciated. Thanks!

# Simple butter filtering question!

Started by ●April 1, 2008