butterworth 필터 적용시 신호 발산
Afficher commentaires plus anciens
X = data_signal;
Fs = 32768; %data_signal의 sampling 주파수
n = 6; %butterworth 필터 차수
wn = 5; %cut off frequency
Fn = Fs/2; %Nyquist 주파수
[b, a] = butter(n,wn/Fn, 'high');
y = fillter(b,a,X);
이렇게 코드를 실행하여 계측기를 통해 측정한 data_signal의 5Hz 미만의 성분을 필터링하고 싶은데
막상 코드를 실행하여 얻은 y데이터가 발산하며 매우 커져 None값이 나옵니다
Réponses (1)
I am not certain what you are asking.
Fs = 32768; %data_signal의 sampling 주파수
n = 6; %butterworth 필터 차수
wn = 5; %cut off frequency
Fn = Fs/2; %Nyquist 주파수
[b, a] = butter(n,wn/Fn, 'high');
figure
freqz(b, a, 2^16, Fs)
set(subplot(2,1,1), 'XLim',[0 0.05])
set(subplot(2,1,2), 'XLim',[0 0.05])
The filter is unstable. That is a frequent problem with transfer function realisation of discrete filters.
Try this instead —
[z,p,k] = butter(n,wn/Fn, 'high');
[sos,g] = zp2sos(z,p,k);
figure
freqz(sos, 2^16, Fs)
set(subplot(2,1,1), 'XLim',[0 0.05])
set(subplot(2,1,2), 'XLim',[0 0.05])
y = filtfilt(sos, g, X);
That should work.
.
Catégories
En savoir plus sur Butterworth dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

