Should sinc() be Implemented with sinpi()?

2 views (last 30 days)
Here are the relevant lines that implement sinc
dbtype sinc.m 24:27
24 i=find(x==0); 25 x(i)= 1; % From LS: don't need this is /0 warning is off 26 y = sin(pi*x)./(pi*x); 27 y(i) = 1;
Should line 26 now be implemented with sinpi?
If concerned with changing results of existing code, perhaps an optional input to specify implementation in terms of sinpi instead of sin?

Accepted Answer

Ganesh Thambhahalli Satyen
Edited: Ganesh Thambhahalli Satyen on 25 Jan 2023
Hey Paul,
From your question, I understand that you are requesting for an enhancement in the sinc function to have the following:
  1. The existing sinc function code should replace sin(pi*x) with sinpi(x).
  2. An optional input should be introduced for specifying whether the sinc computation is using sin or sinpi.
If so, I would like to let you know that an enhancement request about considering converting "sinc" to use sinpi for better accuracy has been submitted to our developers.
Thank you for your feedback.
  1 Comment
Paul
Paul on 3 Feb 2023
Thanks for the response. matlabFunction is another candidate for consideration
syms x
matlabFunction(sin(2*sym(pi)*x))
ans = function_handle with value:
@(x)sin(x.*pi.*2.0)

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!