Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Uh nevermind. I went and checked what was going on. Apparently I can't take the logrithm of zero. [oh ya!] That was giving my the error. I am going to solve this by checking my freqency component for any zero's before I take the log of it and replace it with a 1.&nbsp;Hopefully that will stop giving me the error. Then I can move onto display problems. Don't ya just love debugging? &nbsp; Logan <BLOCKQUOTE dir=ltr style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> "Logan Lindquist" &lt;<A href="mailto:llindqusit@mrdoc.cc">llindqusit@mrdoc.cc&gt; wrote in message <A href="news:9s995b$bnq$1@sulawesi-fi.lerc.nasa.gov">news:9s995b$bnq$1@sulawesi-fi.lerc.nasa.gov...
Does anyone know what the minum window size is for the fft function? Does it have to be divisble by a certain number? I am getting 0's with a 8x8 array. The array is pretty flat and dark [all around pixel value of 50] but I wouldn't think that I should get zero's returned as a frequency component. &nbsp; The solution that I see is to check to see if there are zero's in the array and then either change them to 0.1 or skip that array when trying to display it. [with a note to the user letting them know that no frequency component can be found.] &nbsp; Hopefully someone will read this! I am going to try calling RSI to see if they have an answer. &nbsp; Thanks, &nbsp; Logan Lindquist <BLOCKQUOTE dir=ltr style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> "Logan Lindquist" &lt;<A href="mailto:llindqusit@mrdoc.cc">llindqusit@mrdoc.cc&gt; wrote in message <A href="news:9sc8tm$otu$1@sulawesi-fi.lerc.nasa.gov">news:9sc8tm$otu$1@sulawesi-fi.lerc.nasa.gov... &nbsp;
Paul Manusiu wrote: > What is the log of zero ?? > > Logan Lindquist wrote: > > What is this NaN >> business and why am I getting Infinity? Also, what is the log of a negative number? -- ----------------------------------------------------------- Nigel Wade, System Administrator, Space Plasma Physics Group, University of Leicester, Leicester, LE1 7RH, UK E-mail : nmw@ion.le.ac.uk Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
"Logan Lindquist" <llindqusit@mrdoc.cc> writes: > This is a multi-part message in MIME format. > > ------=_NextPart_000_0009_01C16841.6350B0C0 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > Does anyone know what the minum window size is for the fft function? = > Does it have to be divisble by a certain number? I am getting 0's with a = > 8x8 array. The array is pretty flat and dark [all around pixel value of = > 50] but I wouldn't think that I should get zero's returned as a = > frequency component.=20 > > The solution that I see is to check to see if there are zero's in the = > array and then either change them to 0.1 or skip that array when trying = > to display it. [with a note to the user letting them know that no = > frequency component can be found.] > > Hopefully someone will read this! I am going to try calling RSI to see = > if they have an answer.=20 Logan, the usual way fourier power is defined, is the *squared magnitude* of the fourier coefficients. If you define power = -alog10( abs(f)^2 ) then I think your problems will be alleviated. Craig -- ------------------------------------------------------------ -------------- Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response ------------------------------------------------------------ --------------
Paul, &nbsp; As far as I know :) The log[base 10]&nbsp;of zero and the log[base 0] do not exist. I am not qualified to give you an mathmatical rule or proof that proves the reason behind this. I think of it as another of those rules in mathmatics that are just because. I do think that it has something to do with&nbsp;how logs [plural of the mathmatical term and not the wooden kind] describe the curve of lines occuring in a coordinate system. Thus a zero would indicate that no line exists. &nbsp; If you question was meant to make me aware of the reason behind my error in IDL, I thank you. I figured this out last week and now I am working on a solution to solve it. Any&nbsp;suggestions to what I should do with&nbsp;the zero's in my array would be helpful! &nbsp; Regards, &nbsp; Logan &nbsp; <BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> "Paul Manusiu" &lt;<A href="mailto:phpvm@alinga.newcastle.edu.au">phpvm@alinga.newcastle.edu.au&gt; wrote in message <A href="news:3BEB6874.8305BCD@alinga.newcastle.edu.au">news:3BEB6874.8305BCD@alinga.newcastle.edu.au... What is the log of zero ??
"Nigel Wade" <nmw@ion.le.ac.uk> wrote in message news:9sg7v1$9ofc$1@rook.le.ac.uk... > Also, what is the log of a negative number? Nigel, I guess those don't exist either and I should be taking the absolute value or converting it to a data format that doesn't include negative numbers BEFORE taking the log of it. That might help things a bit. Thanks for the suggestion! Regards, Logan
Nigel Wade <nmw@ion.le.ac.uk> writes: > Paul Manusiu wrote: > >> What is the log of zero ?? >> >> Logan Lindquist wrote: >> >> What is this NaN >>> business and why am I getting Infinity? > > Also, what is the log of a negative number? > > -- > ----------------------------------------------------------- > Nigel Wade, System Administrator, Space Plasma Physics Group Hey, someone else in the Space Plasma Physics dept might tell you that alog(-1) should return complex(0,+/-!PI) ! e^(-i pi) + 1 = 0 And therein lies a lot! -- ------------------------------------------------------------ -------------- Stein Vidar Hagfors Haugan ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO NASA Goddard Space Flight Center, Email: shaugan@esa.nascom.nasa.gov Mail Code 682.3, Bld. 26, Room G-1, Tel.: 1-301-286-9028/240-354-6066 Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264 ------------------------------------------------------------ --------------
Yes, it was a rhetorical question. The reason why you can't take the log of zero is simple. Best described&nbsp; by an example. given, y = 10 ^ x than, log_base_10 both sides gives log(y) = x if x = 0, than, in the first equation y = 1, if y = 0,&nbsp; x is not defined.&nbsp; (i.e. there is no power of 10 that can give you y = 0) Therefore, log (0) does not exist.&nbsp;&nbsp; As for what you do with zeros, I usually set a limit on my arrays. If array[i] less than limit, than array[i] equal limit. Usually I set limit equal to 10^(-6). But it depends on your array values. Best thing to do is normalize array before setting limit, than scale back to orginal values. You can use the "where" function for quick search of array. Cheers Paul M. Logan Lindquist wrote: Paul,&nbsp;As far as I know :) The log[base 10] of zero and the log[base 0] do not exist. I am not qualified to give you an mathmatical rule or proof that proves the reason behind this. I think of it as another of those rules in mathmatics that are just because. I do think that it has something to do with how logs [plural of the mathmatical term and not the wooden kind] describe the curve of lines occuring in a coordinate system. Thus a zero would indicate that no line exists.&nbsp;If you question was meant to make me aware of the reason behind my error in IDL, I thank you. I figured this out last week and now I am working on a solution to solve it. Any suggestions to what I should do with the zero's in my array would be helpful!&nbsp;Regards,&nbsp;Logan&nbsp; <blockquote style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">"Paul Manusiu" &lt;<a href="mailto:phpvm@alinga.newcastle.edu.au">phpvm@alinga.newcastle.edu.au> wrote in message <a href="news:3BEB6874.8305BCD@alinga.newcastle.edu.au">news:3BEB6874.8305BCD@alinga.newcastle.edu.au...What is the log of zero ?? -- ------------------------------------------------------------ -- Tapu'osi Paul Manusiu Loto'aniu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& amp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tel: +61 0249 215566 CRC for Satellite Systems&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fax: +61 0249 216907 Space Physics Group School of Mathematical and Physical Sciences University Of Newcastle, Australia ------------------------------------------------------------ -- "The greatness of a nation and its moral progress can be judged by the way its animals are treated". - GANDHI &nbsp;