Bandpass Filter Not Filtering Signal
Show older comments
Hi, I've currently designed a bandpass filter to filter a signal between 1 and 30 Hz, but when plotting it, my signal still has a random spike at 60 Hz when plotted through an absolute value squared fft, despite the filter properly being set up to cap at 30.
My code is as follows:
y = data;
data2 = double(y);
fs = 2000
samples = length(y);
yfilt = bandpass(data2, [1,30], fs);
y1 = fft(data2);
power1 = abs(y1).^2/samples;
y5 = fft(yfilt);
power5 = abs(y5).^2/samples;
which results in this large spike for the filtered data

can anyone explain what's causing this?
1 Comment
Mathieu NOE
on 20 Apr 2023
can you share your data ?
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Signal Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


