Main Content

sosfilt

2차(바이쿼드) IIR 디지털 필터링

설명

예제

y = sosfilt(sos,x)는 2차섹션형(SOS) 디지털 필터 sos를 입력 신호 x에 적용합니다.

  • x가 행렬인 경우 함수는 첫 번째 차원을 따라 연산을 수행하고 각 열에 대해 필터링된 데이터를 반환합니다.

  • x가 다차원 배열인 경우 함수는 크기가 1보다 큰 첫 번째 배열 차원을 따라 연산을 수행합니다.

y = sosfilt(sos,x,dim)은 차원 dim을 따라 동작합니다.

예제

모두 축소

chirp.mat를 불러옵니다. 이 파일에는 전력의 대부분이 Fs/4, 즉 나이퀴스트 주파수의 절반보다 큰 영역에 존재하는 신호 y가 포함되어 있습니다. 샘플 레이트는 8192Hz입니다.

load chirp

t = (0:length(y)-1)/Fs;

Fs/4 미만인 신호 성분을 감쇠하는 7차 버터워스 고역통과 필터를 설계합니다. 0.48π rad/sample의 정규화된 차단 주파수를 사용합니다. 2차섹션형(SOS)으로 필터 계수를 표현합니다.

[zhi,phi,khi] = butter(7,0.48,'high');
soshi = zp2sos(zhi,phi,khi);

freqz(soshi)

Figure contains 2 axes objects. Axes object 1 with title Phase, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Phase (degrees) contains an object of type line. Axes object 2 with title Magnitude, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Magnitude (dB) contains an object of type line.

신호에 필터를 적용합니다. 원래 신호와 고역통과 필터가 적용된 신호를 표시합니다. 두 플롯 모두에 동일한 y축 스케일을 사용합니다.

outhi = sosfilt(soshi,y);

figure
subplot(2,1,1)
plot(t,y)
title('Original Signal')
ys = ylim;

subplot(2,1,2)
plot(t,outhi)
title('Highpass-Filtered Signal')
xlabel('Time (s)')
ylim(ys)

Figure contains 2 axes objects. Axes object 1 with title Original Signal contains an object of type line. Axes object 2 with title Highpass-Filtered Signal, xlabel Time (s) contains an object of type line.

동일한 사양을 갖는 저역통과 필터를 설계합니다. 신호에 필터를 적용하고 그 결과를 원래 신호와 비교합니다. 두 플롯 모두에 동일한 y축 스케일을 사용합니다. 결과는 대부분 잡음입니다.

[zlo,plo,klo] = butter(7,0.48);
soslo = zp2sos(zlo,plo,klo);

outlo = sosfilt(soslo,y);

subplot(2,1,1)
plot(t,y)
title('Original Signal')
ys = ylim;

subplot(2,1,2)
plot(t,outlo)
title('Lowpass-Filtered Signal')
xlabel('Time (s)')
ylim(ys)

Figure contains 2 axes objects. Axes object 1 with title Original Signal contains an object of type line. Axes object 2 with title Lowpass-Filtered Signal, xlabel Time (s) contains an object of type line.

입력 인수

모두 축소

2차섹션형(SOS) 디지털 필터로, L×6 행렬로 지정됩니다. 여기서 L은 2차섹션형(SOS)의 개수입니다. 다음 행렬은

sos=[b01b11b211a11a21b02b12b221a12a22b0Lb1Lb2L1a1La2L]

다음과 같은 2차섹션형(SOS) 디지털 필터를 나타냅니다.

H(z)=k=1LHk(z)=k=1Lb0k+b1kz1+b2kz21+a1kz1+a2kz2.

예: [b,a] = butter(3,1/32); sos = tf2sos(b,a)는 π/32 rad/sample의 정규화된 3dB 주파수를 갖는 3차 버터워스 필터를 지정합니다.

데이터형: single | double

입력 신호로, 벡터, 행렬 또는 N차원 배열로 지정됩니다.

예: x = [2 1].*sin(2*pi*(0:127)'./[16 64])는 2채널 정현파를 지정합니다.

데이터형: single | double
복소수 지원 여부:

연산을 수행할 차원으로, 양의 정수 스칼라로 지정됩니다. 기본적으로 이 함수는 크기가 1보다 큰 x의 첫 번째 배열 차원을 따라 연산을 수행합니다.

데이터형: single | double

출력 인수

모두 축소

필터링된 신호로, 벡터, 행렬 또는 N차원 배열로 반환됩니다. yx와 크기가 같습니다.

참고 문헌

[1] Bank, Balázs. "Converting Infinite Impulse Response Filters to Parallel Form". IEEE Signal Processing Magazine. Vol. 35, Number 3, May 2018, pp. 124-130.

[2] Orfanidis, Sophocles J. Introduction to Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, 1996.

확장 기능

C/C++ 코드 생성
MATLAB® Coder™를 사용하여 C 코드나 C++ 코드를 생성할 수 있습니다.

버전 내역

R2006a 이전에 개발됨

참고 항목

| |