Re: Reproducible kernel crash
- To: mathgroup at smc.vnet.net
- Subject: [mg80160] Re: Reproducible kernel crash
- From: j.f.b.payne at tesco.net
- Date: Tue, 14 Aug 2007 06:56:04 -0400 (EDT)
- References: <f9p4qn$qmi$1@smc.vnet.net>
On 13 Aug, 09:30, "Andrew Moylan" <andrew.j.moy... at gmail.com> wrote: > The following code crashes the kernel the *second* time it is executed: > > makeNoise[psd_] := InverseFourier[ > Sqrt[Join[psd, {1}, Take[Reverse[psd], Length[psd] - 1]]]* > Fourier[RandomReal[NormalDistribution[0, 1], 2*Length[psd]]]] > psd = Join[Table[0, {8}], Table[2, {16}], Table[0, {8}]]; > (ListCorrelate[#1, #1, 1] & )[makeNoise[psd]] > > Can anyone figure out why? It is a Mathematica bug (v6, Windows XP at least). There is a weird interaction between ListCorrelate and your makeNoise. Try this tmp = RandomReal[{-1, 1}, 64]; ListCorrelate[tmp, tmp, 1] makeNoise[psd_] := InverseFourier[ Sqrt[Join[psd, {1}, Take[Reverse[psd], Length[psd] - 1]]]* Fourier[RandomReal[NormalDistribution[0, 1], 2*Length[psd]]]] psd1 = Join[Table[0, {8}], Table[2, {16}], Table[0, {8}]]; makeNoise[psd1]; The makeNoise[psd1]; statement crashes it. If you repeat the above without evaluating tmp and ListCorrelate, all is well. So the reason your version crashed second time was that you evaluated ListCorrelate between 1st and 2nd evaluations of makeNoise John Payne