Designing a bandpass filter
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
How do i design a bandpass filter that is used to eliminate the low and high frequency noises of an eeg signal with a cut off frequency of 0.1- 25 Hz
채택된 답변
Star Strider
2020년 10월 25일
0 개 추천
댓글 수: 10
Temisanren Okotie
2020년 10월 26일
Thank you.
Star Strider
2020년 10월 26일
As always, my pleasure!
Filters are straightforward to design using more basic functions in MATLAB, however for a single signal and a single filter run, the bandpass and related functions are easiest. If you intend to filter more signals, request the second output of bandpass (the digital filter object) and use it with other signals and the filtfilt function to do this most efficiently, otherwise bandpass re-designs the filter each time, and that is both inefficient and slow.
Temisanren Okotie
2020년 10월 26일
Thank you very much!
load Subject00_before_fp1.mat;
fs = 500;
N = length(Subject00_before_fp1);
N2 = 12000;
t = (1:N)/fs;
subplot(2,1,1);
plot(t,Subject00_before_fp1);
fc = [0.1 25]/fs/2;
y = bandpass(Subject00_before_fp1,[0.1 25],fs);
subplot(2,1,2);
plot(t,y,'k');
figure;
P = nextpow2(12000);
n = 2^P;
X = fft(y(1:N2),n);
X_mag = abs(X);
X_power = (abs(X).^2)/N;
f = (0:N-1)*fs/N;
plot(f(1:N2),20*log10(X_power(1:N2)),'k');
I am trying to plot the PSD using fft function. The value of N is 91000 which is quite large and Matlab wasn't able to process it. I used the first 12000 samples. The result i get after plotting the PSD is still quite noisy. I don't know if my code is right. I'm new to Matlab
Star Strider
2020년 10월 26일
This worked when I tried it (increasing the lower passband frequency to 0.5 Hz):
fs = 500;
Subject00_before_fp1 = randn(91000,1);
N = length(Subject00_before_fp1);
t = (1:N)/fs;
[y,df] = bandpass(Subject00_before_fp1,[0.5 25],fs);
figure
subplot(2,1,1)
plot(t,Subject00_before_fp1)
grid
subplot(2,1,2)
plot(t,y)
grid
This designs a very long (23093) FIR filter, according to the ‘df’ object I requested so that I could see what bandpass was designing. The original filter designed an
order elliptic filter (the sort I would design myself) however the extremely low lower passband of 0.1 Hz is a nearly impossible task for any filter, even with a sampling frequency of 500 Hz.
Temisanren Okotie
2020년 10월 26일
I took your suggestion and made the changes but the PSD plot still looks thesame, maybe that part of the code is wrong? I attached a copy of the signal and the picture of the graphs I got if that would help. Thank you very much.
Star Strider
2020년 10월 26일
It appears to be the PSD of an appropriately-filtered signal.
What were you expecting?
Temisanren Okotie
2020년 10월 26일
This is the paper I'm basing my work on, the PSD graphs look quite different.
Star Strider
2020년 10월 26일
They actually do not look much different.
Use:
xlim[0 25])
with your plot and they should look reasonably similar to those in the paper.
Please do not expect to reproduce the results in any specific paper exactly. There are simply too many considerations involved, specifically the filter the paper uses and its characteristics, such as transition-region width, filter type (Butterworth, elliptic, FIR, none of which I can find stated in the paper) or other details. Frequently, ‘close enough is good enough’.
Temisanren Okotie
2020년 10월 26일
Thank you for your help, using the limits narrowed it down. I think I'll reduce the number of samples to make t cleaner. Thanks again.
Star Strider
2020년 10월 26일
As always, my pleasure!
I definitely wish you success with your workload studies! I was involved in stress responses to workload variations decades ago.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
