Learn R Programming

phonTools (version 0.2-2.2)

sinc: Sinc Function

Description

Sample the sinc function at given points

Usage

sinc (x, normalized = FALSE)

Value

A vector containing y-axis values for each specified x-axis value is returned.

Arguments

x

A vector of x-axis points at which the sinc function will be sampled.

normalized

If TRUE, a normalized sinc function is returned.

Author

Santiago Barreda <sbarreda@ucdavis.edu>

Details

The formula for the unnormalized sinc function is y = sin(x)/x.

The formula for the normalized sinc function is y = sin(x*pi)/(x*pi).

References

http://en.wikipedia.org/wiki/Sinc_function

Lyons, R. G. (2004). Understanding Digital Signal Processing (2nd ed.). Prentice Hall.

Examples

Run this code
#x = seq(-20,20,.1)
## generate both forms of the sinc function between -20 and 20
#y1 = sinc (x)
#y2 = sinc (x, normalized = TRUE)
## the unnormalized sinc function has zero crossing at 
## integer multiples of pi
#plot (x,y1, type = 'b')
## the normalized sinc function has zero crossing at integers
#lines (x,y2, type = 'b', col = 4)
#abline (h = 0)

Run the code above in your browser using DataLab