how to reduce a processing time in a FOR LOOP

2 Ansichten (letzte 30 Tage)
Luiz Bernardo
Luiz Bernardo am 26 Dez. 2012
Hi, I have the following problem. I'm simulating a ODFM system that I must create a BERxSNR graphic using a for command . The problem is that I need to apply a viterbi algorithm two times inside this loop to estimate the signal. But this takes a long time to process (some times several days). I would like to have an option to reduce this time , below follows a very basic sample of the code
for isnr =2:1:30 (% SNR)
received signal to be analysed; %that is a [matrix 1 x (M x N)]
funtion viterbi 1 %( Its a loop point by point)
real(recived signal to be analysed)
output 1 ( [matrix 1 x (M/2 x N/2)]
funtion viterbi 2 ( Its a loop point by point)
imag(recived signal to be analysed)
output 2 ( [matrix 1 x (M/2 x N/2)]
data estimated=([output 1, output 2],MxN,1);% recompose the estimate data
end
[no_of_error(isnr),ratioisnr)]=biterr(data in , data_estimated)
  2 Kommentare
Walter Roberson
Walter Roberson am 26 Dez. 2012
Are your two functions really defined inside the "for" loop ??
Your outline does not show "isnr" being used?
Jan
Jan am 27 Dez. 2012
Does the profiler reveal, which lines require the most time? What are usual sizes of "M" and "N"?
It is most likely impossible to give a specific suggestion for an improvement based on an outlines code only. Posting the relevant (most time consuming) part of the real code would be more helpful.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by