how to reduce a processing time in a FOR LOOP

9 vues (au cours des 30 derniers jours)
Luiz Bernardo
Luiz Bernardo le 26 Déc 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 commentaires
Walter Roberson
Walter Roberson le 26 Déc 2012
Are your two functions really defined inside the "for" loop ??
Your outline does not show "isnr" being used?
Jan
Jan le 27 Déc 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Error Detection and Correction dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by