Sinus Cardinal and Hyperbolic Sinus Cardinal Functions
Source:R/sinus_cardinal_hyperbolic_functions.R
sinus_cardinal_hyperbolic_functions.RdFunctions to compute the sinus cardinal (sinc) and hyperbolic sinus cardinal (sinhc) functions.
These functions appear in signal processing, Fourier analysis, and various mathematical applications. The implementations avoid numerical instability near x = 0.
Sinus Cardinal Function:
The sinc function is defined as: $$sinc(\pi x) = \frac{\sin(\pi x)}{\pi x}$$
sinc_pi(x): Computes sinc(pix) = sin(pix)/(pix)Special value: sinc_pi(0) = 1 (by L'Hopital's rule or Taylor series)
The function oscillates with decreasing amplitude as |x| increases
Used extensively in signal processing (ideal low-pass filter impulse response)
Appears in the Whittaker-Shannon interpolation formula
Hyperbolic Sinus Cardinal Function:
The hyperbolic sinc function is defined as: $$sinhc(\pi x) = \frac{\sinh(\pi x)}{\pi x}$$
sinhc_pi(x): Computes sinhc(pix) = sinh(pix)/(pix)Special value: sinhc_pi(0) = 1 (by L'Hopital's rule or Taylor series)
The function grows exponentially for large |x|
Analogous to sinc but using hyperbolic sine instead of circular sine
Numerical Stability:
Both functions use Taylor series expansions near x = 0 to avoid division by zero and loss of precision. For x away from 0, direct evaluation is used.
Value
A single numeric value with the computed sinus cardinal or hyperbolic sinus cardinal function.
See also
Boost Documentation for more details on the mathematical background.