how to reduce a processing time in a FOR LOOP

조회 수: 2 (최근 30일)
Luiz Bernardo
Luiz Bernardo 2012년 12월 26일
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
Walter Roberson
Walter Roberson 2012년 12월 26일
Are your two functions really defined inside the "for" loop ??
Your outline does not show "isnr" being used?
Jan
Jan 2012년 12월 27일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Error Detection and Correction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by