주요 콘텐츠

diric

디리클레(Dirichlet) 함수 또는 주기적 sinc 함수

설명

y = diric(x,n)은 입력 배열 x의 요소에서 계산된 차수 n디리클레 함수(Dirichlet Function)를 반환합니다.

예제

예제

모두 축소

N = 7인 경우와 N = 8인 경우에 대해 -2π~2π 범위의 디리클레 함수를 계산하고 플로팅합니다. 함수의 주기는 N이 홀수인 경우 2π이고, N이 짝수인 경우 4π입니다.

x = linspace(-2*pi,2*pi,301);

d7 = diric(x,7);
d8 = diric(x,8);

subplot(2,1,1)
plot(x/pi,d7)
ylabel('N = 7')
title('Dirichlet Function')

subplot(2,1,2)
plot(x/pi,d8)
ylabel('N = 8')
xlabel('x / \pi')

Figure contains 2 axes objects. Axes object 1 with title Dirichlet Function, ylabel N = 7 contains an object of type line. Axes object 2 with xlabel x / \pi, ylabel N = 8 contains an object of type line.

디리클레 함수와 sinc 함수는 DN(πx)=sinc(Nx/2)/sinc(x/2)의 관계식을 가집니다. N=6일 때의 이 관계를 표시합니다. sinc 함수의 비율을 x=2k(여기서 k는 정수임)인 경우 (-1)k(N-1)로 지정하여 부정형(indeterminate) 표현식을 방지합니다.

xmax = 4;
x = linspace(-xmax,xmax,1001)';

N = 6;

yd = diric(x*pi,N);
ys = sinc(N*x/2)./sinc(x/2);
ys(~mod(x,2)) = (-1).^(x(~mod(x,2))/2*(N-1));

subplot(2,1,1)
plot(x,yd)
title('D_6(x*pi)')
subplot(2,1,2)
plot(x,ys)
title('sinc(6*x/2) / sinc(x/2)')

Figure contains 2 axes objects. Axes object 1 with title D indexOf 6 baseline (x*pi) contains an object of type line. Axes object 2 with title sinc(6*x/2) / sinc(x/2) contains an object of type line.

N=13에 대해 계산을 반복합니다.

N = 13;

yd = diric(x*pi,N);
ys = sinc(N*x/2)./sinc(x/2);
ys(~mod(x,2)) = (-1).^(x(~mod(x,2))/2*(N-1));

subplot(2,1,1)
plot(x,yd)
title('D_{13}(x*pi)')
subplot(2,1,2)
plot(x,ys)
title('sinc(13*x/2) / sinc(x/2)')

Figure contains 2 axes objects. Axes object 1 with title D indexOf 13 baseline (x*pi) contains an object of type line. Axes object 2 with title sinc(13*x/2) / sinc(x/2) contains an object of type line.

입력 인수

모두 축소

입력 배열로, 실수형 스칼라, 벡터, 행렬 또는 N차원 배열로 지정됩니다. x가 비 스칼라이면 diric는 요소별 연산을 하게 됩니다.

데이터형: double | single

함수 차수로, 양의 정수 스칼라로 지정됩니다.

데이터형: double | single

출력 인수

모두 축소

출력 배열로, x와 같은 크기를 가지며 실수 값을 갖는 스칼라, 벡터, 행렬 또는 N차원 배열로 반환됩니다.

세부 정보

모두 축소

확장 기능

모두 확장

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

버전 내역

R2006a 이전에 개발됨

참고 항목

| | | | | | | |