Thursday, 16 August 2018

trigonometry - Calculating value of $text{sinc}(x)$, WolframAlpha and MATLAB give two different answers.




I need to evaluate the following:
$$\frac{2}{3}\text{sinc}\bigg(\frac{2\pi}{3}(n-4)\bigg)-\frac{1}{3}\text{sinc}\bigg(\frac{\pi}{3}(n-4)\bigg)$$



for $n=[0,...,8]$



I don't have the sinc function in my casio fx so I wanted to use the fact that $\text{sinc}(x)=\frac{\text{sin}(x)}{x}$ and that $\text{sinc}(0)=1$
Hence, for $n=0$ I got
$$\frac{2}{3}\text{sinc}\bigg(\frac{2\pi}{3}(-4)\bigg)-\frac{1}{3}\text{sinc}\bigg(\frac{\pi}{3}(-4)\bigg)=0.1378....$$



This seems to agree with wolfram alpha:







enter image description here






But then I checked the mark scheme on my past paper that the question is taken from, and there it says that I should've got $0.0093$ so i put it in MATLAB:







enter image description here






...and it also says $0.0093$.



So... which one of the two is correct? What's going on?


Answer



As it happens, there are apparently two different conventions for what the $\text{sinc}(x)$ function actually denotes in terms of the $\sin(x)$ function. (I ran into this same confusion on my class on Fourier analysis.) The conventions you might see are




$$\text{sinc}(x) = \frac{\sin(x)}{x} \;\;\; \text{or} \;\;\; \text{sinc}(x) = \frac{\sin(\pi x)}{\pi x}$$



The latter is known as the "normalized sinc function," per Wikipedia. I don't know much about which is used more when, so I'll leave you with the Wikipedia article in that respect.



Checking your functions if interpreted in the latter way, i.e. for $n=0$



$$\frac{2}{3} \left( \frac{-3}{8\pi^2} \right) \sin \bigg(\frac{-8\pi^2}{3}\bigg)-\frac{1}{3} \left( \frac{-3}{4\pi^2} \right) \sin \bigg(\frac{-4\pi^2}{3}\bigg)$$



Wolfram Alpha gives a value of $0.0093...$, in agreement with your MATLAB answer. Indeed, as noted by Josh B. in the comments, MATLAB uses the latter convention.




I would assume, then, this is the source of the discrepancy.


No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...