Thread Subject:
find zero values of sinc

Subject: find zero values of sinc

From: David

Date: 18 Dec, 2008 22:02:02

Message: 1 of 7

hi all:

i want to find the zero values of sinc, where sinc = sin(pi*x)./(pi*x)

x = -5.5:0.1:5.5;
sinc = sin(pi*x)./(pi*x);
plot(x, sinc)


you can clearly see the zero crossings, but find(sinc == 0) is null (i think) because i've discretized a continuous function, and none of the values are exactly zero.

then i tried to convert sinc into a continuous function: mysinc = @(x)sin(pi*x)./(pi*x)
(don't ask me why i didn't type mysinc = 'sin(pi*x)./(pi*x)'; instead, because i learn by example)

this is where i get stuck. matlab seems to have good ways to find the roots of polynomials, but this function is not a polynomial. do i need to convert it into a polynomial form using euler relations or something ?


Thanks!

Subject: find zero values of sinc

From: Adam

Date: 18 Dec, 2008 22:13:03

Message: 2 of 7

"David " <REMOVEdavidg@UPPERCASEphy.LETTERSucsf.edu> wrote in message <gieh8q$1g6$1@fred.mathworks.com>...
> hi all:
>
> i want to find the zero values of sinc, where sinc = sin(pi*x)./(pi*x)
>
> x = -5.5:0.1:5.5;
> sinc = sin(pi*x)./(pi*x);
> plot(x, sinc)
>
>
> you can clearly see the zero crossings, but find(sinc == 0) is null (i think) because i've discretized a continuous function, and none of the values are exactly zero.
>
> then i tried to convert sinc into a continuous function: mysinc = @(x)sin(pi*x)./(pi*x)
> (don't ask me why i didn't type mysinc = 'sin(pi*x)./(pi*x)'; instead, because i learn by example)
>
> this is where i get stuck. matlab seems to have good ways to find the roots of polynomials, but this function is not a polynomial. do i need to convert it into a polynomial form using euler relations or something ?
>
>
> Thanks!
 
You're not likely to ever get exact zeros. They're probably off by a couple eps().

Sinc() is a built-in function. You should probably use a different variable name.

Look for zero crossings?
idx = find(diff(sign(sinc)));
x(ans)

~Adam

Subject: Thanks Re: find zero values of sinc

From: David

Date: 18 Dec, 2008 23:43:03

Message: 3 of 7

ahh smart

thanks!

"Adam" <not.real@email.com> wrote in message <giehtf$ct1$1@fred.mathworks.com>...
> "David " <REMOVEdavidg@UPPERCASEphy.LETTERSucsf.edu> wrote in message <gieh8q$1g6$1@fred.mathworks.com>...
> > hi all:
> >
> > i want to find the zero values of sinc, where sinc = sin(pi*x)./(pi*x)
> >
> > x = -5.5:0.1:5.5;
> > sinc = sin(pi*x)./(pi*x);
> > plot(x, sinc)
> >
> >
> > you can clearly see the zero crossings, but find(sinc == 0) is null (i think) because i've discretized a continuous function, and none of the values are exactly zero.
> >
> > then i tried to convert sinc into a continuous function: mysinc = @(x)sin(pi*x)./(pi*x)
> > (don't ask me why i didn't type mysinc = 'sin(pi*x)./(pi*x)'; instead, because i learn by example)
> >
> > this is where i get stuck. matlab seems to have good ways to find the roots of polynomials, but this function is not a polynomial. do i need to convert it into a polynomial form using euler relations or something ?
> >
> >
> > Thanks!
>
> You're not likely to ever get exact zeros. They're probably off by a couple eps().
>
> Sinc() is a built-in function. You should probably use a different variable name.
>
> Look for zero crossings?
> idx = find(diff(sign(sinc)));
> x(ans)
>
> ~Adam

Subject: find zero values of sinc

From: Roger Stafford

Date: 19 Dec, 2008 00:58:02

Message: 4 of 7

"David " <REMOVEdavidg@UPPERCASEphy.LETTERSucsf.edu> wrote in message <gieh8q$1g6$1@fred.mathworks.com>...
> hi all:
>
> i want to find the zero values of sinc, where sinc = sin(pi*x)./(pi*x)
>
> x = -5.5:0.1:5.5;
> sinc = sin(pi*x)./(pi*x);
> plot(x, sinc)
>
> you can clearly see the zero crossings, but find(sinc == 0) is null (i think) because i've discretized a continuous function, and none of the values are exactly zero.
>
> then i tried to convert sinc into a continuous function: mysinc = @(x)sin(pi*x)./(pi*x)
> (don't ask me why i didn't type mysinc = 'sin(pi*x)./(pi*x)'; instead, because i learn by example)
>
> this is where i get stuck. matlab seems to have good ways to find the roots of polynomials, but this function is not a polynomial. do i need to convert it into a polynomial form using euler relations or something ?
>
> Thanks!

  This is just what matlab's 'fzero' is designed for. The trick in using it is in choosing the appropriate initial estimate, and since sinc has infinitely many zero crossings that is especially important in converging on the one you want.

