Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

mathscript and sound

hello everybody, i'm using the soundcard to do a dtmf experiment. now the generator part is finished, but the detector part has some problems. for the detector i modified the ni example "continuous sound input".

after the 'sound input read' vi, i inserted a mathscript to perform the dtmf algorithm.  the mathscript has an input y, which is connected to the data terminal of sound input read vi. in the mathscript node there is a loop:

for jj=1:512



everytime i ran this vi, it told me that the y(jj)  line is wrong, the message is 'index out of bound'.

can anyone explain this? thank you!


0 Kudos
Message 1 of 2

That error indicates you are indexing beyond the end of the array.  Try putting a LabVIEW probe on the wire that is attached to the 'y' input of the MathScript node.  Ensure there are 512 elements in the array (beware that LabVIEW uses 0-based indexing).  As an alternative, drop the array size primitive and wire it to your 'y' wire.  Create an indicator to see how many elements are in the 'y' vector.

Grant M.
Staff Software Engineer | LabVIEW MathScript | National Instruments
0 Kudos
Message 2 of 2