Jump to content

sound buffering


Recommended Posts

Here is my story....

I am working on a software defined radio implemented in Labview. At the moment I am reading a binary file which contains I & Q radio samples (eventually I will read from a pipe or TCP).

The way it is set up at the moment, I have a while loop containing a for loop and the sound

Link to comment
Glad to hear that you got your sound card working with LabVIEW mate!

That problem still exists. Gave up and moved onto anther computer. I'l try sorting it out again when I get a chance. Same old story tho, not enough hours in the day.

Ok, so i figured out the slowness problem was because I was reading a single sample at a time. Now I read a whole lot and the program can keep up.

There is still a slight gap though. There was a mention of a artical somewhere about gapless sound and buffering. Does anyone know where I can get a copy of this??

Here is the VI I have been using. It isn't much good to test without the data file (the data file is rather large), but you may be able to see room for improvment in regards to the loops and buffering.

Cheers Paul

Download File:post-5499-1153801763.vi

Link to comment
Now I read a whole lot and the program can keep up.

There is still a slight gap though.

I would suggest using a parallel loop for the SO Write function, and passing the data from the read/calc loop to the SO Write loop through a queue. I've attached a quickly modified version of youR vi for review.

If your data set is large (or continious) you should place some sort of wait next multiple in the producer (read/calc) loop so you don't eat up all your system memory by producing SO data faster than the output rate.

Also, performance almost always improves when you keep the data types as integer and provide the correct type input to the primative functions. I believe you are writing doubles to the 8 bit mono input of the SO write, after adding a constant of type double to an I8.

Download File:post-949-1153827402.vi

Link to comment
I would suggest using a parallel loop for the SO Write function, and passing the data from the read/calc loop to the SO Write loop through a queue. I've attached a quickly modified version of youR vi for review.

If your data set is large (or continious) you should place some sort of wait next multiple in the producer (read/calc) loop so you don't eat up all your system memory by producing SO data faster than the output rate.

Also, performance almost always improves when you keep the data types as integer and provide the correct type input to the primative functions. I believe you are writing doubles to the 8 bit mono input of the SO write, after adding a constant of type double to an I8.

Download File:post-949-1153827402.vi

Thanks guys, I'll have a look later on in the week. I was unsure how to implement queues...

Cheers Paul

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.