diric
Dirichlet function or periodic function of the cardinal sine.
| Library |
|
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 |
|
# n is the degree of the function
+
scalar
Details
The degree of the function, given as a positive integer scalar.
| Data types |
|
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)

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.