Discussion:
not enough memory to plot wav. file
(too old to reply)
dgsdgdg
2008-07-31 17:40:20 UTC
Permalink
Hello....
 
I'm new in LabVIEW and i'm try do a simple v.i. that reads a wav. file and plots it also makes spectrum analyze.
Because the wav. that i use is ultrasound with a sampling freq. 250KHz,1channel,16bits when i open a 9 second file the V.I. plots it; but when i open an 1 minute duration file i get the "not enought memory" error.
 
My system is a laptop pc with 2gb ram.
I attach the V.I.
 
Do anyone know how can i make this work?
 
Thnks


UltraSound.vi:
http://forums.ni.com/attachments/ni/170/345580/1/UltraSound.vi
smercurio_fc
2008-07-31 18:40:22 UTC
Permalink
If I did my math right (not sure with this new calculator that I just got) that comes out to 444MBytes of RAM required. That's 444MB of contiguous memory. My guess is that you don't have a contiguous chunk that big. What's the longest length that you can read? Try shutting down extraneous programs.
dgsdgdg
2008-07-31 19:10:09 UTC
Permalink
Thnks for the interest.....
 
I had read many tutorials that they say that LabVIEW needs contiguous memory but i was wondering if there is any solution.
With this V.I. when i close all the programs i manage to read and the 1 minute file but the proplem comes when i want to plot bigger files.
I want to make it atleast to plot 6 minutes files.
 
Also this is a part of one project that will records,analyzes and plays those files with the DAQ 6062E hardware.
I allready manage to modified the standard LabVIEW V.I.'s and make one  that can plays a 6 minutes file but this works only for the playback.
Now for the analyzing the waveform graph does not like the files.
 
Please don't tell me that is an unsolve problem.... :-(
 
I attach the V.I. of playback.


UltraSoundPlayer.vi:
http://forums.ni.com/attachments/ni/170/345634/1/UltraSoundPlayer.vi
Ian Ren
2008-07-31 19:40:08 UTC
Permalink
Can you calculate and plot the envelope of the signal at lower sample rate first (so you can plot all signal in full), and then plot the signal at the full sample rate only in the range that is of interest to you.
 
Your screen/printer resolution will not be able to distinguish points at your full sample rate anyway.
 
Ian 
dgsdgdg
2008-07-31 19:40:11 UTC
Permalink
I allready thought about that but the problem is that i need all the range because i have sound until 110 - 120KHz so this sample rate is the lower i can use without other problems from alliasing.
Ian Ren
2008-07-31 20:10:06 UTC
Permalink
I did not mean you should down-sample the signal.
Here is what you can do,
1) Pick 250 points,
2) Find max and min of these 250 points, append them to a Max Array and a Min Array.
3) Pick next 250 points
4) Repeat steps 2) and 3) until the end of the signal is reached.
5) plot out the Max and Min arrays at a sample rate of 1kHz, which is the envelop of your signal.
Hope this helps
 
Ian
 
 
dgsdgdg
2008-07-31 20:40:22 UTC
Permalink
Ok....I will try this tomorrow because now is late here in Greece (30 minutes before midnight) and i hope it works...
 
Thank you for your answers and goodnight
TerjeL
2008-08-07 10:10:11 UTC
Permalink
Hi, I have similar problems when trying to keep a big amount of high frequency sampled data in memory and plot it. The enveloping method that was mentioned may help in my case so I will try it. Are there any built-in functions in labview to easily create an envelope like this?BrgdsTerje Lundsten
Ian Ren
2008-08-07 12:40:06 UTC
Permalink
Due to change of job, I do not have access to LabVIEW at the moment (hopefully, this will not last too long). I am sure someone on this forum can help.
 
Good luck.
 
Ian
dgsdgdg
2008-08-05 10:40:09 UTC
Permalink
Hello again.....
I try the solution you gave me and i built this V.I. (see attachment)...........BUT........when i load a file it starts with a good speed to read it and fills the slider.After few thousands of samples it starts to become slow and i don't know why.The amound of ram that uses its the same and also the amount of proccesor.
 
If anybody can help i will be very happy.Thanks.
 


Split_Read.vi:
http://forums.ni.com/attachments/ni/170/346635/1/Split_Read.vi
dgsdgdg
2008-08-05 11:10:04 UTC
Permalink
oohhhh.....and one question that it comes now...How do you calculate the amount of ram that a file needs?For example 1000 samples of a sound file of 250000KHz s/r-16 bit depth?
smercurio_fc
2008-08-07 14:10:08 UTC
Permalink
dgsdgdg wrote:oohhhh.....and one question that it comes now...How do you calculate the amount of ram that a file needs?For example 1000 samples of a sound file of 250000KHz s/r-16 bit depth?You multiply. #of samples x # of bytes = amount of RAM. TerjeL wrote:I have
similar problems when trying to keep a big amount of high frequency
sampled data in memory and plot it. The enveloping method that was
mentioned may help in my case so I will try it. Are there any built-in
functions in labview to easily create an envelope like this?There are no built-in VIs that I know of to do this.
DFGray
2008-08-08 14:10:06 UTC
Permalink
You can find example VIs (including decimation for display) and tips and tricks for handling large data sets in the tutorial <a href="http://zone.ni.com/devzone/cda/tut/p/id/3625" target="_blank">Managing Large Data Sets in LabVIEW</a>.&nbsp; If you need more help, let us know.
Loading...