Hello, I am trying to use a bandpass IIR filter to filter by EEG data which is collected at a sampling rate of 1000. I am using the following code to do it, bpfilter = designfilt('bandpassiir', 'StopbandFrequency1',5,'PassbandFrequency1', 8, 'PassbandFrequency2', 35,'StopbandFrequency2', 40, 'StopbandAttenuation1', 60, 'PassbandRipple', 1, 'StopbandAttenuation2', 60, 'SampleRate', 1000);
But after filtering and plotting the spectrum I am getting a straight line parallel to the x-axis and zero amplitude. Whereas when I used FIR, I obtained a good spectrum. It is just that since my amplitudes matter hence I don't want to use an FIR filter due to its undulations in bandpass frequencies.

 채택된 답변

Star Strider
Star Strider 2018년 8월 4일

0 개 추천

I would normally suggest using the filtfilt function, however the filters returned by designfilt appear to be more appropriate to the filter function (as the documentation recommends). That appeared to work well when I used it with a signal I synthesized to test it.
Try this:
FilteredEKG = filter(bpfilter, EKG);
with appropriate changes to use your variables.

댓글 수: 2

Ankit Roy
Ankit Roy 2018년 8월 7일
Thank You Star Strider for the answer. Actually it turned out that I was doing something silly elsewhere. Otherwise it is fine.
Star Strider
Star Strider 2018년 8월 7일
As always, my pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

질문:

2018년 8월 4일

댓글:

2018년 8월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by