Clear Filters
Clear Filters

Trying to add Butterworth filter after fft to obtain only some of the original signal.

5 views (last 30 days)
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);

Accepted Answer

Paul
Paul on 19 Apr 2024
Edited: Paul on 19 Apr 2024
Hi Alejandro,
The input to filter should be the time domain sequence to be filtered, not its Fourier transform.
So I guess that should be
amp_sum_filtered = filter(b,a,amp_sum);

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!