1
$\begingroup$

I've encountered a problem using the ListCorrelate function which I haven't been able to solve or find much information on. Using the following code:

signalHP = Differences[#] &@signal[[ startTime;;endTime]];
smoothSignal = ListCorrelate[kernelGaus,Abs[signalHP],Ceiling[Length[kernelGaus]/2], 0];

For some cases, I get the following error:

ListCorrelate::ohp: Overhang parameters in 21 must be nonzero machine-sized integers, or lists of nonzero machine-sized integers.

When trying to run the function outside the loop with the same variables everything seems to be okay, and I don't seem to have a solution for this problem.

Please help :)

Jonathan.

Edit: an example from the error code:

ListCorrelate[{0.0010372, 0.00153193, 0.00221782, 0.00314724, 
  0.00437771, 0.00596868, 0.0079767, 0.0104492, 0.013417, 0.0168867, 
  0.0208327, 0.025192, 0.0298602, 0.0346926, 0.0395089, 0.0441029, 
  0.0482562, 0.0517552, 0.0544088, 0.0560658, 0.0566292, 0.0560658, 
  0.0544088, 0.0517552, 0.0482562, 0.0441029, 0.0395089, 0.0346926, 
  0.0298602, 0.025192, 0.0208327, 0.0168867, 0.013417, 0.0104492, 
  0.0079767, 0.00596868, 0.00437771, 0.00314724, 0.00221782, 
  0.00153193, 0.0010372}, {0.00243154, 0.00224579, 0.0017793, 
  0.00109954, 0.000330857, 0.000368226, 0.000836894, 0.000945848, 
  0.000625539, 0.000117404, 0.00119879, 0.00247025, 0.00374367, 
  0.00482164, 0.00552871, 0.00572265, 0.00531275, 0.00428534, 
  0.00270755, 0.000722462, 0.00146637, 0.00362149, 0.00550907, 
  0.00694489, 0.00784239, 0.00825294, 0.00838615, 0.00859906, 
  0.00934729, 0.0110999, 0.0142293, 0.0188977, 0.0249659, 0.0319513, 
  0.039053, 0.0452584, 0.0495058, 0.0508616, 0.0486958, 0.0428183, 
  0.0335364, 0.0216226, 0.00819578, 0.00545847, 0.0180907, 0.0286732, 
  0.0365316, 0.0414032, 0.0434171, 0.0430115, 0.0408126, 0.0375016, 
  0.0337003, 0.0299071, 0.0264595, 0.0235165, 0.0210823, 0.0190443, 
  0.0172182, 0.015393, 0.0133727, 0.0110146, 0.00825988, 0.0051527, 
  0.00184464, 0.00142164, 0.00435084, 0.00665019, 0.00809003, 
  0.00855838, 0.00809454, 0.0068908, 0.00526119, 0.00357247, 
  0.00216155, 0.00127368, 0.00102042, 0.00136112, 0.002121, 
  0.00303927, 0.00383378, 0.00426668}, 21, 0]
$\endgroup$
  • $\begingroup$ Could you please also provide exampledata that reproduces the error? $\endgroup$ – Henrik Schumacher Apr 26 '18 at 12:33
  • $\begingroup$ added to the original question. thanks! When running it on it's own, it seems to work fine... $\endgroup$ – Jonathan Apr 26 '18 at 13:07
  • $\begingroup$ Hm. That example does not throw an error message in my copy of Mathematica version 11.3. Are you sure that it produces an error on your machine? $\endgroup$ – Henrik Schumacher Apr 26 '18 at 13:15
  • $\begingroup$ That's the problem I'm facing. The error code shows these values but they don't seem to be problematic. I haven't been able to find indications of when this error might appear. $\endgroup$ – Jonathan Apr 26 '18 at 13:31
  • 1
    $\begingroup$ Use TracePrint[yourCode, _ListCorrelate] to see the actual call to ListCorrelate. $\endgroup$ – Carl Woll Apr 26 '18 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.