how to reduce a processing time in a FOR LOOP
3 次查看(过去 30 天)
显示 更早的评论
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
2012-12-26
Are your two functions really defined inside the "for" loop ??
Your outline does not show "isnr" being used?
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 Center 和 File Exchange 中查找有关 Error Detection and Correction 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!