LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

display last N seconds of sound input data on chart

Hi,

 

I am having trouble getting a chart to show the last N waveforms of sound input data where the waveforms are collected once per second and contain 48000 points.  

 

In the attached VI, there are two loops and each one updates a chart that has the chart history set to 10 waveforms.  One loop generates a sine wave and the chart for that loop works as expected and after the first 10 samples are collected, continues to show the last 10 samples (or 10 seconds of data). The other loop collects sound input from a microphone, but the corresponding chart does not consistently show the last 10 waveforms (which should be 10 seconds of data since a waveform is collected once per second).  I am not sure why one chart is working and the other is not since they both have the same number of points in the waveform that is generated each loop iteration.  

 

Thanks,

Gary

0 Kudos
Message 1 of 3
(3,214 Views)

It's not your code, it's your plots.  The X axis is a TimeStamp, the number of seconds since 1 Jan 1904.  The synthesized sound starts at time 0, so has no problem scaling the X axis to hold 10 seconds of data.  The Actual Sound is getting messed up with trying to scale the X axis.  Find a way to fix this, and your problem should go away.

 

Bob Schor

0 Kudos
Message 2 of 3
(3,198 Views)

Bob,

 

Thanks for the feedback.  I did notice that the waveform from the Sound Input has a timestamp that is current time and the waveform for the sine wave has a timestamp that starts on 12/31/1903.  I tried changing the format of the x-axis, but that didn't seem to work.  Unfortunately, i still can't figure out how to fix this and don't understand why this isn't working.

 

Gary

0 Kudos
Message 3 of 3
(3,161 Views)