06-28-2009 08:25 PM
Hello,
I am trying to simulate a CDMA system, transmittting one message, which is of length 10000 bits, and then multiplying each bit in the message with 256 bit array. The gives a huge array of length 2560000, and this is broken up into 1000 segments for processing in the transmitter_28M_mod_for_ber.VI.
I am trying to get a BER graph, and to get a proper graph, my message length has to be at least 1 million bits long. However, if I increase the number of message bits, I get a memory full error.
The actual BER calculation is in the CDMA_system_28May VI, and other supporting VIs have been attached as well. The message length is set in the message_gen VI.
Can anyone please give any suggestions as to what I should do to achieve a BER for message length of 1 million iwthout any memory full errors?
Thanks a lot.
06-28-2009 08:26 PM
06-28-2009 08:28 PM
06-28-2009 11:07 PM
Are you sure the algorithm is correct?
I don't claim to understand what you are doing, but looking at the code a lot seems a bit odd.
message_gen.vi: Why are you setting the polynomial order to 10000?? (It gets coerced down to a reasonable number anyway).
CDMA system....vi: To calculate the mean of a 2D array, just use "add array elements" and divide by the product of dimension. No need to take the mean in stacked loops. Why is the 2D array complex? You never use the imaginary part (see also below).
Receiver-modified_ber_gah.vi: You never use the imaginary part, so why are you even wiring the complex array to this VI if all you ever use is the real part? To get the first dimension, you don't need to index out a row and the use array size. Use array size on the 2D array and index from there.
transmitter_28M_mod_for_ber.vi: A random number multiplied by zero, converted to I32 and use to size an initialized array and prepended to a complex array is just the complex array. All this makes no sense. The last FOR loop is a simple "reshape array". You have a lot of wires going to autoindexing tunnels at the loop boundary, ending in thin air. All these seem to allocate bufffers for no purpose. Why is the array complex at all. You never seem to use the imaginary part later.
In general, watch out for coercions (red little dots). Your VI is full of them.
You also have a lot of indicators containing huge data structures. Make sure that all subVIs have the FP closed when you run the toplevel VI.
Have you done some profiling?
06-29-2009 12:37 AM
Hi Altenbach,
Yes the algorithm is correct.
I am trying to create a CDMA system, adn so far this algorithm seems about right.
message_gen.vi: yes, sorry, that was a mistake. thanks for pointing it out. Have changed it now.
CDMA_system...vi: I used a complex 2D array because I will be using the imaginary part later on.
Receiver_mod_ber_gah: Again, need imaginary part later on. Yeah, I know what you mean about using the array size and indexing from there, but does that really matter?
Transmitter_28M....vi: yes, I have changed it, it was left over from something done previously, my apologies. I have also removed all the unnecessay autoindexing tunnels. Again, need the complex part for later on.
Does coercions cause any major problems?
The only indicators I have now are the ones which I use for outputs of the VI and I need them.
Yeah, I tried to do some profiling, went tools > Profile > Perfromance and Memory, but that just gave me the time spent in each VI. How does this help me?
I have also attached the modified VI's.
Thanks a lot.
06-29-2009 12:46 AM
Hi
Also in the CDMA_system..vi: Like u have suggested ..the mean doesnt need to be calculated in such an inefficient way as I have done. thanks for pointing that out. I have changed it as u have suggested and attachd it.
Thanks
06-29-2009 01:09 AM
LSASS wrote:Does coercions cause any major problems?
Coercions normally require a data copy and thus a new buffer allocation in memory, so they are definitely not recommended if you suspect memory issues. You should make sure not to switch datatypes.
What is typical input data? I was able to run your VI without any memory issues.
06-29-2009 01:28 AM
LSASS wrote:Hi
Also in the CDMA_system..vi: Like u have suggested ..the mean doesnt need to be calculated in such an inefficient way as I have done. thanks for pointing that out. I have changed it as u have suggested and attachd it.
There are still a few issues with your new version:
06-29-2009 01:43 AM - edited 06-29-2009 01:44 AM
LSASS wrote:Transmitter_28M....vi: yes, I have changed it, it was left over from something done previously, my apologies. I have also removed all the unnecessay autoindexing tunnels. Again, need the complex part for later on.
The right side of the code is still too complicated. Instead of the FOR loop, all you need is "reshape array", e.g. as follows:
06-29-2009 03:39 AM
Hi Altenbach,
So to get rid of coercions, do I have to use data conversion evrywhere ther is a red dot?
Yes, with this length of the message, ie 10000 bits in the message_gen.vi, there is no memory issue. However, I need to have this length much larger like over a million bits long in order to get a proper i.e an accurate BER result. But I am unable to do this as I get the "memory is full" problem. Is there a way through this?
Thanks a lot, 🙂