Engee documentation

diric

Dirichlet function or periodic function of the cardinal sine.

Library

EngeeDSP

Syntax

Function call

  • y = diric(x, n) — returns the values of the Dirichlet function of degree n calculated for the elements of the input array x.

Arguments

Input arguments

# x — input data

+ scalar | vector | the matrix

Details

Input data specified as a real scalar, vector, or matrix. If x if not a scalar, then diric Applies to each element.

Data types

Float32, Float64

# n is the degree of the function

+ scalar

Details

The degree of the function, given as a positive integer scalar.

Data types

Float32, Float64

Output arguments

# y — output data

+ scalar | vector | the matrix

Details

Output data returned as a real scalar, vector, or matrix of the same dimension as x.

Data types

Float32, Float64

Examples

Dirichlet function

Details

We calculate and plot the graph of the Dirichlet function between and for and . The function has a period for odd and for even numbers .

import EngeeDSP.Functions: diric

x = range(-2π, 2π, length=301)

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

plot(layout = (2, 1))

plot!(x/π, d7, subplot = 1)
ylabel!("N = 7", subplot = 1)
title!("Dirichlet Function", subplot = 1)

plot!(x/π, d8, subplot = 2)
ylabel!("N = 8", subplot = 2)
xlabel!("x / π", subplot = 2)

diric 1

Additional information

Dirichlet function

Details

Dirichlet function, or periodic function of the cardinal sine sinc, is defined as:

for any nonzero integer .

This function has a period for odd and period for even numbers . Its maximum value is 1 for everyone , and the minimum −1 for even numbers . The modulus of the function is equal to the product and the discrete Fourier transform module -point rectangular window.