Roger Stafford

Subject: find zero values of sinc

From: Jonathan

Date: 19 Dec, 2008 18:04:02

Message: 5 of 7

"David " <REMOVEdavidg@UPPERCASEphy.LETTERSucsf.edu> wrote in message <gieh8q$1g6$1@fred.mathworks.com>...
> hi all:
>
> i want to find the zero values of sinc, where sinc = sin(pi*x)./(pi*x)
>
> x = -5.5:0.1:5.5;
> sinc = sin(pi*x)./(pi*x);
> plot(x, sinc)
>
>
> you can clearly see the zero crossings, but find(sinc == 0) is null (i think) because i've discretized a continuous function, and none of the values are exactly zero.
>
> then i tried to convert sinc into a continuous function: mysinc = @(x)sin(pi*x)./(pi*x)
> (don't ask me why i didn't type mysinc = 'sin(pi*x)./(pi*x)'; instead, because i learn by example)
>
> this is where i get stuck. matlab seems to have good ways to find the roots of polynomials, but this function is not a polynomial. do i need to convert it into a polynomial form using euler relations or something ?
>

The zeroes are just all integers except for 0.

Subject: find zero values of sinc

From: David

Date: 19 Dec, 2008 19:25:03

Message: 6 of 7

"Jonathan " <sievers.notreally.@cita.utoronto.ca> wrote in message <gignmi$87u$1@fred.mathworks.com>...
> "David " <REMOVEdavidg@UPPERCASEphy.LETTERSucsf.edu> wrote in message <gieh8q$1g6$1@fred.mathworks.com>...
> > hi all:
> >
> > i want to find the zero values of sinc, where sinc = sin(pi*x)./(pi*x)
> >
> > x = -5.5:0.1:5.5;
> > sinc = sin(pi*x)./(pi*x);
> > plot(x, sinc)
> >
> >
> > you can clearly see the zero crossings, but find(sinc == 0) is null (i think) because i've discretized a continuous function, and none of the values are exactly zero.
> >
> > then i tried to convert sinc into a continuous function: mysinc = @(x)sin(pi*x)./(pi*x)
> > (don't ask me why i didn't type mysinc = 'sin(pi*x)./(pi*x)'; instead, because i learn by example)
> >
> > this is where i get stuck. matlab seems to have good ways to find the roots of polynomials, but this function is not a polynomial. do i need to convert it into a polynomial form using euler relations or something ?
> >
>
> The zeroes are just all integers except for 0.

yes! i noticed that, i'm still muddling over that result. i wasn't sure if i should act spooked, or like a dully unimpressed high-school geometry student. the ratio of two irrational numbers giving me the sequence of integers like that. was going to ask about it on mathnerds

Subject: find zero values of sinc

From: Walter Roberson

Date: 19 Dec, 2008 20:41:48

Message: 7 of 7

David wrote:
> "Jonathan " <sievers.notreally.@cita.utoronto.ca> wrote in message <gignmi$87u$1@fred.mathworks.com>...
>> "David " <REMOVEdavidg@UPPERCASEphy.LETTERSucsf.edu> wrote in message <gieh8q$1g6$1@fred.mathworks.com>...

>>> i want to find the zero values of sinc, where sinc = sin(pi*x)./(pi*x)

>> The zeroes are just all integers except for 0.
 
> yes! i noticed that, i'm still muddling over that result. i wasn't sure if i should act
> spooked, or like a dully unimpressed high-school geometry student.

The result should not surprise you at all. pi*x is a non-zero constant except when x is 0,
and if x is 0 then sin(pi*0) is sin(0) so you have 0/0 which is not defined, so you
need to exclude 0 from the solutions. But for non-zero x, pi*x will never be 0, so
if you are looking for a zero of sin(pi*x) ./ (pi*x) then clearly the other zeros
will depend only on the numerator, sin(pi*x). And anyone who has done enough math
to have learned about sine knows that when you are working with radians, the zeros
of sine occur every pi radians regular as clock-work.

--
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
thanks David 18 Dec, 2008 18:45:08
sinc zeros find so... David 18 Dec, 2008 17:05:07
rssFeed for this Thread

Contact us