Info

This question is closed. Reopen it to edit or answer.

How do I determine what cutoff frequencies to use in a bandpass butterworth filter?

1 view (last 30 days)
I'm trying add two sine waves of different frequencies together and then use a butterworth filter to separate them again. I'm having trouble figuring out what to set the high and low cutoff to. Here is the code I've been playing with.
x = 0:.1:40*pi;
subplot(3,1,1)
plot(x, sin(x));
ylim([-2 2])
wave = sin(x) + 2*cos(x/3);
subplot(3,1,2)
plot(x, wave);
[c d] = butter(5, [.02 .05]);
y2 = filtfilt(c, d, wave);
subplot(3,1,3)
plot(x, y2);
If I just wanted to get the normal sine wave wouldn't the frequency be 0.1/(2*pi) or ~0.016? After manually trying values for the cutoff, I found that 0.02 and 0.05 gives me what I want. But 0.016 is outside of that range.
What am I doing wrong?

Answers (0)

Community Treasure Hunt

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

Start Hunting!