# sinc

Normalized sinc function

## Syntax

``sinc(x)``

## Description

example

````sinc(x)` returns `sin(pi*x)/(pi*x)`. The symbolic `sinc` function does not implement floating-point results, only symbolic results. Floating-point results are returned by the `sinc` function in Signal Processing Toolbox™.```

## Examples

collapse all

Create a `sinc` function of a symbolic variable `x`.

```syms x sinc(x)```
```ans =  $\frac{\mathrm{sin}\left(\pi x\right)}{x \pi }$```

Show that `sinc` returns `1` at `0`, `0` at other integer inputs, and exact symbolic values for other inputs.

```V = sym([-1 0 1 3/2]); S = sinc(V)```
```S =  $\left(\begin{array}{cccc}0& 1& 0& -\frac{2}{3 \pi }\end{array}\right)$```

Convert the exact symbolic output to high-precision floating point by using `vpa`.

`vpa(S)`
`ans = $\left(\begin{array}{cccc}0& 1.0& 0& -0.21220659078919378102517835116335\end{array}\right)$`

Although `sinc` can appear in tables of Fourier transforms, `fourier` does not return `sinc` in output.

Show that `fourier` transforms a pulse in terms of `sin` and `cos`.

```syms x fourier(rectangularPulse(x))```
```ans =  $\frac{\mathrm{sin}\left(\frac{w}{2}\right)+\mathrm{cos}\left(\frac{w}{2}\right) \mathrm{i}}{w}-\frac{-\mathrm{sin}\left(\frac{w}{2}\right)+\mathrm{cos}\left(\frac{w}{2}\right) \mathrm{i}}{w}$```

Show that `fourier` transforms `sinc` in terms of `heaviside`.

`fourier(sinc(x))`
```ans =  $\frac{\pi \mathrm{heaviside}\left(\pi -w\right)-\pi \mathrm{heaviside}\left(-w-\pi \right)}{\pi }$```

Plot the sinc function by using `fplot`.

```syms x fplot(sinc(x))```

Rewrite the `sinc` function to the exponential function `exp` by using `rewrite`.

```syms x rewrite(sinc(x),'exp')```
```ans =  $\frac{\frac{{\mathrm{e}}^{-\pi x \mathrm{i}} \mathrm{i}}{2}-\frac{{\mathrm{e}}^{\pi x \mathrm{i}} \mathrm{i}}{2}}{x \pi }$```

Differentiate, integrate, and expand `sinc` by using the `diff`, `int`, and `taylor` functions, respectively.

Differentiate `sinc`.

```syms x diff(sinc(x))```
```ans =  $\frac{\mathrm{cos}\left(\pi x\right)}{x}-\frac{\mathrm{sin}\left(\pi x\right)}{{x}^{2} \pi }$```

Integrate `sinc` from `-Inf` to `Inf`.

`int(sinc(x),[-Inf Inf])`
`ans = $1$`

Integrate `sinc` from `-Inf` to `x`.

`int(sinc(x),-Inf,x)`
```ans =  $\frac{\mathrm{sinint}\left(\pi x\right)}{\pi }+\frac{1}{2}$```

Find the Taylor expansion of `sinc`.

`taylor(sinc(x))`
```ans =  $\frac{{\pi }^{4} {x}^{4}}{120}-\frac{{\pi }^{2} {x}^{2}}{6}+1$```

Prove an identity by defining the identity as a condition and using the `isAlways` function to check the condition.

Prove the identity $\mathrm{sinc}\left(\mathit{x}\right)=\frac{1}{\Gamma \left(1+\mathit{x}\right)\text{\hspace{0.17em}}\Gamma \left(1-\mathit{x}\right)}$.

```syms x cond = sinc(x) == 1/(gamma(1+x)*gamma(1-x)); isAlways(cond)```
```ans = logical 1 ```

## Input Arguments

collapse all

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

## Version History

Introduced in R2018b