Trying to add Butterworth filter after fft to obtain only some of the original signal.
5 views (last 30 days)
Show older comments
Hello, I have a group of signals that I've added together and done the FFT. Now I'm trying to add a Butterworth low pass filter to only obtain the first three signals with a cutoff of 74 Hz. However, I'm not sure how to add this filter. I included the butter function but it didn't provide the correct graph.
sample_rate = 4e6;
duration = 1.5;
t = linspace(0,duration,sample_rate*duration);
amp_sum = amp_1 + amp_2 + amp_3 + amp_4 + amp_5 + amp_6 + amp_7 + amp_8;
Y = fft(amp_sum);
L = length(amp_sum);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = sample_rate*(0:(L/2))/L;
[b, a] = butter(2, 74/(sample_rate/2), 'low'); %Cutoff frequency of 74 to only obtain the first three signals
P = filter(b, a, P1);
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!